Compare commits

...

7 Commits

135 changed files with 21415 additions and 38 deletions

View File

@ -1,7 +1,7 @@
###
# @Author: Do not edit
# @Date: 2023-08-29 09:40:39
# @LastEditTime: 2023-11-03 11:16:12
# @LastEditTime: 2023-11-06 09:08:54
# @LastEditors: DY
# @Description:
###
@ -15,6 +15,7 @@ VUE_APP_TITLE = MES系统
# VUE_APP_BASE_API = 'http://100.64.0.26:48082'
# VUE_APP_BASE_API = 'http://192.168.0.33:48082'
VUE_APP_BASE_API = 'http://192.168.4.173:48080'
# VUE_APP_BASE_API = 'http://192.168.2.173:48080'
# VUE_APP_BASE_API = 'http://192.168.1.49:48080'
# VUE_APP_BASE_API = 'http://192.168.1.8:48080'
# VUE_APP_BASE_API = 'http://192.168.1.56:48080'

View File

@ -0,0 +1,60 @@
/*
* @Author: Do not edit
* @Date: 2023-10-21 11:50:46
* @LastEditTime: 2023-11-03 15:25:55
* @LastEditors: DY
* @Description:
*/
import request from '@/utils/request'
// 创建异常警告
export function createcoreAlarmLog(data) {
return request({
url: '/base/core-alarm-log/create',
method: 'post',
data: data
})
}
// 更新异常警告
export function updatecoreAlarmLog(data) {
return request({
url: '/base/core-alarm-log/update',
method: 'put',
data: data
})
}
// 删除异常警告
export function deletecoreAlarmLog(id) {
return request({
url: '/base/core-alarm-log/delete?id=' + id,
method: 'delete'
})
}
// 获得异常警告
export function getcoreAlarmLog(id) {
return request({
url: '/base/core-alarm-log/get?id=' + id,
method: 'get'
})
}
// 获得警告分页
export function getcoreAlarmLogPage(query) {
return request({
url: '/base/core-alarm-log/page',
method: 'get',
params: query
})
}
// 获得所有列表
export function getcoreAlarmLogList(query) {
return request({
url: '/base/core-alarm-log/list',
method: 'get',
params: query
})
}

111
src/api/base/coreProduct.js Normal file
View File

@ -0,0 +1,111 @@
/*
* @Author: Do not edit
* @Date: 2023-10-21 11:50:46
* @LastEditTime: 2023-11-04 10:42:50
* @LastEditors: DY
* @Description:
*/
import request from '@/utils/request'
// 创建产品
export function createCoreProduct(data) {
return request({
url: '/base/core-product/create',
method: 'post',
data: data
})
}
// 更新产品
export function updateCoreProduct(data) {
return request({
url: '/base/core-product/update',
method: 'put',
data: data
})
}
// 删除产品
export function deleteCoreProduct(id) {
return request({
url: '/base/core-product/delete?id=' + id,
method: 'delete'
})
}
// 获得产品
export function getCoreProduct(id) {
return request({
url: '/base/core-product/get?id=' + id,
method: 'get'
})
}
// 获得产品code
export function getCode() {
return request({
url: '/base/core-product/getCode',
method: 'get'
})
}
// 获得产品分页
export function getCoreProductPage(query) {
return request({
url: '/base/core-product/page',
method: 'get',
params: query
})
}
// 获得所有列表
export function getCoreProductList(query) {
return request({
url: '/base/core-product/listAll',
method: 'get',
params: query
})
}
// 创建产品属性
export function createCoreProductAttr(data) {
return request({
url: '/base/core-product-attr/create',
method: 'post',
data: data
})
}
// 更新产品属性
export function updateCoreProductAttr(data) {
return request({
url: '/base/core-product-attr/update',
method: 'put',
data: data
})
}
// 删除产品属性
export function deleteCoreProductAttr(id) {
return request({
url: '/base/core-product-attr/delete?id=' + id,
method: 'delete'
})
}
// 获得产品属性
export function getCoreProductAttr(id) {
return request({
url: '/base/core-product-attr/get?id=' + id,
method: 'get'
})
}
// 获得产品属性分页
export function getCoreProductAttrPage(query) {
return request({
url: '/base/core-product-attr/page',
method: 'get',
params: query
})
}

View File

@ -0,0 +1,68 @@
/*
* @Author: Do not edit
* @Date: 2023-10-21 11:50:46
* @LastEditTime: 2023-11-03 19:06:15
* @LastEditors: DY
* @Description:
*/
import request from '@/utils/request'
// 创建产线
export function createCorePL(data) {
return request({
url: '/base/core-production-line/create',
method: 'post',
data: data
})
}
// 更新产线
export function updateCorePL(data) {
return request({
url: '/base/core-production-line/update',
method: 'put',
data: data
})
}
// 删除产线
export function deleteCorePL(id) {
return request({
url: '/base/core-production-line/delete?id=' + id,
method: 'delete'
})
}
// 获得产线
export function getCorePL(id) {
return request({
url: '/base/core-production-line/get?id=' + id,
method: 'get'
})
}
// 获得产线code
export function getCode() {
return request({
url: '/base/core-production-line/getCode',
method: 'get'
})
}
// 获得产线分页
export function getCorePLPage(query) {
return request({
url: '/base/core-production-line/page',
method: 'get',
params: query
})
}
// 获得所有列表
export function getCorePLList(query) {
return request({
url: '/base/core-production-line/listAll',
method: 'get',
params: query
})
}

View File

@ -0,0 +1,111 @@
/*
* @Author: Do not edit
* @Date: 2023-10-21 11:50:46
* @LastEditTime: 2023-11-06 10:50:57
* @LastEditors: DY
* @Description:
*/
import request from '@/utils/request'
// 创建工单
export function createCoreWO(data) {
return request({
url: '/base/core-work-order/create',
method: 'post',
data: data
})
}
// 更新工单
export function updateCoreWO(data) {
return request({
url: '/base/core-work-order/update',
method: 'put',
data: data
})
}
// 删除工单
export function deleteCoreWO(id) {
return request({
url: '/base/core-work-order/delete?id=' + id,
method: 'delete'
})
}
// 获得工单
export function getCoreWO(id) {
return request({
url: '/base/core-work-order/get?id=' + id,
method: 'get'
})
}
// 获得工单code
export function getCode() {
return request({
url: '/base/core-work-order/getCode',
method: 'get'
})
}
// 获得工单分页
export function getCoreWOPage(query) {
return request({
url: '/base/core-work-order/page',
method: 'get',
params: query
})
}
// 获得所有列表
export function getCoreWOList(query) {
return request({
url: '/base/core-work-order/listbyfilter',
method: 'get',
params: query
})
}
// 创建工单预使用原料
export function createCoreWOMa(data) {
return request({
url: '/base/core-work-order-material/create',
method: 'post',
data: data
})
}
// 更新工单预使用原料
export function updateCoreWOMa(data) {
return request({
url: '/base/core-work-order-material/update',
method: 'put',
data: data
})
}
// 删除工单预使用原料
export function deleteCoreWOMa(id) {
return request({
url: '/base/core-work-order-material/delete?id=' + id,
method: 'delete'
})
}
// 获得工单预使用原料
export function getCoreWOMa(id) {
return request({
url: '/base/core-work-order-material/get?id=' + id,
method: 'get'
})
}
// 获得工单预使用原料分页
export function getCoreWOMaPage(query) {
return request({
url: '/base/core-work-order-material/page',
method: 'get',
params: query
})
}

View File

@ -0,0 +1,68 @@
/*
* @Author: Do not edit
* @Date: 2023-10-21 11:50:46
* @LastEditTime: 2023-11-03 19:18:00
* @LastEditors: DY
* @Description:
*/
import request from '@/utils/request'
// 创建工段
export function createCWSection(data) {
return request({
url: '/base/core-workshop-section/create',
method: 'post',
data: data
})
}
// 更新工段
export function updateCWSection(data) {
return request({
url: '/base/core-workshop-section/update',
method: 'put',
data: data
})
}
// 删除工段
export function deleteCWSection(id) {
return request({
url: '/base/core-workshop-section/delete?id=' + id,
method: 'delete'
})
}
// 获得工段
export function getCWSection(id) {
return request({
url: '/base/core-workshop-section/get?id=' + id,
method: 'get'
})
}
// 获得工段code
export function getCode() {
return request({
url: '/base/core-workshop-section/getCode',
method: 'get'
})
}
// 获得工段分页
export function getCWSectionPage(query) {
return request({
url: '/base/core-workshop-section/page',
method: 'get',
params: query
})
}
// 获得所有列表
export function getCWSectionList(query) {
return request({
url: '/base/core-workshop-section/listAll',
method: 'get',
params: query
})
}

View File

@ -1,9 +1,16 @@
/*
* @Author: Do not edit
* @Date: 2023-10-21 10:11:01
* @LastEditTime: 2023-11-03 19:03:44
* @LastEditors: DY
* @Description:
*/
import request from '@/utils/request'
// 创建工厂
export function createFactory(data) {
return request({
url: '/base/factory/create',
url: '/base/core-factory/create',
method: 'post',
data: data
})
@ -12,7 +19,7 @@ export function createFactory(data) {
// 更新工厂
export function updateFactory(data) {
return request({
url: '/base/factory/update',
url: '/base/core-factory/update',
method: 'put',
data: data
})
@ -21,7 +28,7 @@ export function updateFactory(data) {
// 删除工厂
export function deleteFactory(id) {
return request({
url: '/base/factory/delete?id=' + id,
url: '/base/core-factory/delete?id=' + id,
method: 'delete'
})
}
@ -29,21 +36,30 @@ export function deleteFactory(id) {
// 获得工厂
export function getFactory(id) {
return request({
url: '/base/factory/get?id=' + id,
url: '/base/core-factory/get?id=' + id,
method: 'get'
})
}
// 获得工厂code
export function getCode() {
return request({
url: '/base/factory/getCode',
url: '/base/core-factory/getCode',
method: 'get'
})
}
// 获得工厂分页
export function getFactoryPage(query) {
return request({
url: '/base/factory/page',
url: '/base/core-factory/page',
method: 'get',
params: query
})
}
// 获得所有列表
export function getFactoryList(query) {
return request({
url: '/base/core-factory/listAll',
method: 'get',
params: query
})
@ -52,7 +68,7 @@ export function getFactoryPage(query) {
// 导出工厂 Excel
export function exportFactoryExcel(query) {
return request({
url: '/base/factory/export-excel',
url: '/base/core-factory/export-excel',
method: 'get',
params: query,
responseType: 'blob'

View File

@ -0,0 +1,75 @@
/*
* @Author: zwq
* @Date: 2023-11-02 14:21:18
* @LastEditors: zwq
* @LastEditTime: 2023-11-02 14:34:29
* @Description:
*/
import request from '@/utils/request'
// 创建仓库
export function createWarehouse(data) {
return request({
url: '/extend/warehouse/create',
method: 'post',
data: data
})
}
// 更新仓库
export function updateWarehouse(data) {
return request({
url: '/extend/warehouse/update',
method: 'put',
data: data
})
}
// 删除仓库
export function deleteWarehouse(id) {
return request({
url: '/extend/warehouse/delete?id=' + id,
method: 'delete'
})
}
// 获得仓库
export function getWarehouse(id) {
return request({
url: '/extend/warehouse/get?id=' + id,
method: 'get'
})
}
// 获得仓库列表
export function getWarehouseList() {
return request({
url: '/extend/warehouse/listAll',
method: 'get'
})
}
// 获得仓库code
export function getCode() {
return request({
url: '/extend/warehouse/getCode',
method: 'get'
})
}
// 获得仓库分页
export function getWarehousePage(query) {
return request({
url: '/extend/warehouse/page',
method: 'get',
params: query
})
}
// 导出仓库 Excel
export function exportWarehouseExcel(query) {
return request({
url: '/extend/warehouse/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -0,0 +1,76 @@
/*
* @Author: zwq
* @Date: 2023-11-02 16:20:15
* @LastEditors: zwq
* @LastEditTime: 2023-11-03 15:26:05
* @Description:
*/
import request from '@/utils/request'
// 创建物品
export function createWarehouseGoods(data) {
return request({
url: '/extend/warehouse-goods/create',
method: 'post',
data: data
})
}
// 更新物品
export function updateWarehouseGoods(data) {
return request({
url: '/extend/warehouse-goods/update',
method: 'put',
data: data
})
}
// 删除物品
export function deleteWarehouseGoods(id) {
return request({
url: '/extend/warehouse-goods/delete?id=' + id,
method: 'delete'
})
}
// 获得物品
export function getWarehouseGoods(id) {
return request({
url: '/extend/warehouse-goods/get?id=' + id,
method: 'get'
})
}
// 获得物品列表
export function getListByType(id) {
return request({
url: '/extend/warehouse-goods/getListByType?type=' + id,
method: 'get'
})
}
// 获得物品分页
export function getWarehouseGoodsPage(data) {
return request({
url: '/extend/warehouse-goods/page',
method: 'POST',
data: data
})
}
// 获得code
export function getCode() {
return request({
url: '/extend/warehouse-goods/getCode',
method: 'get'
})
}
// 导出物品 Excel
export function exportWarehouseGoodsExcel(query) {
return request({
url: '/extend/warehouse-goods/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -0,0 +1,97 @@
/*
* @Author: zwq
* @Date: 2023-11-02 14:31:42
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 14:56:10
* @Description:
*/
import request from '@/utils/request'
// 创建库位
export function createWarehouseLocation(data) {
return request({
url: '/extend/warehouse-location/create',
method: 'post',
data: data
})
}
// 更新库位
export function updateWarehouseLocation(data) {
return request({
url: '/extend/warehouse-location/update',
method: 'put',
data: data
})
}
// 删除库位
export function deleteWarehouseLocation(id) {
return request({
url: '/extend/warehouse-location/delete?id=' + id,
method: 'delete'
})
}
// 获得库位
export function getWarehouseLocation(id) {
return request({
url: '/extend/warehouse-location/get?id=' + id,
method: 'get'
})
}
// 获得库位列表(通过仓库id)
export function listByWarehouse(id) {
return request({
url: '/extend/warehouse-location/listByWarehouse?warehouseId=' + id,
method: 'get'
})
}
// 获得库位列表(All)
export function listAll() {
return request({
url: '/extend/warehouse-location/listAll',
method: 'get'
})
}
// 获得库位code
export function getCode() {
return request({
url: '/extend/warehouse-location/getCode',
method: 'get'
})
}
// 获得库位分页
export function getWarehouseLocationPage(data) {
return request({
url: '/extend/warehouse-location/page',
method: 'POST',
data: data
})
}
// 获得库存总览数据
export function getOverview(data) {
return request({
url: '/extend/warehouse-monitoring/getOverview',
method: 'POST',
data: data
})
}
// 获得库位占用率数据
export function getRate(data) {
return request({
url: '/extend/warehouse-monitoring/getRate',
method: 'POST',
data: data
})
}
// 导出库位 Excel
export function exportWarehouseLocationExcel(query) {
return request({
url: '/extend/warehouse-location/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -0,0 +1,83 @@
import request from '@/utils/request'
// 创建出入库-无库位-入库
export function createWarehouseRealtime(data) {
return request({
url: '/extend/warehouse-realtime/create',
method: 'post',
data: data
})
}
// 创建出入库-无库位-出库
export function outWarehouseRealtime(data) {
return request({
url: '/extend/warehouse-realtime/out',
method: 'post',
data: data
})
}
// 更新出入库-无库位
export function updateWarehouseRealtime(data) {
return request({
url: '/extend/warehouse-realtime/update',
method: 'put',
data: data
})
}
// 删除出入库-无库位
export function deleteWarehouseRealtime(id) {
return request({
url: '/extend/warehouse-realtime/delete?id=' + id,
method: 'delete'
})
}
// 获得出入库-无库位
export function getWarehouseRealtime(id) {
return request({
url: '/extend/warehouse-realtime/get?id=' + id,
method: 'get'
})
}
// 获得出入库-无库位-展开详情
export function getWarehouseRealtimeDet(id) {
return request({
url: '/extend/warehouse-realtime/getDet?id=' + id,
method: 'get'
})
}
// 获得出入库-无库位-批次列表
export function getBatchList(id) {
return request({
url: '/extend/warehouse-realtime/getBatchList?id=' + id,
method: 'get'
})
}
// 获得出入库-无库位分页
export function getWarehouseRealtimePage(data) {
return request({
url: '/extend/warehouse-realtime/page',
method: 'post',
data: data
})
}
// 获得出入库-无库位-历史分页
export function getWarehouseRealtimeHisPage(data) {
return request({
url: '/extend/warehouse-his/page',
method: 'post',
data: data
})
}
// 导出出入库-无库位 Excel
export function exportWarehouseRealtimeExcel(query) {
return request({
url: '/extend/warehouse-realtime/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -0,0 +1,85 @@
import request from '@/utils/request'
// 创建出入库-有库位
export function createWarehouseRealtimeLocation(data) {
return request({
url: '/extend/warehouse-realtime-location/create',
method: 'post',
data: data
})
}
// 更新出入库-有库位
export function updateWarehouseRealtimeLocation(data) {
return request({
url: '/extend/warehouse-realtime-location/update',
method: 'put',
data: data
})
}
// 出入库-有库位 > 出库操作
export function outWarehouseRealtimeLocation(data) {
return request({
url: '/extend/warehouse-realtime-location/out',
method: 'post',
data: data
})
}
// 出入库-有库位 > 入库操作
export function inWarehouseRealtimeLocation(data) {
return request({
url: '/extend/warehouse-realtime-location/in',
method: 'post',
data: data
})
}
// 删除出入库-有库位
export function deleteWarehouseRealtimeLocation(id) {
return request({
url: '/extend/warehouse-realtime-location/delete?id=' + id,
method: 'delete'
})
}
// 获得出入库-有库位
export function getWarehouseRealtimeLocation(id) {
return request({
url: '/extend/warehouse-realtime-location/get?id=' + id,
method: 'get'
})
}
// 获得出入库历史-有库位详情列表
export function getWarehouseLocationHisDet(id) {
return request({
url: '/extend/warehouse-location-his-det/list?hisId=' + id,
method: 'get'
})
}
// 获得出入库-有库位分页
export function getWarehouseRealtimeLocationPage(data) {
return request({
url: '/extend/warehouse-realtime-location/page',
method: 'post',
data: data
})
}
// 获得出入库历史-有库位分页
export function getWarehouseLocationHisPage(data) {
return request({
url: '/extend/warehouse-location-his/page',
method: 'post',
data: data
})
}
// 导出出入库-有库位 Excel
export function exportWarehouseRealtimeLocationExcel(query) {
return request({
url: '/extend/warehouse-realtime-location/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="10px" height="10px" viewBox="0 0 10 10" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 60 (88103) - https://sketch.com -->
<desc>Created with Sketch.</desc>
<g id="11_系统管理" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="11-1用户管理" transform="translate(-1764.000000, -160.000000)">
<g id="编组-15" transform="translate(1763.000000, 158.000000)">
<g id="编组-18">
<g id="icon/界面内/新增" transform="translate(0.000000, 1.000000)">
<g id="编组">
<rect id="矩形" stroke="#979797" fill="#D8D8D8" opacity="0" x="0.5" y="0.5" width="11" height="11"></rect>
<path d="M10.0813953,6.42885117 L6.37790698,6.42885117 L6.37790698,10.0770235 C6.37790698,10.3108355 6.19069767,10.5 5.95930233,10.5 L5.95930233,10.5 C5.72790698,10.5 5.54069767,10.3108355 5.54069767,10.0770235 L5.54069767,6.42885117 L1.91860465,6.42885117 C1.6872093,6.42885117 1.5,6.23968668 1.5,6.00587467 L1.5,6.00587467 C1.5,5.77206266 1.6872093,5.58289817 1.91860465,5.58289817 L5.54069767,5.58289817 L5.54069767,1.9229765 C5.54069767,1.68916449 5.72790698,1.5 5.95930233,1.5 L5.95930233,1.5 C6.19069767,1.5 6.37790698,1.68916449 6.37790698,1.9229765 L6.37790698,5.58289817 L10.0813953,5.58289817 C10.3127907,5.58289817 10.5,5.77206266 10.5,6.00587467 L10.5,6.00587467 C10.5,6.23968668 10.3127907,6.42885117 10.0813953,6.42885117 L10.0813953,6.42885117 Z" id="Shape" fill="#0B58FF" transform="translate(6.000000, 6.000000) scale(1, -1) translate(-6.000000, -6.000000) "></path>
</g>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -0,0 +1,182 @@
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
</div>
</template>
<script>
import basicPage from '../../core/mixins/basic-page';
import { parseTime } from '../../core/mixins/code-filter';
import {
getcoreAlarmLogPage
} from '@/api/base/coreAlarmLog';
import {DICT_TYPE, getDictDatas} from "@/utils/dict";
const tableProps = [
{
prop: 'alarmTime',
label: '报警时间',
filter: parseTime
},
{
prop: 'alarmSource',
label: '报警来源'
},
{
prop: 'alarmType',
label: '报警类型'
},
{
prop: 'alarmGrade',
label: '报警级别'
},
{
prop: 'alarmReason',
label: '报警原因'
},
{
prop: 'alarmContent',
label: '报警详细'
}
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getcoreAlarmLogPage
},
tableProps,
tableBtn: [].filter((v)=>v),
tableData: [],
listQuery: {
pageSize: 10,
pageNo: 1,
total: 0,
alarmSource: undefined,
alarmGrade: undefined,
alarmTime: []
},
formConfig: [
{
type: 'input',
label: '报警来源',
placeholder: '报警来源',
param: 'name',
},
{
type: 'datePicker',
label: '时间段',
dateType: 'datetimerange',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
width: 350,
param: 'time'
},
{
type: 'select',
label: '报警级别',
placeholder: '请选择报警级别',
param: 'alarmGrade',
selectOptions: [],
filterable: true,
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
}
// {
// type: 'separate',
// },
// {
// type: this.$auth.hasPermi('base:core-alarm-log:create') ? 'button' : '',
// btnName: '',
// name: 'add',
// color: 'success',
// plain: true
// },
],
};
},
created() {
this.getDict()
},
methods: {
//
async getDict() {
const res = await getDictDatas(this.DICT_TYPE.EQU_ALARM_LEVEL)
console.log('111', res)
this.formConfig[2].selectOptions = res.map(item => {
return {
id: item.value,
name: item.label
}
})
},
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.alarmSource = val.name ? val.name : undefined;
this.listQuery.alarmGrade = val.alarmGrade ? val.alarmGrade : undefined;
if (val.time) {
this.listQuery.alarmTime[0] = val.time[0]
this.listQuery.alarmTime[1] = val.time[1]
} else {
this.listQuery.alarmTime = []
}
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true;
this.addOrUpdateHandle();
break;
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
},
};
</script>

View File

@ -0,0 +1,65 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 15:27:31
* @LastEditors: zwq
* @LastEditTime: 2023-08-01 16:25:54
* @Description:
-->
<template>
<div :class="[className, { 'p-0': noPadding }]">
<slot />
</div>
</template>
<script>
export default {
props: {
size: {
// : xl lg md sm
type: String,
default: 'de',
validator: function (val) {
return ['xl', 'lg', 'de', 'md', 'sm'].indexOf(val) !== -1;
},
},
noPadding: {
type: Boolean,
default: false,
},
},
computed: {
className: function () {
return `${this.size}-title`;
},
},
};
</script>
<style lang="scss" scoped>
$pxls: (xl, 28px) (lg, 24px) (de, 20px) (md, 18px) (sm, 16px);
$mgr: 8px;
@each $size, $height in $pxls {
.#{$size}-title {
font-size: 18px;
line-height: $height;
color: #000;
font-weight: 500;
font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif;
&::before {
content: '';
display: inline-block;
vertical-align: top;
width: 4px;
height: $height + 2px;
border-radius: 1px;
margin-right: $mgr;
background-color: #0b58ff;
}
}
}
.p-0 {
padding: 0;
}
</style>

View File

@ -0,0 +1,417 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-11-04 17:57:18
* @Description:
-->
<template>
<el-drawer
:visible.sync="visible"
:show-close="false"
:wrapper-closable="false"
class="drawer"
size="50%">
<small-title slot="title" :no-padding="true">
{{ isdetail ? '详情' : !dataForm.id ? '新增' : '编辑' }}
</small-title>
<div class="content">
<div class="visual-part">
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="100px"
label-position="top">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="产品名称" prop="name">
<el-input v-model="dataForm.name" :disabled="isdetail" clearable placeholder="请输入产品名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="产品编码" prop="code">
<el-input
v-model="dataForm.code"
clearable
:disabled="isdetail"
placeholder="请输入产品编码" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="物料类型" prop="materialType">
<el-select
v-model="dataForm.materialType"
filterable
:disabled="isdetail"
style="width: 100%"
placeholder="请选择物料类型">
<el-option
v-for="dict in getDictDatas('material_type')"
:key="dict.value"
:label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="产品类型" prop="productType">
<el-select
v-model="dataForm.productType"
filterable
:disabled="isdetail"
style="width: 100%"
placeholder="请选择产品类型">
<el-option
v-for="dict in getDictDatas(DICT_TYPE.PRODUCT_TYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="单位" prop="unit">
<el-select
v-model="dataForm.unit"
filterable
:disabled="isdetail"
style="width: 100%"
placeholder="请选择单位">
<el-option
v-for="dict in getDictDatas(DICT_TYPE.UNIT_DICT)"
:key="dict.value"
:label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单位平方数" prop="area">
<el-input-number v-model="dataForm.area" :precision="2" style="width: 100%" :disabled="isdetail" clearable placeholder="请输入单位平方数" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="规格" prop="specifications">
<el-input v-model="dataForm.specifications" :disabled="isdetail" clearable placeholder="请输入规格" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="产线生产单位用时(S)" prop="processTime">
<el-input v-model.number="dataForm.processTime" type="number" :disabled="isdetail" clearable placeholder="请输入产线生产单位用时" />
</el-form-item>
</el-col>
</el-row>
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" :disabled="isdetail" clearable placeholder="请输入备注" />
</el-form-item>
</el-form>
</div>
<div class="drawer-body__footer">
<el-button style="" @click="goback()">取消</el-button>
<el-button v-if="isdetail" type="primary" @click="goEdit()">
编辑
</el-button>
<el-button v-else type="primary" @click="dataFormSubmit()">确定</el-button>
</div>
<div class="attr-list" v-if="idAttrShow">
<small-title
style="margin: 16px 0; padding-left: 8px"
:no-padding="true">
产品属性
</small-title>
<div v-if="!isdetail" class="action_btn">
<template>
<span style="display: inline-block;" @click="addNew()">
<svg-icon style="width: 14px; height: 14px" class="item-icon" icon-class="table_add" />
<span class="add">添加</span>
</span>
</template>
</div>
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="productAttrList">
<method-btn
v-if="!isdetail"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
v-show="listQuery.total > 0"
:total="listQuery.total"
:page.sync="listQuery.pageNo"
:limit.sync="listQuery.pageSize"
:page-sizes="[5, 10, 15]"
@pagination="getList" />
<div class="drawer-body__footer">
<el-button type="primary" @click="goback()">关闭</el-button>
</div>
</div>
</div>
<attr-add
v-if="addOrUpdateVisible"
ref="addOrUpdate"
:product-id="dataForm.id"
@refreshDataList="getList" />
</el-drawer>
</template>
<script>
import basicAdd from '../../core/mixins/basic-add';
import { createCoreProduct, updateCoreProduct, getCoreProduct, getCode, getCoreProductAttrPage, deleteCoreProductAttr } from "@/api/base/coreProduct";
import SmallTitle from './SmallTitle';
import { parseTime } from '../../core/mixins/code-filter';
import attrAdd from './attr-add';
import {DICT_TYPE, getDictDatas} from "@/utils/dict";
const tableBtn = [
{
type: 'edit',
btnName: '编辑',
},
{
type: 'delete',
btnName: '删除',
},
];
const tableProps = [
{
prop: 'createTime',
label: '添加时间',
filter: parseTime,
},
{
prop: 'name',
label: '属性名',
},
{
prop: 'value',
label: '属性值',
},
];
const topBtnConfig = [
{
type: 'add',
btnName: 'btn.add'
}
]
export default {
mixins: [basicAdd],
components: { SmallTitle, attrAdd },
data() {
return {
tableBtn,
tableProps,
topBtnConfig,
addOrUpdateVisible: false,
urlOptions: {
isGetCode: true,
codeURL: getCode,
createURL: createCoreProduct,
updateURL: updateCoreProduct,
infoURL: getCoreProduct,
},
listQuery: {
pageSize: 10,
pageNo: 1,
total: 0,
},
dataForm: {
id: undefined,
code: undefined,
name: '',
materialType: undefined,
productType: undefined,
area: undefined,
specifications: undefined,
processTime: 0,
remark: undefined,
unit: undefined
},
productAttrList: [],
visible: false,
isdetail: false,
idAttrShow: false,
dataRule: {
code: [{ required: true, message: "物料编码不能为空", trigger: "blur" }],
name: [{ required: true, message: "物料名称不能为空", trigger: "blur" }],
materialType: [{ required: true, message: "物料类型不能为空", trigger: "change" }],
productType: [{ required: true, message: "产品类型不能为空", trigger: "change" }],
processTime: [{ required: true, message: "产线生产单位用时不能为空", trigger: "blur" }]
}
};
},
mounted() {},
methods: {
initData() {
this.productAttrList.splice(0);
this.listQuery.total = 0;
},
handleClick(raw) {
if (raw.type === 'delete') {
this.$confirm(
`确定对${
raw.data.attrName
? '[名称=' + raw.data.attrName + ']'
: '[序号=' + raw.data._pageIndex + ']'
}进行删除操作?`,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
deleteCoreProductAttr(raw.data.id).then(({ data }) => {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getList();
},
});
});
})
.catch(() => {});
} else {
this.addNew(raw.data.id);
}
},
getList() {
//
getCoreProductAttrPage({
...this.listQuery,
productId: this.dataForm.id,
}).then((response) => {
this.productAttrList = response.data.list;
this.listQuery.total = response.data.total;
});
},
init(id, isdetail) {
this.initData();
this.isdetail = isdetail || false;
this.dataForm.id = id || undefined;
this.visible = true;
if (id) {
this.idAttrShow = true
} else {
this.idAttrShow = false
}
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
if (this.dataForm.id) {
//
this.urlOptions.infoURL(id).then(response => {
this.dataForm = response.data
this.dataForm.unit = String(this.dataForm.unit)
this.dataForm.materialType = String(this.dataForm.materialType)
this.dataForm.productType = String(this.dataForm.productType)
});
//
this.getList();
} else {
if (this.urlOptions.isGetCode) {
this.getCode()
}
}
});
},
goback() {
this.$emit('refreshDataList');
this.visible = false;
// this.initData();
},
goEdit() {
this.isdetail = false;
},
// /
addNew(id) {
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id);
});
}
}
};
</script>
<style scoped>
.drawer >>> .el-drawer {
border-radius: 8px 0 0 8px;
display: flex;
flex-direction: column;
}
.drawer >>> .el-form-item__label {
padding: 0;
}
.drawer >>> .el-drawer__header {
margin: 0;
padding: 32px 32px 24px;
border-bottom: 1px solid #dcdfe6;
}
.drawer >>> .el-drawer__body {
flex: 1;
height: 1px;
display: flex;
flex-direction: column;
}
.drawer >>> .content {
padding: 30px 24px;
flex: 1;
display: flex;
flex-direction: column;
/* height: 100%; */
}
.drawer >>> .visual-part {
flex: 1 auto;
max-height: 76vh;
overflow: hidden;
overflow-y: scroll;
padding-right: 10px; /* 调整滚动条样式 */
}
.drawer >>> .el-form,
.drawer >>> .attr-list {
padding: 0 16px;
}
.drawer-body__footer {
display: flex;
justify-content: flex-end;
padding: 18px;
}
.action_btn {
float: right;
margin: 5px 15px;
font-size: 14px;
}
.add {
color: #0b58ff;
}
</style>

View File

@ -0,0 +1,141 @@
<template>
<el-dialog
:visible.sync="visible"
:width="'35%'"
:append-to-body="true"
:close-on-click-modal="false"
class="dialog">
<template #title>
<slot name="title">
<div class="titleStyle">
{{ !dataForm.id ? '新增' : '编辑' }}
</div>
</slot>
</template>
<el-form
ref="dataForm"
:model="dataForm"
:rules="dataRule"
label-width="100px"
@keyup.enter.native="dataFormSubmit()">
<el-form-item label="属性名" prop="name">
<el-input
v-model="dataForm.name"
placeholder="请输入属性名"
clearable />
</el-form-item>
<el-form-item label="属性值" prop="value">
<el-input
v-model="dataForm.value"
placeholder="请输入属性值"
clearable />
</el-form-item>
</el-form>
<el-row style="text-align: right">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</el-row>
</el-dialog>
</template>
<script>
import {
createCoreProductAttr,
updateCoreProductAttr,
getCoreProductAttr
} from '@/api/base/coreProduct';
export default {
props: {
productId: {
type: String,
default: '',
},
},
data() {
return {
visible: false,
dataForm: {
id: undefined,
name: '',
value: '',
},
dataRule: {
attrName: [{ required: true, message: '名称不能为空', trigger: 'blur' }],
},
};
},
methods: {
init(id) {
this.dataForm.id = id || '';
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
if (this.dataForm.id) {
getCoreProductAttr({
id: this.dataForm.id
}).then((res) => {
const { name, value } = res.data;
this.dataForm.name = name;
this.dataForm.value = value;
});
}
});
},
//
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
//
if (this.dataForm.id) {
updateCoreProductAttr({
...this.dataForm,
productId: this.productId,
}).then((response) => {
this.$modal.msgSuccess('修改成功');
this.visible = false;
this.$emit('refreshDataList');
});
return;
}
//
createCoreProductAttr({
...this.dataForm,
productId: this.productId,
}).then((response) => {
this.$modal.msgSuccess('新增成功');
this.visible = false;
this.$emit('refreshDataList');
});
}
});
},
},
};
</script>
<style scoped>
.dialog >>> .el-dialog__body {
padding: 30px 24px;
}
.dialog >>> .el-dialog__header {
font-size: 16px;
color: rgba(0, 0, 0, 0.85);
font-weight: 500;
padding: 13px 24px;
border-bottom: 1px solid #e9e9e9;
}
.dialog >>> .el-dialog__header .titleStyle::before {
content: '';
display: inline-block;
width: 4px;
height: 16px;
background-color: #0b58ff;
border-radius: 1px;
margin-right: 8px;
position: relative;
top: 2px;
}
</style>

View File

@ -0,0 +1,186 @@
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<add-or-update
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="successSubmit" />
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import basicPage from '../../core/mixins/basic-page';
import { parseTime } from '../../core/mixins/code-filter';
import { publicFormatter } from '@/utils/dict';
import {
getCoreProductPage,
deleteCoreProduct
} from '@/api/base/coreProduct';
const tableProps = [
{
prop: 'createTime',
label: '添加时间',
filter: parseTime
},
{
prop: 'name',
label: '产品名称'
},
{
prop: 'code',
label: '产品编码'
},
{
prop: 'productType',
label: '产品类型',
filter: publicFormatter('product_type')
},
{
prop: 'specifications',
label: '规格'
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('unit_dict')
},
{
prop: 'remark',
label: '备注',
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getCoreProductPage,
deleteURL: deleteCoreProduct
},
tableProps,
tableBtn: [
this.$auth.hasPermi(`base:core-product:update`)
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi(`base:core-product:detail`)
? {
type: 'detail',
btnName: '查看详情',
}
: undefined,
this.$auth.hasPermi(`base:core-product:delete`)
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v)=>v),
tableData: [],
formConfig: [
{
type: 'input',
label: '工单名称',
placeholder: '工单名称',
param: 'name'
},
{
type: 'input',
label: '产品编号',
placeholder: '产品编号',
param: 'code'
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('base:core-product:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true
},
],
};
},
components: {
AddOrUpdate
},
created() {},
methods: {
//
otherMethods(val) {
if (val.type === 'detail') {
this.addOrUpdateVisible = true;
this.addOrEditTitle = "详情";
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id, true);
});
}
},
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.name = val.name ? val.name : undefined;
this.listQuery.code = val.code ? val.code : undefined;
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true;
this.addOrUpdateHandle();
break;
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
},
};
</script>

View File

@ -0,0 +1,114 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-11-03 19:28:06
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="80px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="产线名称" prop="name">
<el-input v-model="dataForm.name" clearable placeholder="请输入产线名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="产线编号" prop="code">
<el-input v-model="dataForm.code" clearable placeholder="请输入产线编号" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="工厂名称" prop="factoryId">
<el-select
v-model="dataForm.factoryId"
filterable
placeholder="请选择工厂">
<el-option
v-for="dict in factoryList"
:key="dict.id"
:label="dict.name"
:value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="产线TT值(h)" prop="tvalue">
<el-input
v-model.number="dataForm.tvalue"
type="number"
placeholder="TT值" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="描述信息" prop="description">
<el-input
v-model="dataForm.description"
placeholder="请输入描述信息" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input
v-model="dataForm.remark"
placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import basicAdd from '../../core/mixins/basic-add';
import { createCorePL, updateCorePL, getCorePL, getCode } from "@/api/base/coreProductionLine";
import { getFactoryList } from '@/api/core/base/factory';
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
isGetCode: true,
codeURL: getCode,
createURL: createCorePL,
updateURL: updateCorePL,
infoURL: getCorePL,
},
dataForm: {
id: undefined,
code: undefined,
name: undefined,
description: undefined,
tvalue: 0,
factoryId: undefined,
remark: undefined,
},
factoryList: [],
dataRule: {
code: [{ required: true, message: "专业编码不能为空", trigger: "blur" }],
name: [{ required: true, message: "专业名称不能为空", trigger: "blur" }],
factoryId: [{ required: true, message: "工厂不能为空", trigger: "blur" }]
}
};
},
mounted() {
this.getDict()
},
methods: {
async getDict() {
//
const factoryRes = await getFactoryList();
this.factoryList = factoryRes.data;
},
}
};
</script>

View File

@ -0,0 +1,177 @@
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import basicPage from '../../core/mixins/basic-page';
import { parseTime } from '../../core/mixins/code-filter';
import {
getCorePLPage,
deleteCorePL
} from '@/api/base/coreProductionLine';
const tableProps = [
{
prop: 'createTime',
label: '添加时间',
filter: parseTime
},
{
prop: 'factoryName',
label: '工厂'
},
{
prop: 'name',
label: '产线名称'
},
{
prop: 'code',
label: '产线编码'
},
{
prop: 'enabled',
label: '当前状态',
filter: (val) => ['停用', '启用'][val]
},
{
prop: 'description',
label: '描述'
},
{
prop: 'remark',
label: '备注'
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getCorePLPage,
deleteURL: deleteCorePL
},
tableProps,
tableBtn: [
this.$auth.hasPermi(`base:core-production-line:update`)
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi(`base:core-production-line:delete`)
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v)=>v),
tableData: [],
formConfig: [
{
type: 'input',
label: '产线名称',
placeholder: '产线名称',
param: 'name'
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('base:core-production-line:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true
},
],
};
},
components: {
AddOrUpdate,
},
created() {},
methods: {
//
// getDataList() {
// this.dataListLoading = true;
// this.urlOptions.getDataListURL(this.listQuery).then(response => {
// this.tableData = response.data.list;
// this.listQuery.total = response.data.total;
// this.dataListLoading = false;
// });
// },
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.name = val.name ? val.name : undefined;
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true;
this.addOrUpdateHandle();
break;
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
},
};
</script>

View File

@ -0,0 +1,65 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 15:27:31
* @LastEditors: zwq
* @LastEditTime: 2023-08-01 16:25:54
* @Description:
-->
<template>
<div :class="[className, { 'p-0': noPadding }]">
<slot />
</div>
</template>
<script>
export default {
props: {
size: {
// : xl lg md sm
type: String,
default: 'de',
validator: function (val) {
return ['xl', 'lg', 'de', 'md', 'sm'].indexOf(val) !== -1;
},
},
noPadding: {
type: Boolean,
default: false,
},
},
computed: {
className: function () {
return `${this.size}-title`;
},
},
};
</script>
<style lang="scss" scoped>
$pxls: (xl, 28px) (lg, 24px) (de, 20px) (md, 18px) (sm, 16px);
$mgr: 8px;
@each $size, $height in $pxls {
.#{$size}-title {
font-size: 18px;
line-height: $height;
color: #000;
font-weight: 500;
font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif;
&::before {
content: '';
display: inline-block;
vertical-align: top;
width: 4px;
height: $height + 2px;
border-radius: 1px;
margin-right: $mgr;
background-color: #0b58ff;
}
}
}
.p-0 {
padding: 0;
}
</style>

View File

@ -0,0 +1,416 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-11-04 11:39:25
* @Description:
-->
<template>
<el-drawer
:visible.sync="visible"
:show-close="false"
:wrapper-closable="false"
class="drawer"
size="50%">
<small-title slot="title" :no-padding="true">
{{ isdetail ? '详情' : !dataForm.id ? '新增' : '编辑' }}
</small-title>
<div class="content">
<div class="visual-part">
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="100px"
label-position="top">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="产品名称" prop="name">
<el-input v-model="dataForm.name" :disabled="isdetail" clearable placeholder="请输入产品名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="产品编码" prop="code">
<el-input
v-model="dataForm.code"
clearable
:disabled="isdetail"
placeholder="请输入产品编码" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="物料类型" prop="materialType">
<el-select
v-model="dataForm.materialType"
filterable
:disabled="isdetail"
style="width: 100%"
placeholder="请选择物料类型">
<el-option
v-for="dict in this.getDictDatas('material_type')"
:key="dict.value"
:label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="产品类型" prop="productType">
<el-select
v-model="dataForm.productType"
filterable
:disabled="isdetail"
style="width: 100%"
placeholder="请选择产品类型">
<el-option
v-for="dict in this.getDictDatas(DICT_TYPE.PRODUCT_TYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="单位" prop="unit">
<el-select
v-model="dataForm.unit"
filterable
:disabled="isdetail"
style="width: 100%"
placeholder="请选择单位">
<el-option
v-for="dict in this.getDictDatas(DICT_TYPE.UNIT_DICT)"
:key="dict.value"
:label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单位平方数" prop="area">
<el-input-number v-model="dataForm.area" :precision="2" style="width: 100%" :disabled="isdetail" clearable placeholder="请输入单位平方数" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="规格" prop="specifications">
<el-input v-model="dataForm.specifications" :disabled="isdetail" clearable placeholder="请输入规格" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="产线生产单位用时(S)" prop="processTime">
<el-input v-model.number="dataForm.processTime" type="number" :disabled="isdetail" clearable placeholder="请输入产线生产单位用时" />
</el-form-item>
</el-col>
</el-row>
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" :disabled="isdetail" clearable placeholder="请输入备注" />
</el-form-item>
</el-form>
</div>
<div class="drawer-body__footer">
<el-button style="" @click="goback()">取消</el-button>
<el-button v-if="isdetail" type="primary" @click="goEdit()">
编辑
</el-button>
<el-button v-else type="primary" @click="dataFormSubmit()">确定</el-button>
</div>
<div class="attr-list" v-if="idAttrShow">
<small-title
style="margin: 16px 0; padding-left: 8px"
:no-padding="true">
产品属性
</small-title>
<div v-if="!isdetail" class="action_btn">
<template>
<span style="display: inline-block;" @click="addNew()">
<svg-icon style="width: 14px; height: 14px" class="item-icon" icon-class="table_add" />
<span class="add">添加</span>
</span>
</template>
</div>
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="productAttrList">
<method-btn
v-if="!isdetail"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
v-show="listQuery.total > 0"
:total="listQuery.total"
:page.sync="listQuery.pageNo"
:limit.sync="listQuery.pageSize"
:page-sizes="[5, 10, 15]"
@pagination="getList" />
</div>
<div class="drawer-body__footer">
<el-button type="primary" @click="goback()">关闭</el-button>
</div>
</div>
<attr-add
v-if="addOrUpdateVisible"
ref="addOrUpdate"
:product-id="dataForm.id"
@refreshDataList="getList" />
</el-drawer>
</template>
<script>
import basicAdd from '../../core/mixins/basic-add';
import { createCoreProduct, updateCoreProduct, getCoreProduct, getCode, getCoreProductAttrPage, deleteCoreProductAttr } from "@/api/base/coreProduct";
import SmallTitle from './SmallTitle';
import { parseTime } from '../../core/mixins/code-filter';
import attrAdd from './attr-add';
import {DICT_TYPE, getDictDatas} from "@/utils/dict";
const tableBtn = [
{
type: 'edit',
btnName: '编辑',
},
{
type: 'delete',
btnName: '删除',
},
];
const tableProps = [
{
prop: 'createTime',
label: '添加时间',
filter: parseTime,
},
{
prop: 'name',
label: '属性名',
},
{
prop: 'value',
label: '属性值',
},
];
const topBtnConfig = [
{
type: 'add',
btnName: 'btn.add'
}
]
export default {
mixins: [basicAdd],
components: { SmallTitle, attrAdd },
data() {
return {
tableBtn,
tableProps,
topBtnConfig,
addOrUpdateVisible: false,
urlOptions: {
isGetCode: true,
codeURL: getCode,
createURL: createCoreProduct,
updateURL: updateCoreProduct,
infoURL: getCoreProduct,
},
listQuery: {
pageSize: 10,
pageNo: 1,
total: 0,
},
dataForm: {
id: undefined,
code: undefined,
name: '',
materialType: undefined,
productType: undefined,
area: undefined,
specifications: undefined,
processTime: 0,
remark: undefined,
unit: undefined
},
productAttrList: [],
visible: false,
isdetail: false,
idAttrShow: false,
dataRule: {
code: [{ required: true, message: "物料编码不能为空", trigger: "blur" }],
name: [{ required: true, message: "物料名称不能为空", trigger: "blur" }],
materialType: [{ required: true, message: "物料类型不能为空", trigger: "change" }],
productType: [{ required: true, message: "产品类型不能为空", trigger: "change" }],
processTime: [{ required: true, message: "产线生产单位用时不能为空", trigger: "blur" }]
}
};
},
mounted() {},
methods: {
initData() {
this.productAttrList.splice(0);
this.listQuery.total = 0;
},
handleClick(raw) {
if (raw.type === 'delete') {
this.$confirm(
`确定对${
raw.data.attrName
? '[名称=' + raw.data.attrName + ']'
: '[序号=' + raw.data._pageIndex + ']'
}进行删除操作?`,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
deleteCoreProductAttr(raw.data.id).then(({ data }) => {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getList();
},
});
});
})
.catch(() => {});
} else {
this.addNew(raw.data.id);
}
},
getList() {
//
getCoreProductAttrPage({
...this.listQuery,
productId: this.dataForm.id,
}).then((response) => {
this.productAttrList = response.data.list;
this.listQuery.total = response.data.total;
});
},
init(id, isdetail) {
this.initData();
this.isdetail = isdetail || false;
this.dataForm.id = id || undefined;
this.visible = true;
if (id) {
this.idAttrShow = true
} else {
this.idAttrShow = false
}
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
if (this.dataForm.id) {
//
this.urlOptions.infoURL(id).then(response => {
this.dataForm = response.data
this.dataForm.unit = String(this.dataForm.unit)
this.dataForm.materialType = String(this.dataForm.materialType)
this.dataForm.productType = String(this.dataForm.productType)
});
//
this.getList();
} else {
if (this.urlOptions.isGetCode) {
this.getCode()
}
}
});
},
goback() {
this.visible = false;
this.$emit('refreshDataList');
// this.initData();
},
goEdit() {
this.isdetail = false;
},
// /
addNew(id) {
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id);
});
}
}
};
</script>
<style scoped>
.drawer >>> .el-drawer {
border-radius: 8px 0 0 8px;
display: flex;
flex-direction: column;
}
.drawer >>> .el-form-item__label {
padding: 0;
}
.drawer >>> .el-drawer__header {
margin: 0;
padding: 32px 32px 24px;
border-bottom: 1px solid #dcdfe6;
}
.drawer >>> .el-drawer__body {
flex: 1;
height: 1px;
display: flex;
flex-direction: column;
}
.drawer >>> .content {
padding: 30px 24px;
flex: 1;
display: flex;
flex-direction: column;
/* height: 100%; */
}
.drawer >>> .visual-part {
flex: 1 auto;
max-height: 76vh;
overflow: hidden;
overflow-y: scroll;
padding-right: 10px; /* 调整滚动条样式 */
}
.drawer >>> .el-form,
.drawer >>> .attr-list {
padding: 0 16px;
}
.drawer-body__footer {
display: flex;
justify-content: flex-end;
padding: 18px;
}
.action_btn {
float: right;
margin: 5px 15px;
font-size: 14px;
}
.add {
color: #0b58ff;
}
</style>

View File

@ -0,0 +1,304 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-11-06 10:01:37
* @Description:
-->
<template>
<el-drawer
:visible.sync="visible"
:show-close="false"
:wrapper-closable="false"
class="drawer"
size="50%">
<small-title slot="title" :no-padding="true">
{{ '预使用主原料信息' }}
</small-title>
<div class="content">
<div style="height: 15vh">
<div style="font-size: 18px;">工单名{{ workOrderName }}</div>
</div>
<div class="attr-list">
<small-title
style="margin: 16px 0; padding-left: 8px"
:no-padding="true">
批次信息
</small-title>
<div class="action_btn">
<template>
<span style="display: inline-block;" @click="addNew()">
<svg-icon style="width: 14px; height: 14px" class="item-icon" icon-class="table_add" />
<span class="add">添加</span>
</span>
</template>
</div>
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="materialList">
<method-btn
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
v-show="listQuery.total > 0"
:total="listQuery.total"
:page.sync="listQuery.pageNo"
:limit.sync="listQuery.pageSize"
:page-sizes="[5, 10, 15]"
@pagination="getList" />
</div>
<div class="drawer-body__footer">
<el-button type="primary" @click="goback()">关闭</el-button>
</div>
</div>
<attr-add
v-if="addOrUpdateVisible"
ref="addOrUpdate"
:product-id="dataForm.id"
@refreshDataList="getList" />
</el-drawer>
</template>
<script>
import basicAdd from '../../core/mixins/basic-add';
import { getCoreWOMaPage, deleteCoreWOMa } from "@/api/base/coreWorkOrder";
import SmallTitle from './SmallTitle';
import { parseTime } from '../../core/mixins/code-filter';
import attrAdd from './attr-add';
import { publicFormatter } from "@/utils/dict";
const tableBtn = [
{
type: 'edit',
btnName: '编辑',
},
{
type: 'delete',
btnName: '删除',
}
];
const tableProps = [
{
prop: 'createTime',
label: '添加时间',
filter: parseTime,
},
{
prop: 'material',
label: '原料名称'
},
{
prop: 'origin',
label: '来源',
filter: (val) => ['', '内部', '采购'][val]
},
{
prop: 'supplierId',
label: '供应商',
},
{
prop: 'batch',
label: '批次',
},
{
prop: 'num',
label: '数量',
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('unit_dict')
},
];
const topBtnConfig = [
{
type: 'add',
btnName: 'btn.add'
}
]
export default {
mixins: [basicAdd],
components: { SmallTitle, attrAdd },
data() {
return {
tableBtn,
tableProps,
topBtnConfig,
workOrderName: '111',
addOrUpdateVisible: false,
listQuery: {
pageSize: 10,
pageNo: 1,
total: 0,
},
dataForm: {
id: undefined
},
materialList: [],
visible: false,
isdetail: false
};
},
mounted() {},
methods: {
initData() {
this.materialList.splice(0);
this.listQuery.total = 0;
},
handleClick(raw) {
if (raw.type === 'delete') {
this.$confirm(
`确定对${
raw.data.attrName
? '[名称=' + raw.data.attrName + ']'
: '[序号=' + raw.data._pageIndex + ']'
}进行删除操作?`,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
deleteCoreWOMa(raw.data.id).then(({ data }) => {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getList();
},
});
});
})
.catch(() => {});
} else {
this.addNew(raw.data.id);
}
},
getList() {
// 使
getCoreWOMaPage({
...this.listQuery,
workOrderId: this.dataForm.id,
}).then((response) => {
this.materialList = response.data.list;
this.listQuery.total = response.data.total;
});
},
init(id, isdetail) {
this.initData();
this.isdetail = isdetail || false;
this.dataForm.id = id || undefined;
this.visible = true;
this.getList()
// this.$nextTick(() => {
// this.$refs['dataForm'].resetFields();
// if (this.dataForm.id) {
// //
// this.urlOptions.infoURL(id).then(response => {
// this.dataForm = response.data
// this.dataForm.unit = String(this.dataForm.unit)
// this.dataForm.materialType = String(this.dataForm.materialType)
// this.dataForm.productType = String(this.dataForm.productType)
// });
// //
// this.getList();
// } else {
// if (this.urlOptions.isGetCode) {
// this.getCode()
// }
// }
// });
},
goback() {
this.visible = false;
this.$emit('refreshDataList');
// this.initData();
},
goEdit() {
this.isdetail = false;
},
// /
addNew(id) {
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id);
});
}
}
};
</script>
<style scoped>
.drawer >>> .el-drawer {
border-radius: 8px 0 0 8px;
display: flex;
flex-direction: column;
}
.drawer >>> .el-form-item__label {
padding: 0;
}
.drawer >>> .el-drawer__header {
margin: 0;
padding: 32px 32px 24px;
border-bottom: 1px solid #dcdfe6;
}
.drawer >>> .el-drawer__body {
flex: 1;
height: 1px;
display: flex;
flex-direction: column;
}
.drawer >>> .content {
padding: 30px 24px;
flex: 1;
display: flex;
flex-direction: column;
/* height: 100%; */
}
.drawer >>> .visual-part {
flex: 1 auto;
/* max-height: 76vh; */
overflow: hidden;
overflow-y: scroll;
padding-right: 10px; /* 调整滚动条样式 */
}
.drawer >>> .el-form,
.drawer >>> .attr-list {
padding: 0 16px;
}
.drawer-body__footer {
display: flex;
justify-content: flex-end;
padding: 18px;
}
.action_btn {
float: right;
margin: 5px 15px;
font-size: 14px;
}
.add {
color: #0b58ff;
}
</style>

View File

@ -0,0 +1,300 @@
<template>
<el-form ref="dataForm" :rules="rules" label-width="130px" :model="dataForm">
<el-row>
<el-col :span='12'>
<el-form-item label="工单名称" prop="name">
<el-input v-model="dataForm.name"></el-input>
</el-form-item>
</el-col>
<el-col :span='12'>
<el-form-item label="工单编码" prop="code">
<el-input v-model="dataForm.code" disabled></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span='12'>
<el-form-item label="产品名称" prop="planProductId">
<el-select v-model="dataForm.planProductId" placeholder="请选择" style="width: 100%;" @change="selectProduct">
<el-option
v-for="item in productList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span='12'>
<el-form-item label="产品规格" prop="productSpec">
<el-input v-model="dataForm.productSpec" disabled></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span='12'>
<el-form-item label="计划开始时间">
<el-date-picker
v-model="planStartTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
style="width: 100%;"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span='12'>
<el-form-item label="计划完成时间">
<el-date-picker
v-model="planFinishTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
style="width: 100%;"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span='12'>
<el-form-item label="计划投入数量" prop="planAssignQuantity">
<el-input-number v-model="dataForm.planAssignQuantity" :min="0" :max="9999999999999" style="width: 100%;"></el-input-number>
</el-form-item>
</el-col>
<el-col :span='12'>
<el-form-item label="计划生产数量" prop="planQuantity">
<el-input-number v-model="dataForm.planQuantity" :min="0" :max="9999999999999" style="width: 100%;"></el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span='12'>
<el-form-item label="关联工艺" prop="processFlowId">
<el-select v-model="dataForm.processFlowId" placeholder="请选择" style="width: 100%;">
<el-option
v-for="item in processFlowList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span='12'>
<el-form-item label="物料计算方式" prop="materialMethod">
<el-radio-group v-model="dataForm.materialMethod">
<el-radio :label="1">产品基础</el-radio>
<el-radio :label="2">工艺扩展</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span='12'>
<el-form-item label="优先级" prop="priority">
<el-select v-model="dataForm.priority" placeholder="请选择" style="width: 100%;">
<el-option
v-for="item in getDictDatas(DICT_TYPE.ORDER_PRIORITY)"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span='12'>
<el-form-item label="工单类型" prop="type">
<el-select v-model="dataForm.type" placeholder="请选择" style="width: 100%;">
<el-option
v-for="item in workOrderTypeList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span='12'>
<el-form-item label="关联产线" prop="productLineIds">
<el-select v-model="dataForm.productLineIds" placeholder="请选择" multiple style="width: 100%;">
<el-option
v-for="item in productLineList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span='12'>
<el-form-item label="负责人" prop="workers">
<el-input v-model="dataForm.workers"></el-input>
</el-form-item>
</el-col>
</el-row>
<!-- <el-row>
<el-col :span='12'>
<el-form-item label="计划分配订单量" prop="planAssignmentQuantity">
<el-input-number v-model="form.planAssignmentQuantity" :min="0" :max="9999999999999" style="width: 100%;"></el-input-number>
</el-form-item>
</el-col>
</el-row> -->
</el-form>
</template>
<script>
import { getProductAll } from '@/api/base/product'
import { getProcessFlowList, workOrderList } from '@/api/base/orderManage'
import { createCoreWO, updateCoreWO, getCode, getCoreWO } from '@/api/base/coreWorkOrder'
import { getLineAll } from '@/api/base/productionLine'
import basicAdd from '../../core/mixins/basic-add';
export default {
name: 'AddWorkOrder',
mixins: [basicAdd],
data() {
return {
urlOptions: {
isGetCode: true,
codeURL: getCode,
createURL: createCoreWO,
updateURL: updateCoreWO,
infoURL: getCoreWO
},
dataForm: {
id: undefined,
workOrderId: '',
name: '',
code: '',
planProductId: '',
productSpec: '',
planStartTime: '',
planFinishTime: '',
planAssignQuantity: 0,
planQuantity: 0,
processFlowId: '',
materialMethod: 1,
priority: '',
productLineIds: [],
type: '',
workers: ''
},
rules: {
name: [{ required: true, message: "工单名称不能为空", trigger: "blur" }],
planProductId: [{ required: true, message: "产品名称不能为空", trigger: "change" }],
planAssignQuantity: [{ required: true, message: "计划投入数量不能为空", trigger: "blur" }],
planQuantity: [{ required: true, message: "计划生产数量不能为空", trigger: "blur" }],
productLineIds: [{ required: true, message: "产品不能为空", trigger: "change" }]
},
productList: [],
processFlowList: [],
productLineList: [],
workOrderTypeList: [
{id: 1,name:'标准工单'},
{id: 2, name:'特殊工单'}
],
planStartTime: '',
planFinishTime: '',
isBind: false,
workOrderList: []
}
},
mounted() {
this.getDict()
},
methods: {
init(id) {
this.dataForm.id = id || "";
this.visible = true;
if (this.urlOptions.getOption) {
this.getArr()
}
this.$nextTick(() => {
this.$refs["dataForm"].resetFields();
this.planStartTime = ''
this.planFinishTime = ''
if (this.dataForm.id) {
getCoreWO(id).then(response => {
this.dataForm = response.data;
});
} else {
if (this.urlOptions.isGetCode) {
this.getCode()
}
}
});
},
//
dataFormSubmit() {
this.$refs["dataForm"].validate((valid) => {
if (!valid) {
return false;
}
//
if (this.dataForm.id) {
this.urlOptions.updateURL(this.dataForm).then(response => {
this.$modal.msgSuccess("修改成功");
this.visible = false;
this.$emit("refreshDataList");
});
return;
}
//
this.urlOptions.createURL(this.dataForm).then(response => {
this.$modal.msgSuccess("新增成功");
this.visible = false;
this.$confirm('是否添加预使用主原料信息?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$emit("refreshDataList", true);
}).catch(() => {
this.$emit("refreshDataList");
});
});
});
},
getCode() {
this.urlOptions.codeURL()
.then(({ data: res }) => {
this.dataForm.code = res;
})
.catch(() => {});
},
getDict() {
//
getProductAll().then(res => {
this.productList = res.data || []
})
// 线
getLineAll().then(res => {
this.productLineList = res.data || []
})
//
getProcessFlowList().then(res => {
this.processFlowList = res.data || []
})
// list
workOrderList({
status: 1
}).then(res => {
this.workOrderList = res.data || []
})
},
//
selectProduct(val) {
if (val) {
this.productList.map(item => {
if (val === item.id) {
this.dataForm.productSpec = item.specifications
}
})
} else {
this.dataForm.productSpec = ''
}
}
}
}
</script>

View File

@ -0,0 +1,211 @@
<template>
<el-dialog
:visible.sync="visible"
:width="'35%'"
:append-to-body="true"
:close-on-click-modal="false"
class="dialog">
<template #title>
<slot name="title">
<div class="titleStyle">
{{ !dataForm.id ? '新增' : '编辑' }}
</div>
</slot>
</template>
<el-form
ref="dataForm"
:model="dataForm"
:rules="dataRule"
label-width="100px"
@keyup.enter.native="dataFormSubmit()">
<el-form-item label="原料" prop="material">
<el-select
v-model="dataForm.material"
filterable
style="width: 100%"
placeholder="请选择原料">
<el-option
v-for="dict in getDictDatas('material')"
:key="dict.value"
:label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
<el-form-item label="来源" prop="origin">
<el-select
v-model="dataForm.origin"
filterable
style="width: 100%"
placeholder="请选择来源">
<el-option
v-for="dict in originList"
:key="dict.value"
:label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
<el-form-item label="供应商" prop="supplierId">
<el-select
v-model="dataForm.supplierId"
filterable
style="width: 100%"
placeholder="请选择供应商">
<el-option
v-for="dict in supplierList"
:key="dict.id"
:label="dict.name"
:value="dict.id" />
</el-select>
</el-form-item>
<el-form-item label="批次号" prop="batch">
<el-input
v-model="dataForm.batch"
clearable
placeholder="请输入规格" />
</el-form-item>
<el-form-item label="数量" prop="num">
<el-input-number
v-model="dataForm.num"
clearable
style="width: 100%"
placeholder="请输入数量" />
</el-form-item>
<el-form-item label="单位" prop="unit">
<el-select
v-model="dataForm.unit"
filterable
placeholder="请选择单位">
<el-option
v-for="dict in getDictDatas('unit_dict')"
:key="dict.value"
:label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
</el-form>
<el-row style="text-align: right">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</el-row>
</el-dialog>
</template>
<script>
import {
createCoreWOMa,
updateCoreWOMa,
getCoreWOMa
} from '@/api/base/coreWorkOrder';
import { getSupplierList } from "@/api/base/material";
import { getDictDatas} from "@/utils/dict";
export default {
props: {
productId: {
type: String,
default: '',
},
},
data() {
return {
visible: false,
dataForm: {
id: undefined,
material: '',
origin: undefined,
supplierId: undefined,
batch: undefined,
num: 0,
unit: undefined
},
originList: [
{ label: 1, value: '内部'},
{ label: 2, value: '采购'}
],
supplierList: [],
dataRule: {
material: [{ required: true, message: '物料不能为空', trigger: 'blur' }],
num: [{ required: true, message: '数量不能为空', trigger: 'blur' }]
},
};
},
mounted() {
this.getDict()
},
methods: {
async getDict() {
//
const supplierRes = await getSupplierList();
this.supplierList = supplierRes.data;
},
init(id) {
this.dataForm.id = id || '';
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
if (this.dataForm.id) {
getCoreWOMa({
id: this.dataForm.id
}).then((res) => {
this.dataForm = res.data
});
}
});
},
//
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
//
if (this.dataForm.id) {
updateCoreWOMa({
...this.dataForm,
workOrderId: this.productId,
}).then((response) => {
this.$modal.msgSuccess('修改成功');
this.visible = false;
this.$emit('refreshDataList');
});
return;
}
//
createCoreWOMa({
...this.dataForm,
workOrderId: this.productId,
}).then((response) => {
this.$modal.msgSuccess('新增成功');
this.visible = false;
this.$emit('refreshDataList');
});
}
});
},
},
};
</script>
<style scoped>
.dialog >>> .el-dialog__body {
padding: 30px 24px;
}
.dialog >>> .el-dialog__header {
font-size: 16px;
color: rgba(0, 0, 0, 0.85);
font-weight: 500;
padding: 13px 24px;
border-bottom: 1px solid #e9e9e9;
}
.dialog >>> .el-dialog__header .titleStyle::before {
content: '';
display: inline-block;
width: 4px;
height: 16px;
background-color: #0b58ff;
border-radius: 1px;
margin-right: 8px;
position: relative;
top: 2px;
}
</style>

View File

@ -0,0 +1,265 @@
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="300"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="70%">
<add-work-order
ref="addOrUpdate"
@refreshDataList="refreshWorkOrder"></add-work-order>
</base-dialog>
<add-or-update
v-if="detailVisible"
ref="detail"
@refreshDataList="closeDetail"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import AddWorkOrder from './addWorkOrder'
import basicPage from '../../core/mixins/basic-page';
import { parseTime } from '../../core/mixins/code-filter';
import {
getCoreWOPage,
deleteCoreWO
} from '@/api/base/coreWorkOrder';
const tableProps = [
{
prop: 'createTime',
label: '创建时间',
filter: parseTime
},
{
prop: 'name',
label: '工单名称'
},
{
prop: 'code',
label: '工单编码'
},
{
prop: 'workers',
label: '负责人'
},
{
prop: 'priority',
label: '优先级',
filter: (val) => ['', '低', '正常', '高'][val]
},
{
prop: 'triggerOrigin',
label: '来源',
filter: (val) => ['', 'MES', 'ERP'][val]
},
{
prop: 'status',
label: '工单状态',
filter: (val) => ['', '等待', '激活', '暂停', '完成', '', '', '', '', '作废'][val]
},
{
prop: 'planFinishTime',
label: '计划完成时间',
filter: parseTime
},
{
prop: 'planQuantity',
label: '计划生产数量'
},
{
prop: 'actualQuantity',
label: '实际生产数量'
}
];
export default {
mixins: [basicPage],
components: {
AddWorkOrder,
AddOrUpdate
},
data() {
return {
urlOptions: {
getDataListURL: getCoreWOPage,
deleteURL: deleteCoreWO
},
detailVisible: false,
tableProps,
tableBtn: [
this.$auth.hasPermi(`base:core-work-order:update`)
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi(`base:core-work-order:material`)
? {
type: 'material',
btnName: '预使用原料信息',
}
: undefined,
this.$auth.hasPermi(`base:core-work-order:detail`)
? {
type: 'detail',
btnName: '查看详情',
}
: undefined,
this.$auth.hasPermi(`base:core-work-order:delete`)
? {
type: 'delete',
btnName: '删除',
}
: undefined,
// {
// type: 'equal',
// btnName: '',
// showParam: {
// type: '&',
// data: [
// {
// name: 'status',
// type: 'equal',
// value: 1
// }
// ]
// }
// }
].filter((v)=>v),
tableData: [],
formConfig: [
{
type: 'input',
label: '工单名称',
placeholder: '工单名称',
param: 'name'
},
{
type: 'select',
label: '状态',
selectOptions: [
{ id: 1, name: '等待' },
{ id: 2, name: '激活' },
{ id: 3, name: '暂停' },
{ id: 4, name: '完成' },
{ id: 9, name: '作废' }
],
param: 'status',
clearable: true
},
{
type: 'datePicker',
label: '工单实际开始时间',
dateType: 'datetimerange',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
width: 350,
param: 'time'
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('base:core-work-order:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true
},
],
};
},
created() {},
methods: {
refreshWorkOrder(val) {
console.log(val)
if (val) {
console.log('打印')
} else {
this.successSubmit()
}
},
closeDetail() {
this.detailVisible = false
this.getDataList()
},
//
otherMethods(val) {
if (val.type === 'material') {
this.detailVisible = true;
this.addOrEditTitle = "预使用主原料信息";
this.$nextTick(() => {
this.$refs.detail.init(val.data.id, true);
});
}
},
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.name = val.name ? val.name : undefined;
this.listQuery.status = val.status ? val.status : undefined;
this.listQuery.startProduceTime = val.time ? val.time : undefined
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true;
this.addOrUpdateHandle();
break;
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
},
};
</script>

View File

@ -0,0 +1,103 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-11-03 19:31:25
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="80px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="工段名称" prop="name">
<el-input v-model="dataForm.name" clearable placeholder="请输入工段名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="工段编号" prop="code">
<el-input v-model="dataForm.code" clearable placeholder="请输入工段编号" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="产线" prop="productionLineId">
<el-select
v-model="dataForm.productionLineId"
filterable
placeholder="请选择产线">
<el-option
v-for="dict in proLineList"
:key="dict.id"
:label="dict.name"
:value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="排序" prop="sort">
<el-input-number
v-model="dataForm.sort"
placeholder="排序" />
</el-form-item>
</el-col>
</el-row>
<el-form-item label="备注" prop="remark">
<el-input
v-model="dataForm.remark"
placeholder="请输入备注" />
</el-form-item>
</el-form>
</template>
<script>
import basicAdd from '../../core/mixins/basic-add';
import { createCWSection, updateCWSection, getCWSection, getCode } from "@/api/base/coreWorkshopSection";
import { getCorePLList } from '@/api/base/coreProductionLine';
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
isGetCode: true,
codeURL: getCode,
createURL: createCWSection,
updateURL: updateCWSection,
infoURL: getCWSection
},
dataForm: {
id: undefined,
code: undefined,
name: undefined,
description: undefined,
sort: 0,
productionLineId: undefined,
remark: undefined,
},
proLineList: [],
dataRule: {
code: [{ required: true, message: "专业编码不能为空", trigger: "blur" }],
name: [{ required: true, message: "专业名称不能为空", trigger: "blur" }],
productionLineId: [{ required: true, message: "产线不能为空", trigger: "blur" }],
sort: [{ required: true, message: "排序不能为空", trigger: "blur" }]
}
};
},
mounted() {
this.getDict()
},
methods: {
async getDict() {
// 线
const res = await getCorePLList();
this.proLineList = res.data;
},
}
};
</script>

View File

@ -0,0 +1,172 @@
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import basicPage from '../../core/mixins/basic-page';
import { parseTime } from '../../core/mixins/code-filter';
import {
getCWSectionPage,
deleteCWSection
} from '@/api/base/coreWorkshopSection';
const tableProps = [
{
prop: 'createTime',
label: '添加时间',
filter: parseTime
},
{
prop: 'code',
label: '工段编码'
},
{
prop: 'name',
label: '工段名称'
},
{
prop: 'productionLineName',
label: '产线名'
},
{
prop: 'sort',
label: '排序'
},
{
prop: 'remark',
label: '备注'
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getCWSectionPage,
deleteURL: deleteCWSection
},
tableProps,
tableBtn: [
this.$auth.hasPermi(`base:core-workshop-section:update`)
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi(`base:core-workshop-section:delete`)
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v)=>v),
tableData: [],
formConfig: [
{
type: 'input',
label: '工段名称',
placeholder: '工段名称',
param: 'name'
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('base:core-workshop-section:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true
},
],
};
},
components: {
AddOrUpdate,
},
created() {},
methods: {
//
// getDataList() {
// this.dataListLoading = true;
// this.urlOptions.getDataListURL(this.listQuery).then(response => {
// this.tableData = response.data.list;
// this.listQuery.total = response.data.total;
// this.dataListLoading = false;
// });
// },
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.name = val.name ? val.name : undefined;
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true;
this.addOrUpdateHandle();
break;
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
},
};
</script>

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-10-16 11:16:48
* @LastEditTime: 2023-11-03 16:32:52
* @Description:
-->
<template>
@ -13,14 +13,6 @@
@keyup.enter.native="dataFormSubmit()"
label-width="80px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="工厂编码" prop="code">
<el-input
v-model="dataForm.code"
clearable
placeholder="请输入工厂编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="工厂名称" prop="name">
<el-input
@ -29,6 +21,14 @@
placeholder="请输入工厂名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="工厂编码" prop="code">
<el-input
v-model="dataForm.code"
clearable
placeholder="请输入工厂编码" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">

View File

@ -43,19 +43,23 @@ import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import {
deleteFactory,
getFactoryPage,
exportFactoryExcel,
getFactoryPage
} from '@/api/core/base/factory';
const tableProps = [
{
prop: 'code',
label: '工厂编码'
prop: 'createTime',
label: '添加时间',
filter: parseTime
},
{
prop: 'name',
label: '工厂名称'
},
{
prop: 'code',
label: '工厂编码'
},
{
prop: 'address',
label: '地址'
@ -63,12 +67,7 @@ const tableProps = [
{
prop: 'remark',
label: '备注'
},
{
prop: 'createTime',
label: '创建时间',
filter: parseTime
},
}
];
export default {
@ -78,17 +77,17 @@ export default {
urlOptions: {
getDataListURL: getFactoryPage,
deleteURL: deleteFactory,
exportURL: exportFactoryExcel,
// exportURL: exportFactoryExcel,
},
tableProps,
tableBtn: [
this.$auth.hasPermi(`base:factory:update`)
this.$auth.hasPermi(`base:core-factory:update`)
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi(`base:factory:delete`)
this.$auth.hasPermi(`base:core-factory:delete`)
? {
type: 'delete',
btnName: '删除',
@ -97,18 +96,18 @@ export default {
].filter((v)=>v),
tableData: [],
formConfig: [
{
type: 'input',
label: '工厂编码',
placeholder: '工厂编码',
param: 'code',
},
{
type: 'input',
label: '工厂名称',
placeholder: '工厂名称',
param: 'name',
},
{
type: 'input',
label: '工厂编码',
placeholder: '工厂编码',
param: 'code',
},
{
type: 'button',
btnName: '搜索',
@ -127,7 +126,7 @@ export default {
type: 'separate',
},
{
type: this.$auth.hasPermi('base:factory:create') ? 'button' : '',
type: this.$auth.hasPermi('base:core-factory:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',

View File

@ -0,0 +1,196 @@
<template>
<div :class="className" :style="{ height: height, width: width }" />
</template>
<script>
import * as echarts from 'echarts';
require('echarts/theme/macarons'); // echarts theme
import resize from '@/utils/chartMixins/resize';
const animationDuration = 1000;
export default {
mixins: [resize],
props: {
className: {
type: String,
default: 'chart',
},
title: {
type: String,
default: '',
},
width: {
type: String,
default: '100%',
},
height: {
type: String,
default: '300px',
},
histogram: {
type: Array,
default: () => [],
},
},
data() {
return {
chart: null,
};
},
beforeDestroy() {
if (!this.chart) {
return;
}
this.chart.dispose();
this.chart = null;
},
methods: {
initChart() {
var nameArr = [];
var valueArr = [];
var dayArr = [];
if (this.histogram.length > 0) {
this.histogram.forEach((item) => {
nameArr.push(item.goodsName);
valueArr.push(item.num);
dayArr.push(item.day);
});
}
this.chart = echarts.init(this.$el, 'macarons');
this.chart.setOption({
title: {
text: this.title
? '{space|}{tip|}{space|}{value|' + this.title + '}'
: '',
left: '0%',
top: '0%',
textStyle: {
rich: {
tip: {
width: 4,
height: 18,
backgroundColor: '#0B58FF',
marginRight: 6,
},
space: {
width: 8,
},
value: {
fontSize: 16,
fontWeight: 'bold',
color: 'black',
},
},
},
},
color: ['#288AFF', '#8EF0AB', '#FFDC94'],
tooltip: {
trigger: 'axis',
axisPointer: {
//
type: 'shadow', // 线'line' | 'shadow'
},
},
grid: [
{
containLabel: true,
top: 40,
left: '2%',
right: '2%',
bottom: '3%',
bottom: '55%',
},
{
containLabel: true,
top: 40,
left: '2%',
right: '2%',
bottom: '3%',
top: '55%',
},
],
xAxis: [
{
type: 'category',
data: nameArr,
gridIndex: 0,
axisTick: {
alignWithLabel: true,
},
axisLabel: {
color: '#979797',
},
axisLine: {
lineStyle: {
color: '#979797',
},
},
},
{
type: 'category',
data: nameArr,
gridIndex: 1,
axisTick: {
alignWithLabel: true,
},
axisLabel: {
color: '#979797',
},
axisLine: {
lineStyle: {
color: '#979797',
},
},
},
],
yAxis: [
{
gridIndex: 0,
axisTick: {
show: false,
},
splitArea: {
show: false,
},
axisLabel: {
color: '#979797',
},
},
{
gridIndex: 1,
axisTick: {
show: false,
},
splitArea: {
show: false,
},
axisLabel: {
color: '#979797',
},
},
],
series: [
{
name: '数量',
type: 'bar',
barWidth: '20',
data: valueArr,
animationDuration,
},
{
name: '天数',
type: 'bar',
barWidth: '20',
data: dayArr,
animationDuration,
xAxisIndex: 1,
yAxisIndex: 1,
},
],
});
},
},
};
</script>

View File

@ -0,0 +1,173 @@
<template>
<div :class="className" :style="{ height: height, width: width }" />
</template>
<script>
import * as echarts from 'echarts';
require('echarts/theme/macarons'); // echarts theme
import resize from '@/utils/chartMixins/resize';
const animationDuration = 1000;
export default {
mixins: [resize],
props: {
className: {
type: String,
default: 'chart',
},
title: {
type: String,
default: 'chart',
},
width: {
type: String,
default: '100%',
},
height: {
type: String,
default: '250px',
},
pieData: {
type: Array,
default: () => [],
},
},
data() {
return {
chart: null,
};
},
beforeDestroy() {
if (!this.chart) {
return;
}
this.chart.dispose();
this.chart = null;
},
methods: {
initChart() {
this.chart = echarts.init(this.$el, 'macarons');
let totalNumber = 0;
this.pieData.forEach((i) => {
i.value = i.num;
i.name = i.status;
totalNumber += i.num;
});
this.chart.setOption({
title: {
zlevel: 2, //
text: '总数',
subtext: totalNumber,
top: '42%', //
left: '50%', //
textAlign: 'center', //
textStyle: {
color: 'rgba(203, 195, 195, 1)',
},
subtextStyle: {
fontSize: 20,
},
},
tooltip: {
trigger: 'item',
show: true, //
formatter: '产品: {b}<br/>数量: {c}<br/>占比: {d}%',
},
legend: {
orient: 'vartical',
bottom: 0,
left: 'right',
icon: 'circle',
itemGap: 16, //
textStyle: {
//
fontSize: 24, // legend
color: '#828282',
rich: {
oneone: {
width: 50,
color: '#000000',
fontSize: 12,
fontWeight: 'bolder',
},
twotwo: {
width: 35,
color: '#333',
fontSize: 12,
},
threethree: {
width: 20,
color: '#959595',
fontSize: 12,
},
},
},
formatter: (name) => {
var target = this.pieData.find((item) => {
return item.name === name;
}).num;
var v = ((target / totalNumber) * 100).toFixed(2);
return `{oneone|${name}} {twotwo|${target}个} {threethree|${v}%}`;
},
},
// legend: {
// bottom: '0%',
// left: 'center',
// },
grid: {
top: 40,
left: '0%',
right: '2%',
bottom: '3%',
containLabel: true,
},
series: [
{
name: 'pie',
type: 'pie',
radius: ['55%', '80%'],
bottom: '20%',
avoidLabelOverlap: true, // 线
itemStyle: {
borderRadius: 10,
borderColor: '#fff',
borderWidth: 2,
},
label: {
normal: {
show: true,
position: 'outside', // inside
formatter: '{b}', // {a}{b}{c}{d}{d}value
textStyle: {
// 线
align: 'right',
baseline: 'middle',
fontFamily: '微软雅黑',
fontSize: 12,
fontWeight: 'bolder',
color: '#333',
},
},
},
emphasis: {
label: {
show: true,
fontSize: 40,
fontWeight: 'bold',
},
},
labelLine: {
show: true,
length: 17,
length2: 57,
},
data: this.pieData,
},
],
});
},
},
};
</script>

View File

@ -0,0 +1,96 @@
<!--
* @Author: zwq
* @Date: 2023-08-22 15:01:54
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 16:32:13
* @Description:
-->
<template>
<el-row :gutter="10" class="chart-container">
<el-col :span="14">
<div class="chart-card">
<barChart
ref="barChart"
height="500px"
title="库存总览"
v-if="overviewList.length"
:histogram="overviewList" />
<!-- 没有数据 -->
<div class="no-data-bg" v-else></div>
</div>
</el-col>
<el-col :span="10">
<div class="chart-card">
<pieChart
ref="pieChart"
height="600px"
v-if="rateList.length"
:pie-data="rateList" />
<!-- 没有数据 -->
<div class="no-data-bg" v-else></div>
</div>
</el-col>
</el-row>
</template>
<script>
import barChart from '../../chart/BarChart.vue';
import pieChart from '../../chart/PieChart.vue';
import {
getOverview,
getRate,
} from '@/api/warehouse/warehouseLocation';
export default {
data() {
return {
urlOptions: {
allURL: getOverview,
rateURL: getRate
},
overviewList: [],
rateList: []
};
},
components: {
barChart,
pieChart
},
mounted() {
this.getDataList();
},
methods: {
//
getDataList() {
const data = {
storageType : 2
}
this.urlOptions.allURL(data).then((response) => {
this.overviewList = response.data;
this.$nextTick(() => {
this.$refs.barChart.initChart();
});
});
this.urlOptions.rateURL(data).then((response) => {
this.rateList = response.data;
this.$nextTick(() => {
this.$refs.pieChart.initChart();
});
});
},
},
};
</script>
<style scoped>
.chart-container {
min-height: calc(100vh - 120px - 8px);
background-color: #f0f2f7;
}
.chart-card {
min-height: calc(100vh - 120px - 8px);
background-color: #fff;
padding: 16px;
border-radius: 8px;
}
</style>

View File

@ -0,0 +1,156 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 13:52:10
* @LastEditors: zwq
* @LastEditTime: 2023-11-03 14:56:25
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
v-if="visible"
@keyup.enter.native="dataFormSubmit()"
label-width="100px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="名称" prop="name">
<el-input
v-model="dataForm.name"
clearable
placeholder="请输入名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="编码" prop="code">
<el-input
v-model="dataForm.code"
clearable
placeholder="请输入编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="规格" prop="spec">
<el-input
v-model="dataForm.spec"
clearable
placeholder="请输入规格" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单位" prop="unit">
<el-select
v-model="dataForm.unit"
filterable
clearable
:style="{ width: '100%' }"
placeholder="请选择单位">
<el-option
v-for="item in urlOptions.dictList.dict0"
:key="item.id"
:label="item.label"
:value="parseInt(item.value)"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单日消耗量" prop="dailyUse">
<el-input-number
v-model="dataForm.dailyUse"
clearable
placeholder="请输入单日消耗量" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="允许留存时间" prop="allowTime">
<el-input-number
v-model="dataForm.allowTime"
clearable
placeholder="请输入允许留存时间" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="enabled" label="是否可用">
<el-select
v-model="dataForm.enabled"
filterable
clearable
:style="{ width: '100%' }"
placeholder="请选择是否可用">
<el-option
v-for="item in isorno"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input
v-model="dataForm.remark"
clearable
placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import basicAdd from '../../mixins/basic-add';
import {
createWarehouseGoods,
updateWarehouseGoods,
getWarehouseGoods,
getCode,
} from '@/api/warehouse/warehouseGoods';
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
isGetCode: true,
getDictList: true,
codeURL: getCode,
createURL: createWarehouseGoods,
updateURL: updateWarehouseGoods,
infoURL: getWarehouseGoods,
},
nameList: ['unit_dict'],
dataForm: {
id: undefined,
code: '',
name: '',
spec: '',
unit: '',
dailyUse: 0,
allowTime: 0,
enabled: 1,
remark: '',
},
dataRule: {
code: [
{ required: true, message: '库位编码不能为空', trigger: 'blur' },
],
name: [
{ required: true, message: '库位名称不能为空', trigger: 'blur' },
],
},
isorno: [
{
id: 0,
name: '不可用',
},
{
id: 1,
name: '可用',
},
],
};
},
methods: {},
};
</script>

View File

@ -0,0 +1,183 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="80"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<!-- 对话框(添加 / 修改) -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import codeFilter from '../../mixins/code-filter';
import {
deleteWarehouseGoods,
getWarehouseGoodsPage,
} from "@/api/warehouse/warehouseGoods";
import { publicFormatter } from '@/utils/dict';
const tableProps = [
{
prop: 'name',
label: '名称',
},
{
prop: 'code',
label: '编码',
},
{
prop: 'spec',
label: '规格',
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('unit_dict')
},
{
prop: 'allowTime',
label: '允许留存时长(天)',
},
{
prop: 'dailyUse',
label: '单日消耗量',
},
{
prop: 'enabled',
label: '是否可用',
filter: codeFilter('deactivate'),
},
{
prop: 'remark',
label: '备注',
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseGoodsPage,
deleteURL: deleteWarehouseGoods,
},
tableProps,
listQuery:{
storageType:2
},
tableBtn: [
this.$auth.hasPermi(`end-material:warehouse-goods:update`)
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi(`end-material:warehouse-goods:delete`)
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v)=>v),
tableData: [],
formConfig: [
{
type: 'input',
label: '名称',
placeholder: '名称',
param: 'name',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('end-material:warehouse-goods:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true,
},
],
};
},
components: {
AddOrUpdate,
},
created() {},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.name = val.name;
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true;
this.addOrUpdateHandle();
break;
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
},
};
</script>

View File

@ -0,0 +1,192 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:isFold="true"
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
label="库位详情"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
</div>
</template>
<script>
import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import {
getWarehouseRealtimeHisPage,
} from '@/api/warehouse/warehouseRealtime';
import { getListByType } from '@/api/warehouse/warehouseGoods';
import { listData } from '@/api/system/dict/data';
import { publicFormatter } from '@/utils/dict';
const tableProps = [
{
prop: 'warehouseName',
label: '仓库名称',
},
{
prop: 'name',
label: '物品名称',
},
{
prop: 'code',
label: '物品编码',
},
{
prop: 'spec',
label: '物品规格',
},
{
prop: 'num',
label: '出入库数量',
},
{
prop: 'goodsBatch',
label: '物品批次',
},
{
prop: 'operateStatus',
label: '操作状态',
filter: publicFormatter('warehouse_operate_status'),
},
{
prop: 'operateTime',
label: '操作时间',
filter: parseTime,
minWidth: 150,
},
{
prop: 'operator',
label: '操作人',
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseRealtimeHisPage,
},
listQuery: {
storageType: 2,
},
tableData: [],
tableProps,
tableBtn: [
this.$auth.hasPermi(`end-material:warehouse-realtime-location-his:query`)
? {
type: 'info',
btnName: '详情',
}
: undefined,
].filter((v) => v),
drawerVisible: false,
formConfig: [
{
type: 'select',
label: '物品名称',
selectOptions: [],
param: 'goodsId',
defaultSelect: '',
filterable: true,
},
{
type: 'input',
label: '操作人',
placeholder: '操作人',
param: 'operator',
},
{
type: 'select',
label: '操作状态',
selectOptions: [],
param: 'status',
defaultSelect: '',
filterable: true,
labelField: 'label',
valueField: 'value',
},
{
type: 'datePicker',
label: '操作时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: "timestamp",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
],
};
},
components: {
},
created() {
const queryParams = {
pageNo: 1,
pageSize: 99,
dictType: 'warehouse_operate_status',
};
listData(queryParams).then((response) => {
this.formConfig[2].selectOptions = response.data.list;
});
getListByType(this.listQuery.storageType).then((response) => {
this.formConfig[0].selectOptions = response.data;
});
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.goodsId = val.goodsId;
this.listQuery.operator = val.operator;
this.listQuery.operateStatus = val.status;
this.listQuery.operateTime = val.searchTime?val.searchTime:null;
this.getDataList();
break;
default:
console.log(val);
}
},
},
};
</script>
<style>
.app-container .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@ -0,0 +1,82 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2023-11-03 16:20:19
* @Description:
-->
<template>
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:height="300"
:table-data="tableData" />
</template>
<script>
import { parseTime } from '../../mixins/code-filter';
import { getWarehouseLocationHisDet } from '@/api/warehouse/warehouseRealtimeLocation';
const tableProps = [
{
prop: 'name',
label: '物品名称',
align: 'center',
},
{
prop: 'code',
label: '物品编码',
align: 'center',
},
{
prop: 'spec',
label: '物品规格',
align: 'center',
},
{
prop: 'batchCode',
label: '物品批次',
align: 'center',
},
{
prop: 'num',
label: '数量',
align: 'center',
},
{
prop: 'allowTime',
label: '允许留存时长(天)',
align: 'center',
},
{
prop: 'remark',
label: '备注',
align: 'center',
},
];
export default {
data() {
return {
tableData: [],
tableProps,
listQuery: {
pageSize: 100,
pageNo: 1,
total: 1,
},
dataListLoading: false,
};
},
methods: {
//
init(id) {
this.dataListLoading = true;
getWarehouseLocationHisDet(id).then((response) => {
this.tableData = response.data;
this.dataListLoading = false;
});
},
},
};
</script>

View File

@ -0,0 +1,223 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:isFold="true"
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
label="库位详情"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<!-- 对话框(添加 / 修改) -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
<slot name="footer">
<el-row slot="footer" type="flex" justify="end">
<el-col :span="24">
<el-button size="small" class="btnTextStyle" @click="handleCancel">
取消
</el-button>
</el-col>
</el-row>
</slot>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import {
getWarehouseLocationHisPage,
} from '@/api/warehouse/warehouseRealtimeLocation';
import { listByWarehouse } from '@/api/warehouse/warehouseLocation';
import { listData } from '@/api/system/dict/data';
import { publicFormatter } from '@/utils/dict';
const tableProps = [
{
prop: 'warehouseName',
label: '仓库名称',
},
{
prop: 'name',
label: '库位名称',
},
{
prop: 'code',
label: '库位编码',
},
{
prop: 'type',
label: '库位类型',
filter: publicFormatter('location_type'),
},
{
prop: 'palletCode',
label: '托盘编码',
},
{
prop: 'operateStatus',
label: '操作状态',
filter: publicFormatter('warehouse_operate_status'),
},
{
prop: 'createTime',
label: '操作时间',
filter: parseTime,
minWidth: 150,
},
{
prop: 'creator',
label: '操作人',
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseLocationHisPage,
},
listQuery: {
storageType: 2,
},
tableData: [],
tableProps,
tableBtn: [
this.$auth.hasPermi(`end-material:warehouse-realtime-location-his:query`)
? {
type: 'info',
btnName: '详情',
}
: undefined,
].filter((v) => v),
drawerVisible: false,
formConfig: [
{
type: 'select',
label: '库位名',
selectOptions: [],
param: 'name',
defaultSelect: '',
filterable: true,
},
{
type: 'input',
label: '托盘编码',
placeholder: '托盘编码',
param: 'code',
},
{
type: 'select',
label: '操作状态',
selectOptions: [],
param: 'status',
defaultSelect: '',
filterable: true,
labelField: 'label',
valueField: 'value',
},
{
type: 'datePicker',
label: '操作时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: "timestamp",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
],
};
},
components: {
AddOrUpdate,
},
created() {
const queryParams = {
pageNo: 1,
pageSize: 99,
dictType: 'warehouse_operate_status',
};
listData(queryParams).then((response) => {
this.formConfig[2].selectOptions = response.data.list;
});
listByWarehouse(this.listQuery.storageType).then((response) => {
this.formConfig[0].selectOptions = response.data;
});
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.locationId = val.name;
this.listQuery.palletCode = val.code;
this.listQuery.operateStatus = val.status;
this.listQuery.createTime = val.searchTime?val.searchTime:null;
this.getDataList();
break;
default:
console.log(val);
}
},
otherMethods(val) {
if (val.type === 'info') {
this.addOrUpdateVisible = true;
this.addOrEditTitle = val.data.name + ' -产品信息';
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id);
});
}
},
handleCancel() {
this.addOrUpdateVisible = false;
this.addOrEditTitle = '';
},
},
};
</script>
<style>
.app-container .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@ -0,0 +1,221 @@
<!--
* @Author: zwq
* @Date: 2023-08-21 14:26:23
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 14:46:59
* @Description:
-->
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<div class="tips">
<el-tag effect="dark" color="#7362F3" style="border: none">缓存</el-tag>
<el-tag effect="dark" color="#16DC09" style="border: none">活动</el-tag>
<el-tag effect="dark" color="#FFA08F" style="border: none">其它</el-tag>
</div>
<div class="mainbody">
<div v-for="i in total" :key="i">
<el-row>
<el-col :span="24">
<el-row type="flex" class="flex-warp">
<div
class="dashboard-layout-item"
v-for="a in wareData.one.slice((i - 1) * 10, i * 10)"
:key="a.id + a.code"
:title="a.name"
style="background: #fff8e8; float: left">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[a.type - 1],
}" />
<p class="p-name">{{ a.name }}</p>
</div>
</el-row>
<el-row type="flex" class="flex-warp">
<div
class="dashboard-layout-item"
v-for="b in wareData.two.slice((i - 1) * 10, i * 10)"
:key="b.id + b.code"
:title="b.name"
style="background: #fff8e8; float: left">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[b.type - 1],
}" />
<p class="p-name">{{ b.name }}</p>
</div>
</el-row>
</el-col>
</el-row>
<el-divider class="divider"></el-divider>
<el-row>
<el-col :span="24">
<el-row type="flex" class="flex-warp">
<div
class="dashboard-layout-item"
v-for="c in wareData.there.slice((i - 1) * 10, i * 10)"
:key="c.id + c.code"
:title="c.name"
style="background: #fff8e8; float: left">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[c.type - 1],
}" />
<p class="p-name">{{ c.name }}</p>
</div>
</el-row>
<el-row type="flex" class="flex-warp">
<div
class="dashboard-layout-item"
v-for="d in wareData.four.slice((i - 1) * 10, i * 10)"
:key="d.id + d.code"
:title="d.name"
style="background: #fff8e8; float: left">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[d.type - 1],
}" />
<p class="p-name">{{ d.name }}</p>
</div>
</el-row>
</el-col>
</el-row>
</div>
</div>
</div>
</template>
<script>
import { listByWarehouse, listAll } from '@/api/warehouse/warehouseLocation';
export default {
data() {
return {
wareData: {
one: [],
two: [],
there: [],
four: [],
},
total: 0,
bgColor: ['#7362F3', '#16DC09', '#FFA08F'],
formConfig: [
{
type: 'button',
btnName: '刷新',
name: 'search',
color: 'primary',
},
],
};
},
components: {},
mounted() {
this.getDataList();
},
methods: {
//
getDataList() {
(this.wareData = {
one: [],
two: [],
there: [],
four: [],
}),
listAll(1).then((response) => {
response.data.forEach((a, b) => {
if (b % 4 === 0) {
this.wareData.one.push(a);
} else if (b % 4 === 1) {
this.wareData.two.push(a);
} else if (b % 4 === 2) {
this.wareData.there.push(a);
} else if (b % 4 === 3) {
this.wareData.four.push(a);
}
});
this.total = Math.ceil(response.data.length / 40);
});
},
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.getDataList();
break;
default:
console.log(val);
}
},
},
};
</script>
<style lang="scss" scoped>
.mainbody {
display: flex;
gap: 70px;
flex-direction: column;
}
.flex-warp {
flex-wrap: nowrap;
}
.dashboard-layout-item {
width: 100px;
text-align: center;
height: 32px;
box-shadow: 0px 3px 6px 0px rgba(166, 174, 190, 0.8);
border-radius: 2px 4px 4px 2px;
margin: 0 3px 8px 0;
display: flex;
align-items: center;
justify-content: center;
position: relative;
.dashboard-layout-item-cricle {
display: inline-block;
width: 12px;
height: 12px;
border-radius: 6px;
position: absolute;
top: 10px;
left: 3px;
}
.p-name {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
margin-left: 15px;
}
&:hover {
cursor: pointer;
z-index: 10;
transform: scale(1.3) translateZ(0);
}
&:nth-child(2n) {
margin-right: 30px;
}
&:first-child {
margin-left: 50px;
}
&:last-child {
margin-right: 30px;
}
}
.el-divider--horizontal {
margin: 10px 0;
}
.el-divider {
background-color: black;
}
.tips {
position: absolute;
top: 22px;
right: 120px;
}
</style>

View File

@ -0,0 +1,202 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 13:52:10
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 16:32:54
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
v-if="visible"
@keyup.enter.native="dataFormSubmit()"
label-width="100px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="仓库名称" prop="warehouseName">
<el-input
v-model="dataForm.warehouseName"
readonly
placeholder="请输入仓库名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物品名称" prop="goodsId">
<el-select
v-model="dataForm.goodsId"
filterable
clearable
:disabled="dataForm.id ? true : false"
:style="{ width: '100%' }"
@change="setGoodInfo"
placeholder="请选择物品名称">
<el-option
v-for="item in goodsArr"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物品编码" prop="code">
<el-input
v-model="dataForm.code"
readonly
placeholder="请输入物品编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物品规格" prop="spec">
<el-input
v-model="dataForm.spec"
readonly
placeholder="请输入物品规格" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物品批次" prop="goodsBatch">
<el-input
v-if="!dataForm.id ? true : false"
v-model="dataForm.goodsBatch"
clearable
placeholder="请输入物品批次" />
<el-select
v-else
v-model="dataForm.goodsBatch"
filterable
clearable
@change="setBatchInfo"
placeholder="请选择物品名称">
<el-option
v-for="(item, index) in Batch"
:key="index"
:label="item.goodsBatch"
:value="item.goodsBatch"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="入库数量" prop="numDet">
<el-input-number
v-model="dataForm.numDet"
clearable
:min="0"
:max="max?max:9999999"
placeholder="请输入入库数量" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import basicAdd from '../../mixins/basic-add';
import {
createWarehouseRealtime,
outWarehouseRealtime,
getWarehouseRealtime,
getWarehouseRealtimeDet,
} from '@/api/warehouse/warehouseRealtime';
import { getListByType } from '@/api/warehouse/warehouseGoods';
import { getWarehouseList } from '@/api/warehouse/warehouse-info';
import { mapGetters } from 'vuex';
export default {
mixins: [basicAdd],
computed: {
...mapGetters(['nickname']),
},
data() {
return {
urlOptions: {
getOption: true,
createURL: createWarehouseRealtime,
updateURL: outWarehouseRealtime,
infoURL: getWarehouseRealtime,
},
dataForm: {
id: undefined,
warehouseName: '',
warehouseId: '',
goodsId: '',
code: '',
spec: '',
goodsBatch: '',
numDet: '',
operator: '',
},
goodsArr: [],
Batch: [],
max: 0,
dataRule: {
goodsId: [
{ required: true, message: '物品名称不能为空', trigger: 'change' },
],
goodsBatch: [
{
required: true,
message: '物品批次不能为空,若无请填写无',
trigger: 'blur',
},
],
numDet: [
{ required: true, message: '入库数量不能为空', trigger: 'blur' },
],
},
};
},
created() {},
methods: {
getArr() {
this.dataForm.operator = this.nickname
getListByType(2).then((response) => {
this.goodsArr = response.data;
});
getWarehouseList().then((response) => {
response.data.forEach((item) => {
if (item.storageType === 2) {
this.dataForm.warehouseName = item.name;
this.dataForm.warehouseId = item.id;
}
});
});
},
setGoodInfo() {
this.goodsArr.forEach((item) => {
if (item.id === this.dataForm.goodsId) {
this.dataForm.code = item.code;
this.dataForm.spec = item.spec;
}
});
},
setBatchInfo(){
this.Batch.forEach((item) => {
if (item.goodsBatch === this.dataForm.goodsBatch) {
this.max = item.numDet
}
});
},
outWare(data) {
this.getArr();
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
this.dataForm.realTimeId = data.id;
this.dataForm.id = data.id;
this.dataForm.goodsId = data.goodsId;
this.dataForm.code = data.code;
this.dataForm.spec = data.spec;
getWarehouseRealtimeDet(data.id).then((res) => {
this.Batch = res.data;
});
// this.urlOptions.infoURL(data.id).then((response) => {
// this.dataForm = response.data;
// });
});
},
},
};
</script>

View File

@ -0,0 +1,193 @@
<!--
* @Author: zwq
* @Date: 2023-11-03 16:37:06
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 16:33:02
* @Description:
-->
<template>
<div class="app-container">
<search-bar
:isFold="true"
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<el-table
:data="tableData"
:header-cell-style="{
background: '#F2F4F9',
color: '#606266',
}"
border
v-loading="dataListLoading"
style="width: 100%"
ref="dataList">
<el-table-column type="expand">
<template slot-scope="scope">
<product :warehouse-id="scope.row.id"></product>
</template>
</el-table-column>
<el-table-column prop="warehouseName" label="仓库名称" />
<el-table-column prop="name" label="物品名称" />
<el-table-column prop="code" label="物品编码" />
<el-table-column prop="spec" label="物品规格" />
<el-table-column prop="num" label="数量" />
<el-table-column prop="operator" label="操作人" />
<el-table-column prop="latestInTime" label="最新入库时间">
<template v-slot="scope">
<span>{{ parseTime(scope.row.latestInTime) }}</span>
</template>
</el-table-column>
<el-table-column prop="latestOutTime" label="最新出库时间">
<template v-slot="scope">
<span>{{ parseTime(scope.row.latestOutTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" width="100">
<template v-slot="scope">
<el-button
size="mini"
type="text"
@click="handleClick({ data: scope.row, type: 'out' })"
v-hasPermi="['end-material:warehouse-realtime:update']">
出库
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<!-- 对话框(添加 / 修改) -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog>
</div>
</template>
<script>
import product from './product-mini';
import basicPage from '../../mixins/basic-page';
import { getListByType } from '@/api/warehouse/warehouseGoods';
import AddOrUpdate from './add-or-updata';
import { getWarehouseRealtimePage } from '@/api/warehouse/warehouseRealtime';
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseRealtimePage,
},
tableData: [],
listQuery: {
storageType: 2,
},
formConfig: [
{
type: 'select',
label: '物品名称',
selectOptions: [],
param: 'goodsId',
defaultSelect: '',
filterable: true,
},
{
type: 'input',
label: '操作人',
placeholder: '操作人',
param: 'operator',
},
{
type: 'datePicker',
label: '最新入库时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'timestamp',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'datePicker',
label: '最新出库时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'timestamp',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime1',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
{
type: this.$auth.hasPermi('end-material:warehouse-realtime:create') ? 'button' : '',
btnName: '入库',
name: 'add',
color: 'success',
plain: true,
},
],
};
},
components: {
product,
AddOrUpdate,
},
created() {
getListByType(this.listQuery.storageType).then((response) => {
this.formConfig[0].selectOptions = response.data;
});
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.goodsId = val.goodsId;
this.listQuery.operator = val.operator;
this.listQuery.latestInTime = val.searchTime?val.searchTime:null;
this.listQuery.latestOutTime = val.searchTime1?val.searchTime1:null;
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '入库';
this.addOrUpdateVisible = true;
this.addOrUpdateHandle();
break;
default:
console.log(val);
}
},
otherMethods(val){
this.addOrUpdateVisible = true;
this.addOrEditTitle = "出库";
this.$nextTick(() => {
this.$refs.addOrUpdate.outWare(val.data);
});
}
},
};
</script>
<style>
.app-container .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@ -0,0 +1,71 @@
<!--
* @Author: zwq
* @Date: 2023-08-24 14:47:58
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 10:31:56
* @Description:
-->
<template>
<div>
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
max-height="200"
:table-data="tableData" />
</div>
</template>
<script>
import { parseTime } from '../../mixins/code-filter';
import { getWarehouseRealtimeDet } from '@/api/warehouse/warehouseRealtime';
const tableProps = [
{
prop: 'goodsBatch',
label: '产品批次',
},
{
prop: 'numDet',
label: '批次数量',
},
{
prop: 'createTime',
label: '入库时间',
filter: parseTime,
},
];
export default {
props: {
warehouseId: {
type: String,
default: '',
},
},
data() {
return {
urlOptions: {
getDataListURL: getWarehouseRealtimeDet
},
tableProps,
tableData: [],
dataListLoading: false,
};
},
components: {
},
created() {},
mounted() {
this.getDataList()
},
methods: {
//
getDataList() {
this.dataListLoading = true;
this.urlOptions.getDataListURL(this.warehouseId).then(response => {
this.tableData = response.data;
this.dataListLoading = false;
});
},
},
};
</script>

View File

@ -0,0 +1,65 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 15:27:31
* @LastEditors: zwq
* @LastEditTime: 2023-08-01 16:25:54
* @Description:
-->
<template>
<div :class="[className, { 'p-0': noPadding }]">
<slot />
</div>
</template>
<script>
export default {
props: {
size: {
// : xl lg md sm
type: String,
default: 'de',
validator: function (val) {
return ['xl', 'lg', 'de', 'md', 'sm'].indexOf(val) !== -1;
},
},
noPadding: {
type: Boolean,
default: false,
},
},
computed: {
className: function () {
return `${this.size}-title`;
},
},
};
</script>
<style lang="scss" scoped>
$pxls: (xl, 28px) (lg, 24px) (de, 20px) (md, 18px) (sm, 16px);
$mgr: 8px;
@each $size, $height in $pxls {
.#{$size}-title {
font-size: 18px;
line-height: $height;
color: #000;
font-weight: 500;
font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif;
&::before {
content: '';
display: inline-block;
vertical-align: top;
width: 4px;
height: $height + 2px;
border-radius: 1px;
margin-right: $mgr;
background-color: #0b58ff;
}
}
}
.p-0 {
padding: 0;
}
</style>

View File

@ -0,0 +1,93 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2023-11-03 14:51:33
* @Description:
-->
<template>
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:height="300"
:table-data="tableData" />
</template>
<script>
import { parseTime } from '../../mixins/code-filter';
import { getWarehouseRealtimeLocation } from '@/api/warehouse/warehouseRealtimeLocation';
const tableProps = [
{
prop: 'name',
label: '物品名称',
align: 'center',
},
{
prop: 'code',
label: '物品编码',
align: 'center',
},
{
prop: 'spec',
label: '物品规格',
align: 'center',
},
{
prop: 'goodsBatch',
label: '物品批次',
align: 'center',
},
{
prop: 'num',
label: '数量',
align: 'center',
},
{
prop: 'allowTime',
label: '允许留存时长(天)',
align: 'center',
},
{
prop: 'inTime',
label: '入库时间',
align: 'center',
filter: parseTime,
},
{
prop: 'leftTime',
label: '剩余留存时长(天)',
align: 'center',
},
{
prop: 'remark',
label: '备注',
align: 'center',
},
];
export default {
data() {
return {
tableData: [],
tableProps,
listQuery: {
pageSize: 100,
pageNo: 1,
total: 1,
},
dataListLoading: false,
};
},
methods: {
//
init(id) {
this.dataListLoading = true;
getWarehouseRealtimeLocation(id).then((response) => {
this.tableData = response.data;
this.dataListLoading = false;
});
},
},
};
</script>

View File

@ -0,0 +1,122 @@
<template>
<el-dialog
:visible.sync="visible"
:width="'35%'"
:append-to-body="true"
:close-on-click-modal="false"
class="dialog">
<template #title>
<slot name="title">
<div class="titleStyle">
新增产品
</div>
</slot>
</template>
<el-form
ref="dataForm"
:model="dataForm"
:rules="dataRule"
label-width="100px"
@keyup.enter.native="dataFormSubmit()">
<el-form-item label="产品" prop="productInfo">
<el-select
v-model="dataForm.productInfo"
style="width: 100%"
filterable
value-key="id"
placeholder="请选择产品">
<el-option
v-for="item in productArr"
:key="item.id"
:label="item.name"
:value="item" />
</el-select>
</el-form-item>
</el-form>
<el-row style="text-align: right">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</el-row>
</el-dialog>
</template>
<script>
import {
getListByType
} from "@/api/warehouse/warehouseGoods";
export default {
data() {
return {
visible: false,
dataForm: {
index: -1,
productInfo: '',
},
productArr: [],
dataRule: {
productId: [{ required: true, message: '产品不能为空', trigger: 'blur' }],
},
};
},
methods: {
init(index) {
if (index >= 0) {
this.dataForm.index = index;
}
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
getListByType(2).then((response) => {
this.productArr = response.data;
});
});
},
//
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.dataForm.productInfo.goodsId = this.dataForm.productInfo.id
this.dataForm.productInfo.remark = ''
//
if (this.dataForm.index >= 0) {
this.visible = false;
this.$emit('refreshDataList', this.dataForm);
return;
}
//
this.visible = false;
this.$emit('refreshDataList', this.dataForm);
}
});
},
},
};
</script>
<style scoped>
.dialog >>> .el-dialog__body {
padding: 30px 24px;
}
.dialog >>> .el-dialog__header {
font-size: 16px;
color: rgba(0, 0, 0, 0.85);
font-weight: 500;
padding: 13px 24px;
border-bottom: 1px solid #e9e9e9;
}
.dialog >>> .el-dialog__header .titleStyle::before {
content: '';
display: inline-block;
width: 4px;
height: 16px;
background-color: #0b58ff;
border-radius: 1px;
margin-right: 8px;
position: relative;
top: 2px;
}
</style>

View File

@ -0,0 +1,317 @@
<template>
<el-drawer
:visible.sync="visible"
:show-close="false"
:destroy-on-close="true"
:wrapper-closable="false"
class="drawer"
size="60%">
<small-title slot="title" :no-padding="true">库位信息</small-title>
<div class="content">
<div class="visual-part">
<el-form
ref="dataForm"
:model="dataForm"
:rules="dataRule"
label-width="100px"
label-position="top"
@keyup.enter.native="dataFormSubmit">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="库位名称" prop="name">
<el-input
v-model="dataForm.name"
disabled />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="托盘编码" prop="palletCode">
<el-input
v-model="dataForm.palletCode"
@input="$forceUpdate()"
placeholder="请输入托盘编码" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<small-title
style="margin: 16px 0; padding-left: 8px"
:no-padding="true">
产品信息
<!-- <el-alert
title="产品信息新增和修改后,需点击最下方保存按钮确定修改"
type="warning"
show-icon></el-alert> -->
</small-title>
<div class="attr-list">
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:add-button-show="addButtonShow"
@emitButtonClick="addNew"
@emitFun="inputChange"
:height="400"
:table-data="productAttributeList">
<method-btn
slot="handleBtn"
:width="70"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
</div>
</div>
</div>
<div style="position: absolute; bottom: 24px; right: 24px">
<el-button style="margin-right: 10px" @click="goback()">返回</el-button>
<span>
<el-button type="primary" @click="dataFormSubmit()">入库</el-button>
</span>
</div>
<product-attr-add
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="addList" />
</el-drawer>
</template>
<script>
import productAttrAdd from './attr-add';
import inputArea from '../../mixins/inputArea';
import SmallTitle from './SmallTitle';
import { inWarehouseRealtimeLocation,
getWarehouseRealtimeLocation } from '@/api/warehouse/warehouseRealtimeLocation';
const tableBtn = [
{
type: 'delete',
btnName: '删除',
},
];
const tableProps = [
{
prop: 'name',
label: '物品名称',
align: 'center',
},
{
prop: 'code',
label: '物品编码',
align: 'center',
},
{
prop: 'spec',
label: '物品规格',
align: 'center',
},
{
prop: 'goodsBatch',
label: '物品批次',
align: 'center',
subcomponent: inputArea,
width: 100,
},
{
prop: 'num',
label: '数量',
align: 'center',
subcomponent: inputArea,
width: 100,
},
{
prop: 'remark',
label: '备注',
align: 'center',
subcomponent: inputArea,
width: 100,
},
];
export default {
components: { productAttrAdd, SmallTitle },
data() {
return {
visible: false,
addOrUpdateVisible: false,
tableBtn,
tableProps,
productAttributeList: [],
addButtonShow: '新增',
operator: '',
dataForm: {
id: null,
name: '',
palletCode: '',
},
listQuery: {
pageSize: 10,
pageNo: 1,
total: 0,
},
dataRule: {
// palletCode: [
// {
// required: true,
// message: '',
// trigger: 'blur',
// },
// ],
},
};
},
methods: {
initData() {
this.productAttributeList.splice(0);
},
init(val,nickname) {
this.operator = nickname
this.dataForm.id = val.id;
this.dataForm.name = val.name;
this.dataForm.palletCode = val.palletCode;
this.initData();
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
if (this.dataForm.id) {
//
//
this.getList();
}
});
},
getList() {
//
getWarehouseRealtimeLocation(this.dataForm.id).then((response) => {
this.productAttributeList = response.data;
});
},
inputChange(data) {
switch (data.sType) {
case 1:
this.productAttributeList[data._pageIndex - 1][data.prop] =
data[data.prop];
break;
case 2:
this.productAttributeList[data._pageIndex - 1][data.prop] =
data.string ? data.string.split('+')[0] : '';
this.productAttributeList[data._pageIndex - 1][data.prop + 'Name'] =
data.string ? data.string.split('+')[1] : '';
break;
default:
console.log(val);
}
},
handleClick(raw) {
if (raw.type === 'delete') {
this.$confirm(
`确定对${
raw.data.name
? '[名称=' + raw.data.name + ']'
: '[序号=' + raw.data._pageIndex + ']'
}进行删除操作?`,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
this.productAttributeList.splice(raw.data._pageIndex - 1, 1);
})
.catch(() => {});
} else {
this.addNew(raw.data._pageIndex);
}
},
//
dataFormSubmit() {
this.productAttributeList.forEach((item) => {
item.id = '';
});
const data = {
realtimeLocationId : this.dataForm.id,
palletCode : this.dataForm.palletCode,
operator : this.operator,
goodsInfos: this.productAttributeList
}
this.$refs['dataForm'].validate((valid) => {
if (valid) {
//
if (this.dataForm.id) {
inWarehouseRealtimeLocation(data).then((response) => {
this.$modal.msgSuccess('修改成功');
this.visible = false;
this.$emit('refreshDataList');
});
return;
}
}
});
},
// /
addNew(index) {
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(index);
});
},
addList(data) {
this.productAttributeList.push(data.productInfo);
},
goback() {
this.$emit('refreshDataList');
this.visible = false;
this.initData();
},
},
};
</script>
<style scoped>
.drawer >>> .el-drawer {
border-radius: 8px 0 0 8px;
}
.drawer >>> .el-form-item__label {
padding: 0;
}
.drawer >>> .el-form-item {
margin: 0;
}
.drawer >>> .el-drawer__header {
margin: 0;
padding: 32px 32px 24px;
border-bottom: 1px solid #dcdfe6;
margin-bottom: 10px;
}
.drawer >>> .content {
padding: 0 24px 30px;
display: flex;
flex-direction: column;
height: 100%;
}
.drawer >>> .visual-part {
flex: 1 auto;
max-height: 76vh;
overflow: hidden;
overflow-y: scroll;
padding-right: 10px; /* 调整滚动条样式 */
}
.drawer >>> .el-form,
.drawer >>> .attr-list {
padding: 0 16px;
}
</style>

View File

@ -0,0 +1,279 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:isFold="true"
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<!-- 对话框(添加 / 修改) -->
<drawer
v-if="drawerVisible"
ref="drawerRef"
@refreshDataList="getDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
<slot name="footer">
<el-row slot="footer" type="flex" justify="end">
<el-col :span="24">
<el-button size="small" class="btnTextStyle" @click="handleCancel">
取消
</el-button>
</el-col>
</el-row>
</slot>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import Drawer from './drawer';
import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import {
getWarehouseRealtimeLocationPage,
outWarehouseRealtimeLocation,
} from '@/api/warehouse/warehouseRealtimeLocation';
import { listByWarehouse } from '@/api/warehouse/warehouseLocation';
import { listData } from '@/api/system/dict/data';
import { publicFormatter } from '@/utils/dict';
import { mapGetters } from 'vuex';
const tableProps = [
{
prop: 'warehouseName',
label: '仓库名称',
},
{
prop: 'name',
label: '库位名称',
},
{
prop: 'code',
label: '库位编码',
},
{
prop: 'type',
label: '库位类型',
filter: publicFormatter('location_type'),
},
{
prop: 'status',
label: '库位状态',
filter: publicFormatter('AreaDetStatus'),
},
{
prop: 'palletCode',
label: '托盘编码',
},
{
prop: 'inTime',
label: '入库时间',
filter: parseTime,
minWidth: 150,
},
{
prop: 'remark',
label: '备注',
},
];
export default {
mixins: [basicPage],
computed: {
...mapGetters(['nickname']),
},
data() {
return {
urlOptions: {
getDataListURL: getWarehouseRealtimeLocationPage,
outURL: outWarehouseRealtimeLocation,
},
listQuery: {
storageType: 2,
},
tableData: [],
tableProps,
tableBtn: [
this.$auth.hasPermi(`end-material:warehouse-realtime-location:query`)
? {
type: 'info',
btnName: '详情',
}
: undefined,
this.$auth.hasPermi(`end-material:warehouse-realtime-location:query`)
? {
type: 'out',
btnName: '出库',
}
: undefined,
this.$auth.hasPermi(`end-material:warehouse-realtime-location:query`)
? {
type: 'in',
btnName: '入库',
}
: undefined,
].filter((v) => v),
drawerVisible: false,
formConfig: [
{
type: 'select',
label: '库位名',
selectOptions: [],
param: 'name',
defaultSelect: '',
filterable: true,
},
{
type: 'input',
label: '托盘编码',
placeholder: '托盘编码',
param: 'code',
},
{
type: 'select',
label: '库位状态',
selectOptions: [],
param: 'status',
defaultSelect: '',
filterable: true,
labelField: 'label',
valueField: 'value',
},
{
type: 'datePicker',
label: '入库时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: "timestamp",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
],
};
},
components: {
AddOrUpdate,
Drawer,
},
created() {
const queryParams = {
pageNo: 1,
pageSize: 99,
dictType: 'AreaDetStatus',
};
listData(queryParams).then((response) => {
this.formConfig[2].selectOptions = response.data.list;
});
listByWarehouse(this.listQuery.storageType).then((response) => {
this.formConfig[0].selectOptions = response.data;
});
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.locationId = val.name;
this.listQuery.palletCode = val.code;
this.listQuery.status = val.status;
this.listQuery.inTime = val.searchTime?val.searchTime:null;
this.getDataList();
break;
default:
console.log(val);
}
},
otherMethods(val) {
if (val.type === 'out') {
this.$confirm(
`确定对${'[名称=' + val.data.name + ']'}执行出库操作?`,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
const data = {
realtimeLocationId: val.data.id,
operator: this.nickname,
};
this.urlOptions.outURL(data).then(({ data }) => {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList();
},
});
});
})
.catch(() => {});
} else if (val.type === 'in') {
this.drawerVisible = true;
this.$nextTick(() => {
this.$refs.drawerRef.init(val.data, this.nickname);
});
} else if (val.type === 'info') {
this.addOrUpdateVisible = true;
this.addOrEditTitle = val.data.name + ' -产品信息';
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id);
});
}
},
handleCancel() {
this.addOrUpdateVisible = false;
this.addOrEditTitle = '';
},
},
};
</script>
<style>
.app-container .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@ -0,0 +1,121 @@
/*
* @Author: zwq
* @Date: 2022-08-24 11:19:43
* @LastEditors: zwq
* @LastEditTime: 2023-11-02 15:33:39
* @Description:
*/
import { listData } from "@/api/system/dict/data";
export default {
data() {
/* eslint-disable */
return {
urlOptions: {
createURL: '',
updateURL: '',
infoURL: '',
codeURL: '',
getOption: false, //是否加载获取下拉框方法
isGetCode: false, //是否加载获取code方法
getDictList: false, //是否加载获取数据字典方法
optionArrUrl: [], //需要获取下拉框的方法数组
optionArr: {}, //需要获取下拉框的方法数组的返回结果
dictList: {}, //需要获取数据字典的方法数组的返回结果
},
visible: false,
setData: false
}
},
created() {
},
activated() {
},
methods: {
init(id) {
this.dataForm.id = id || "";
this.visible = true;
if (this.urlOptions.getOption) {
this.getArr()
}
if (this.urlOptions.getDictList) {
this.getDict()
}
this.$nextTick(() => {
this.$refs["dataForm"].resetFields();
if (this.dataForm.id) {
this.urlOptions.infoURL(id).then(response => {
this.dataForm = response.data;
if (this.setData) {
this.setDataForm()
}
});
} else {
if (this.urlOptions.isGetCode) {
this.getCode()
}
}
});
},
getCode() {
this.urlOptions.codeURL()
.then(({ data: res }) => {
this.dataForm.code = res;
})
.catch(() => {});
},
getArr() {
const params = {
pageSize: 100,
pageNo: 1,
}
this.urlOptions.optionArrUrl.forEach((item, index) => {
item(params).then(({ data: res }) => {
this.$set(this.urlOptions.optionArr, `arr${index}`, res.list)
})
.catch(() => {
});
});
},
/** 查询字典数据列表 */
getDict() {
this.nameList.forEach((item,index)=>{
const queryParams = {
pageNo: 1,
pageSize: 99,
dictType: item,
}
listData(queryParams).then(response => {
this.$set(this.urlOptions.dictList, `dict${index}`, response.data.list)
});
})
},
// 表单提交
dataFormSubmit() {
this.$refs["dataForm"].validate((valid) => {
if (!valid) {
return false;
}
// 修改的提交
if (this.dataForm.id) {
this.urlOptions.updateURL(this.dataForm).then(response => {
this.$modal.msgSuccess("修改成功");
this.visible = false;
this.$emit("refreshDataList");
});
return;
}
// 添加的提交
this.urlOptions.createURL(this.dataForm).then(response => {
this.$modal.msgSuccess("新增成功");
this.visible = false;
this.$emit("refreshDataList");
});
});
},
formClear() {
if (this.$refs.dataForm!==undefined) {
this.$refs.dataForm.resetFields();
}
}
}
}

View File

@ -0,0 +1,170 @@
/*
* @Author: zwq
* @Date: 2022-08-24 11:19:43
* @LastEditors: zwq
* @LastEditTime: 2023-11-03 16:06:21
* @Description:
*/
export default {
data() {
/* eslint-disable */
return {
urlOptions: {
getDataListURL: '',
deleteURL: '',
statusUrl: '',
exportURL: ''
},
tableData: [],
listQuery: {
pageSize: 10,
pageNo: 1,
total: 1,
},
exportLoading: false,
dataListLoading: false,
addOrEditTitle: '',
addOrUpdateVisible: false,
addOrUpdate:'addOrUpdate'
}
},
created() {
},
mounted() {
this.getDataList()
},
methods: {
// 获取数据列表
getDataList() {
this.dataListLoading = true;
this.urlOptions.getDataListURL(this.listQuery).then(response => {
this.tableData = response.data.list;
this.listQuery.total = response.data.total;
this.dataListLoading = false;
});
},
// 每页数
sizeChangeHandle(val) {
this.listQuery.pageSize = val;
this.listQuery.pageNo = 1;
this.getDataList();
},
// 当前页
currentChangeHandle(val) {
this.listQuery.pageNo = val;
this.getDataList();
},
// 新增 / 修改
addOrUpdateHandle(id) {
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id);
});
},
cancel(id) {
this.$refs["popover-" + id].showPopper = false;
},
//改变状态
changeStatus(id) {
this.$http
.post(this.urlOptions.statusUrl, { id })
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.$refs["popover-" + id].showPopper = false;
this.$message({
message: this.$t("prompt.success"),
type: "success",
duration: 500,
onClose: () => {
this.getDataList();
},
});
})
.catch(() => { });
},
//tableBtn点击
handleClick(val) {
if (val.type === "edit") {
this.addOrUpdateVisible = true;
this.addOrEditTitle = "编辑";
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id);
});
} else if (val.type === "delete") {
this.deleteHandle(val.data.id, val.data.name, val.data._pageIndex)
} else if (val.type === "change") {
this.changeStatus(val.data.id)
} else {
this.otherMethods(val)
}
},
// 删除
deleteHandle(id, name, index) {
this.$confirm(`确定对${name ? '[名称=' + name + ']' : '[序号=' + index + ']'}进行删除操作?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.urlOptions.deleteURL(id).then(({ data }) => {
this.$message({
message: "操作成功",
type: "success",
duration: 1500,
onClose: () => {
this.getDataList();
},
});
});
})
.catch(() => { });
},
//search-bar点击
buttonClick(val) {
switch (val.btnName) {
case "search":
this.listQuery.xm1 = val.xm1;
this.listQuery.xm2 = val.xm2;
this.listQuery.pageNo = 1;
this.getDataList();
break;
case "add":
this.addOrEditTitle = '新增'
this.addOrUpdateVisible = true;
this.addOrUpdateHandle()
break;
default:
console.log(val)
}
},
handleCancel() {
this.$refs[this.addOrUpdate].formClear()
this.addOrUpdateVisible = false
this.addOrEditTitle = ''
this.addOrUpdate = 'addOrUpdate'
},
handleConfirm() {
this.$refs[this.addOrUpdate].dataFormSubmit()
},
successSubmit() {
this.handleCancel()
this.getDataList()
},
/** 导出按钮操作 */
handleExport() {
// 处理查询参数
let params = { ...this.queryParams };
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal.confirm('是否确认导出所有数据项?').then(() => {
this.exportLoading = true;
return this.urlOptions.exportURL(params);
}).then(response => {
this.$download.excel(response, '报表.xls');
this.exportLoading = false;
}).catch(() => { });
}
}
}

View File

@ -0,0 +1,73 @@
/*
* @Date: 2020-12-29 16:49:28
* @LastEditors: zwq
* @LastEditTime: 2023-10-24 16:30:25
* @FilePath: \basic-admin\src\filters\basicData\index.js
* @Description:
*/
const table = {
lineStatus: {
1: '生产中',
2: '停止',
3: '未知',
},
deactivate: {
1: '启用',
0: '停用',
},
wareType: {
1: '缓存',
2: '活动',
3: '其它',
},
}
// 日期格式化
export function parseTime(time, pattern) {
if (arguments.length === 0 || !time) {
return null
}
const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}'
let date
if (typeof time === 'object') {
date = time
} else {
if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
time = parseInt(time)
} else if (typeof time === 'string') {
time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.\d{3}/gm),'');
}
if ((typeof time === 'number') && (time.toString().length === 10)) {
time = time * 1000
}
date = new Date(time)
}
const formatObj = {
y: date.getFullYear(),
m: date.getMonth() + 1,
d: date.getDate(),
h: date.getHours(),
i: date.getMinutes(),
s: date.getSeconds(),
a: date.getDay()
}
const time_str = format.replace(/{([ymdhisa])+}/g, (result, key) => {
let value = formatObj[key]
// Note: getDay() returns 0 on Sunday
if (key === 'a') {
return ['日', '一', '二', '三', '四', '五', '六'][value]
}
if (result.length > 0 && value < 10) {
value = '0' + value
}
return value || 0
})
return time_str
}
export default function (dictTable) {
return function (val) {
return table?.[dictTable]?.[val]
}
}

View File

@ -0,0 +1,46 @@
<!--
* @Author: zwq
* @Date: 2023-09-22 15:36:40
* @LastEditors: zwq
* @LastEditTime: 2023-09-26 15:59:57
* @Description:
-->
<template>
<div class="tableInner">
<el-input v-model="list[itemProp]" @blur="changeInput" />
</div>
</template>
<script>
export default {
name: "InputArea",
props: {
injectData: {
type: Object,
default: () => ({}),
},
itemProp: {
type: String,
},
},
data() {
return {
list: this.injectData,
};
},
methods: {
changeInput() {
this.list.sType = 1
this.$emit("emitData", this.list,1);
},
},
};
</script>
<style scoped>
.tableInner >>> .el-input__inner {
color: #409EFF;
border: 1px rgb(232, 231, 231) solid;
padding: 0;
text-align: center;
height: 30px;
}
</style>

View File

@ -0,0 +1,59 @@
<template>
<div class="tableInner">
<el-select v-model="list[itemProp]" @change="changeInput">
<el-option
v-for="item in QArr"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</div>
</template>
<script>
export default {
name: 'InputArea',
props: {
injectData: {
type: Object,
default: () => ({}),
},
itemProp: {
type: String,
},
},
data() {
return {
list: this.injectData,
QArr: [
{
name: 'A',
id: 0,
},
{
name: 'B',
id: 1,
},
{
name: 'C',
id: 2,
},
],
};
},
methods: {
changeInput() {
this.list.sType = 1;
this.$emit('emitData', this.list);
},
},
};
</script>
<style scoped>
.tableInner >>> .el-input__inner {
color: #409EFF;
border: 1px rgb(232, 231, 231) solid;
padding: 0;
text-align: center;
height: 30px;
}
</style>

View File

@ -0,0 +1,96 @@
<!--
* @Author: zwq
* @Date: 2023-08-22 15:01:54
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 16:11:36
* @Description:
-->
<template>
<el-row :gutter="10" class="chart-container">
<el-col :span="14">
<div class="chart-card">
<barChart
ref="barChart"
height="500px"
title="库存总览"
v-if="overviewList.length"
:histogram="overviewList" />
<!-- 没有数据 -->
<div class="no-data-bg" v-else></div>
</div>
</el-col>
<el-col :span="10">
<div class="chart-card">
<pieChart
ref="pieChart"
height="600px"
v-if="rateList.length"
:pie-data="rateList" />
<!-- 没有数据 -->
<div class="no-data-bg" v-else></div>
</div>
</el-col>
</el-row>
</template>
<script>
import barChart from '../../chart/BarChart.vue';
import pieChart from '../../chart/PieChart.vue';
import {
getOverview,
getRate,
} from '@/api/warehouse/warehouseLocation';
export default {
data() {
return {
urlOptions: {
allURL: getOverview,
rateURL: getRate
},
overviewList: [],
rateList: []
};
},
components: {
barChart,
pieChart
},
mounted() {
this.getDataList();
},
methods: {
//
getDataList() {
const data = {
storageType : 5
}
this.urlOptions.allURL(data).then((response) => {
this.overviewList = response.data;
this.$nextTick(() => {
this.$refs.barChart.initChart();
});
});
this.urlOptions.rateURL(data).then((response) => {
this.rateList = response.data;
this.$nextTick(() => {
this.$refs.pieChart.initChart();
});
});
},
},
};
</script>
<style scoped>
.chart-container {
min-height: calc(100vh - 120px - 8px);
background-color: #f0f2f7;
}
.chart-card {
min-height: calc(100vh - 120px - 8px);
background-color: #fff;
padding: 16px;
border-radius: 8px;
}
</style>

View File

@ -0,0 +1,156 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 13:52:10
* @LastEditors: zwq
* @LastEditTime: 2023-11-03 14:56:25
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
v-if="visible"
@keyup.enter.native="dataFormSubmit()"
label-width="100px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="名称" prop="name">
<el-input
v-model="dataForm.name"
clearable
placeholder="请输入名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="编码" prop="code">
<el-input
v-model="dataForm.code"
clearable
placeholder="请输入编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="规格" prop="spec">
<el-input
v-model="dataForm.spec"
clearable
placeholder="请输入规格" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单位" prop="unit">
<el-select
v-model="dataForm.unit"
filterable
clearable
:style="{ width: '100%' }"
placeholder="请选择单位">
<el-option
v-for="item in urlOptions.dictList.dict0"
:key="item.id"
:label="item.label"
:value="parseInt(item.value)"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单日消耗量" prop="dailyUse">
<el-input-number
v-model="dataForm.dailyUse"
clearable
placeholder="请输入单日消耗量" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="允许留存时间" prop="allowTime">
<el-input-number
v-model="dataForm.allowTime"
clearable
placeholder="请输入允许留存时间" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="enabled" label="是否可用">
<el-select
v-model="dataForm.enabled"
filterable
clearable
:style="{ width: '100%' }"
placeholder="请选择是否可用">
<el-option
v-for="item in isorno"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input
v-model="dataForm.remark"
clearable
placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import basicAdd from '../../mixins/basic-add';
import {
createWarehouseGoods,
updateWarehouseGoods,
getWarehouseGoods,
getCode,
} from '@/api/warehouse/warehouseGoods';
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
isGetCode: true,
getDictList: true,
codeURL: getCode,
createURL: createWarehouseGoods,
updateURL: updateWarehouseGoods,
infoURL: getWarehouseGoods,
},
nameList: ['unit_dict'],
dataForm: {
id: undefined,
code: '',
name: '',
spec: '',
unit: '',
dailyUse: 0,
allowTime: 0,
enabled: 1,
remark: '',
},
dataRule: {
code: [
{ required: true, message: '库位编码不能为空', trigger: 'blur' },
],
name: [
{ required: true, message: '库位名称不能为空', trigger: 'blur' },
],
},
isorno: [
{
id: 0,
name: '不可用',
},
{
id: 1,
name: '可用',
},
],
};
},
methods: {},
};
</script>

View File

@ -0,0 +1,183 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="80"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<!-- 对话框(添加 / 修改) -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import codeFilter from '../../mixins/code-filter';
import {
deleteWarehouseGoods,
getWarehouseGoodsPage,
} from "@/api/warehouse/warehouseGoods";
import { publicFormatter } from '@/utils/dict';
const tableProps = [
{
prop: 'name',
label: '名称',
},
{
prop: 'code',
label: '编码',
},
{
prop: 'spec',
label: '规格',
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('unit_dict')
},
{
prop: 'allowTime',
label: '允许留存时长(天)',
},
{
prop: 'dailyUse',
label: '单日消耗量',
},
{
prop: 'enabled',
label: '是否可用',
filter: codeFilter('deactivate'),
},
{
prop: 'remark',
label: '备注',
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseGoodsPage,
deleteURL: deleteWarehouseGoods,
},
tableProps,
listQuery:{
storageType:5
},
tableBtn: [
this.$auth.hasPermi(`out-material:warehouse-goods:update`)
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi(`out-material:warehouse-goods:delete`)
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v)=>v),
tableData: [],
formConfig: [
{
type: 'input',
label: '名称',
placeholder: '名称',
param: 'name',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('out-material:warehouse-goods:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true,
},
],
};
},
components: {
AddOrUpdate,
},
created() {},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.name = val.name;
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true;
this.addOrUpdateHandle();
break;
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
},
};
</script>

View File

@ -0,0 +1,192 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:isFold="true"
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
label="库位详情"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
</div>
</template>
<script>
import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import {
getWarehouseRealtimeHisPage,
} from '@/api/warehouse/warehouseRealtime';
import { getListByType } from '@/api/warehouse/warehouseGoods';
import { listData } from '@/api/system/dict/data';
import { publicFormatter } from '@/utils/dict';
const tableProps = [
{
prop: 'warehouseName',
label: '仓库名称',
},
{
prop: 'name',
label: '物品名称',
},
{
prop: 'code',
label: '物品编码',
},
{
prop: 'spec',
label: '物品规格',
},
{
prop: 'num',
label: '出入库数量',
},
{
prop: 'goodsBatch',
label: '物品批次',
},
{
prop: 'operateStatus',
label: '操作状态',
filter: publicFormatter('warehouse_operate_status'),
},
{
prop: 'operateTime',
label: '操作时间',
filter: parseTime,
minWidth: 150,
},
{
prop: 'operator',
label: '操作人',
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseRealtimeHisPage,
},
listQuery: {
storageType: 5,
},
tableData: [],
tableProps,
tableBtn: [
this.$auth.hasPermi(`out-material:warehouse-realtime-location-his:query`)
? {
type: 'info',
btnName: '详情',
}
: undefined,
].filter((v) => v),
drawerVisible: false,
formConfig: [
{
type: 'select',
label: '物品名称',
selectOptions: [],
param: 'goodsId',
defaultSelect: '',
filterable: true,
},
{
type: 'input',
label: '操作人',
placeholder: '操作人',
param: 'operator',
},
{
type: 'select',
label: '操作状态',
selectOptions: [],
param: 'status',
defaultSelect: '',
filterable: true,
labelField: 'label',
valueField: 'value',
},
{
type: 'datePicker',
label: '操作时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: "timestamp",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
],
};
},
components: {
},
created() {
const queryParams = {
pageNo: 1,
pageSize: 99,
dictType: 'warehouse_operate_status',
};
listData(queryParams).then((response) => {
this.formConfig[2].selectOptions = response.data.list;
});
getListByType(this.listQuery.storageType).then((response) => {
this.formConfig[0].selectOptions = response.data;
});
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.goodsId = val.goodsId;
this.listQuery.operator = val.operator;
this.listQuery.operateStatus = val.status;
this.listQuery.operateTime = val.searchTime?val.searchTime:null;
this.getDataList();
break;
default:
console.log(val);
}
},
},
};
</script>
<style>
.app-container .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@ -0,0 +1,82 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2023-11-03 16:20:19
* @Description:
-->
<template>
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:height="300"
:table-data="tableData" />
</template>
<script>
import { parseTime } from '../../mixins/code-filter';
import { getWarehouseLocationHisDet } from '@/api/warehouse/warehouseRealtimeLocation';
const tableProps = [
{
prop: 'name',
label: '物品名称',
align: 'center',
},
{
prop: 'code',
label: '物品编码',
align: 'center',
},
{
prop: 'spec',
label: '物品规格',
align: 'center',
},
{
prop: 'batchCode',
label: '物品批次',
align: 'center',
},
{
prop: 'num',
label: '数量',
align: 'center',
},
{
prop: 'allowTime',
label: '允许留存时长(天)',
align: 'center',
},
{
prop: 'remark',
label: '备注',
align: 'center',
},
];
export default {
data() {
return {
tableData: [],
tableProps,
listQuery: {
pageSize: 100,
pageNo: 1,
total: 1,
},
dataListLoading: false,
};
},
methods: {
//
init(id) {
this.dataListLoading = true;
getWarehouseLocationHisDet(id).then((response) => {
this.tableData = response.data;
this.dataListLoading = false;
});
},
},
};
</script>

View File

@ -0,0 +1,223 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:isFold="true"
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
label="库位详情"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<!-- 对话框(添加 / 修改) -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
<slot name="footer">
<el-row slot="footer" type="flex" justify="end">
<el-col :span="24">
<el-button size="small" class="btnTextStyle" @click="handleCancel">
取消
</el-button>
</el-col>
</el-row>
</slot>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import {
getWarehouseLocationHisPage,
} from '@/api/warehouse/warehouseRealtimeLocation';
import { listByWarehouse } from '@/api/warehouse/warehouseLocation';
import { listData } from '@/api/system/dict/data';
import { publicFormatter } from '@/utils/dict';
const tableProps = [
{
prop: 'warehouseName',
label: '仓库名称',
},
{
prop: 'name',
label: '库位名称',
},
{
prop: 'code',
label: '库位编码',
},
{
prop: 'type',
label: '库位类型',
filter: publicFormatter('location_type'),
},
{
prop: 'palletCode',
label: '托盘编码',
},
{
prop: 'operateStatus',
label: '操作状态',
filter: publicFormatter('warehouse_operate_status'),
},
{
prop: 'createTime',
label: '操作时间',
filter: parseTime,
minWidth: 150,
},
{
prop: 'creator',
label: '操作人',
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseLocationHisPage,
},
listQuery: {
storageType: 5,
},
tableData: [],
tableProps,
tableBtn: [
this.$auth.hasPermi(`out-material:warehouse-realtime-location-his:query`)
? {
type: 'info',
btnName: '详情',
}
: undefined,
].filter((v) => v),
drawerVisible: false,
formConfig: [
{
type: 'select',
label: '库位名',
selectOptions: [],
param: 'name',
defaultSelect: '',
filterable: true,
},
{
type: 'input',
label: '托盘编码',
placeholder: '托盘编码',
param: 'code',
},
{
type: 'select',
label: '操作状态',
selectOptions: [],
param: 'status',
defaultSelect: '',
filterable: true,
labelField: 'label',
valueField: 'value',
},
{
type: 'datePicker',
label: '操作时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: "timestamp",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
],
};
},
components: {
AddOrUpdate,
},
created() {
const queryParams = {
pageNo: 1,
pageSize: 99,
dictType: 'warehouse_operate_status',
};
listData(queryParams).then((response) => {
this.formConfig[2].selectOptions = response.data.list;
});
listByWarehouse(this.listQuery.storageType).then((response) => {
this.formConfig[0].selectOptions = response.data;
});
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.locationId = val.name;
this.listQuery.palletCode = val.code;
this.listQuery.operateStatus = val.status;
this.listQuery.createTime = val.searchTime?val.searchTime:null;
this.getDataList();
break;
default:
console.log(val);
}
},
otherMethods(val) {
if (val.type === 'info') {
this.addOrUpdateVisible = true;
this.addOrEditTitle = val.data.name + ' -产品信息';
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id);
});
}
},
handleCancel() {
this.addOrUpdateVisible = false;
this.addOrEditTitle = '';
},
},
};
</script>
<style>
.app-container .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@ -0,0 +1,221 @@
<!--
* @Author: zwq
* @Date: 2023-08-21 14:26:23
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 14:46:59
* @Description:
-->
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<div class="tips">
<el-tag effect="dark" color="#7362F3" style="border: none">缓存</el-tag>
<el-tag effect="dark" color="#16DC09" style="border: none">活动</el-tag>
<el-tag effect="dark" color="#FFA08F" style="border: none">其它</el-tag>
</div>
<div class="mainbody">
<div v-for="i in total" :key="i">
<el-row>
<el-col :span="24">
<el-row type="flex" class="flex-warp">
<div
class="dashboard-layout-item"
v-for="a in wareData.one.slice((i - 1) * 10, i * 10)"
:key="a.id + a.code"
:title="a.name"
style="background: #fff8e8; float: left">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[a.type - 1],
}" />
<p class="p-name">{{ a.name }}</p>
</div>
</el-row>
<el-row type="flex" class="flex-warp">
<div
class="dashboard-layout-item"
v-for="b in wareData.two.slice((i - 1) * 10, i * 10)"
:key="b.id + b.code"
:title="b.name"
style="background: #fff8e8; float: left">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[b.type - 1],
}" />
<p class="p-name">{{ b.name }}</p>
</div>
</el-row>
</el-col>
</el-row>
<el-divider class="divider"></el-divider>
<el-row>
<el-col :span="24">
<el-row type="flex" class="flex-warp">
<div
class="dashboard-layout-item"
v-for="c in wareData.there.slice((i - 1) * 10, i * 10)"
:key="c.id + c.code"
:title="c.name"
style="background: #fff8e8; float: left">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[c.type - 1],
}" />
<p class="p-name">{{ c.name }}</p>
</div>
</el-row>
<el-row type="flex" class="flex-warp">
<div
class="dashboard-layout-item"
v-for="d in wareData.four.slice((i - 1) * 10, i * 10)"
:key="d.id + d.code"
:title="d.name"
style="background: #fff8e8; float: left">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[d.type - 1],
}" />
<p class="p-name">{{ d.name }}</p>
</div>
</el-row>
</el-col>
</el-row>
</div>
</div>
</div>
</template>
<script>
import { listByWarehouse, listAll } from '@/api/warehouse/warehouseLocation';
export default {
data() {
return {
wareData: {
one: [],
two: [],
there: [],
four: [],
},
total: 0,
bgColor: ['#7362F3', '#16DC09', '#FFA08F'],
formConfig: [
{
type: 'button',
btnName: '刷新',
name: 'search',
color: 'primary',
},
],
};
},
components: {},
mounted() {
this.getDataList();
},
methods: {
//
getDataList() {
(this.wareData = {
one: [],
two: [],
there: [],
four: [],
}),
listAll(1).then((response) => {
response.data.forEach((a, b) => {
if (b % 4 === 0) {
this.wareData.one.push(a);
} else if (b % 4 === 1) {
this.wareData.two.push(a);
} else if (b % 4 === 2) {
this.wareData.there.push(a);
} else if (b % 4 === 3) {
this.wareData.four.push(a);
}
});
this.total = Math.ceil(response.data.length / 40);
});
},
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.getDataList();
break;
default:
console.log(val);
}
},
},
};
</script>
<style lang="scss" scoped>
.mainbody {
display: flex;
gap: 70px;
flex-direction: column;
}
.flex-warp {
flex-wrap: nowrap;
}
.dashboard-layout-item {
width: 100px;
text-align: center;
height: 32px;
box-shadow: 0px 3px 6px 0px rgba(166, 174, 190, 0.8);
border-radius: 2px 4px 4px 2px;
margin: 0 3px 8px 0;
display: flex;
align-items: center;
justify-content: center;
position: relative;
.dashboard-layout-item-cricle {
display: inline-block;
width: 12px;
height: 12px;
border-radius: 6px;
position: absolute;
top: 10px;
left: 3px;
}
.p-name {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
margin-left: 15px;
}
&:hover {
cursor: pointer;
z-index: 10;
transform: scale(1.3) translateZ(0);
}
&:nth-child(2n) {
margin-right: 30px;
}
&:first-child {
margin-left: 50px;
}
&:last-child {
margin-right: 30px;
}
}
.el-divider--horizontal {
margin: 10px 0;
}
.el-divider {
background-color: black;
}
.tips {
position: absolute;
top: 22px;
right: 120px;
}
</style>

View File

@ -0,0 +1,202 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 13:52:10
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 16:24:41
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
v-if="visible"
@keyup.enter.native="dataFormSubmit()"
label-width="100px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="仓库名称" prop="warehouseName">
<el-input
v-model="dataForm.warehouseName"
readonly
placeholder="请输入仓库名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物品名称" prop="goodsId">
<el-select
v-model="dataForm.goodsId"
filterable
clearable
:disabled="dataForm.id ? true : false"
:style="{ width: '100%' }"
@change="setGoodInfo"
placeholder="请选择物品名称">
<el-option
v-for="item in goodsArr"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物品编码" prop="code">
<el-input
v-model="dataForm.code"
readonly
placeholder="请输入物品编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物品规格" prop="spec">
<el-input
v-model="dataForm.spec"
readonly
placeholder="请输入物品规格" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物品批次" prop="goodsBatch">
<el-input
v-if="!dataForm.id ? true : false"
v-model="dataForm.goodsBatch"
clearable
placeholder="请输入物品批次" />
<el-select
v-else
v-model="dataForm.goodsBatch"
filterable
clearable
@change="setBatchInfo"
placeholder="请选择物品名称">
<el-option
v-for="(item, index) in Batch"
:key="index"
:label="item.goodsBatch"
:value="item.goodsBatch"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="入库数量" prop="numDet">
<el-input-number
v-model="dataForm.numDet"
clearable
:min="0"
:max="max?max:9999999"
placeholder="请输入入库数量" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import basicAdd from '../../mixins/basic-add';
import {
createWarehouseRealtime,
outWarehouseRealtime,
getWarehouseRealtime,
getWarehouseRealtimeDet,
} from '@/api/warehouse/warehouseRealtime';
import { getListByType } from '@/api/warehouse/warehouseGoods';
import { getWarehouseList } from '@/api/warehouse/warehouse-info';
import { mapGetters } from 'vuex';
export default {
mixins: [basicAdd],
computed: {
...mapGetters(['nickname']),
},
data() {
return {
urlOptions: {
getOption: true,
createURL: createWarehouseRealtime,
updateURL: outWarehouseRealtime,
infoURL: getWarehouseRealtime,
},
dataForm: {
id: undefined,
warehouseName: '',
warehouseId: '',
goodsId: '',
code: '',
spec: '',
goodsBatch: '',
numDet: '',
operator: '',
},
goodsArr: [],
Batch: [],
max: 0,
dataRule: {
goodsId: [
{ required: true, message: '物品名称不能为空', trigger: 'change' },
],
goodsBatch: [
{
required: true,
message: '物品批次不能为空,若无请填写无',
trigger: 'blur',
},
],
numDet: [
{ required: true, message: '入库数量不能为空', trigger: 'blur' },
],
},
};
},
created() {},
methods: {
getArr() {
this.dataForm.operator = this.nickname
getListByType(5).then((response) => {
this.goodsArr = response.data;
});
getWarehouseList().then((response) => {
response.data.forEach((item) => {
if (item.storageType === 5) {
this.dataForm.warehouseName = item.name;
this.dataForm.warehouseId = item.id;
}
});
});
},
setGoodInfo() {
this.goodsArr.forEach((item) => {
if (item.id === this.dataForm.goodsId) {
this.dataForm.code = item.code;
this.dataForm.spec = item.spec;
}
});
},
setBatchInfo(){
this.Batch.forEach((item) => {
if (item.goodsBatch === this.dataForm.goodsBatch) {
this.max = item.numDet
}
});
},
outWare(data) {
this.getArr();
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
this.dataForm.realTimeId = data.id;
this.dataForm.id = data.id;
this.dataForm.goodsId = data.goodsId;
this.dataForm.code = data.code;
this.dataForm.spec = data.spec;
getWarehouseRealtimeDet(data.id).then((res) => {
this.Batch = res.data;
});
// this.urlOptions.infoURL(data.id).then((response) => {
// this.dataForm = response.data;
// });
});
},
},
};
</script>

View File

@ -0,0 +1,193 @@
<!--
* @Author: zwq
* @Date: 2023-11-03 16:37:06
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 16:14:09
* @Description:
-->
<template>
<div class="app-container">
<search-bar
:isFold="true"
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<el-table
:data="tableData"
:header-cell-style="{
background: '#F2F4F9',
color: '#606266',
}"
border
v-loading="dataListLoading"
style="width: 100%"
ref="dataList">
<el-table-column type="expand">
<template slot-scope="scope">
<product :warehouse-id="scope.row.id"></product>
</template>
</el-table-column>
<el-table-column prop="warehouseName" label="仓库名称" />
<el-table-column prop="name" label="物品名称" />
<el-table-column prop="code" label="物品编码" />
<el-table-column prop="spec" label="物品规格" />
<el-table-column prop="num" label="数量" />
<el-table-column prop="operator" label="操作人" />
<el-table-column prop="latestInTime" label="最新入库时间">
<template v-slot="scope">
<span>{{ parseTime(scope.row.latestInTime) }}</span>
</template>
</el-table-column>
<el-table-column prop="latestOutTime" label="最新出库时间">
<template v-slot="scope">
<span>{{ parseTime(scope.row.latestOutTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" width="100">
<template v-slot="scope">
<el-button
size="mini"
type="text"
@click="handleClick({ data: scope.row, type: 'out' })"
v-hasPermi="['out-material:warehouse-realtime:update']">
出库
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<!-- 对话框(添加 / 修改) -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog>
</div>
</template>
<script>
import product from './product-mini';
import basicPage from '../../mixins/basic-page';
import { getListByType } from '@/api/warehouse/warehouseGoods';
import AddOrUpdate from './add-or-updata';
import { getWarehouseRealtimePage } from '@/api/warehouse/warehouseRealtime';
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseRealtimePage,
},
tableData: [],
listQuery: {
storageType: 5,
},
formConfig: [
{
type: 'select',
label: '物品名称',
selectOptions: [],
param: 'goodsId',
defaultSelect: '',
filterable: true,
},
{
type: 'input',
label: '操作人',
placeholder: '操作人',
param: 'operator',
},
{
type: 'datePicker',
label: '最新入库时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'timestamp',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'datePicker',
label: '最新出库时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'timestamp',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime1',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
{
type: this.$auth.hasPermi('out-material:warehouse-realtime:create') ? 'button' : '',
btnName: '入库',
name: 'add',
color: 'success',
plain: true,
},
],
};
},
components: {
product,
AddOrUpdate,
},
created() {
getListByType(this.listQuery.storageType).then((response) => {
this.formConfig[0].selectOptions = response.data;
});
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.goodsId = val.goodsId;
this.listQuery.operator = val.operator;
this.listQuery.latestInTime = val.searchTime?val.searchTime:null;
this.listQuery.latestOutTime = val.searchTime1?val.searchTime1:null;
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '入库';
this.addOrUpdateVisible = true;
this.addOrUpdateHandle();
break;
default:
console.log(val);
}
},
otherMethods(val){
this.addOrUpdateVisible = true;
this.addOrEditTitle = "出库";
this.$nextTick(() => {
this.$refs.addOrUpdate.outWare(val.data);
});
}
},
};
</script>
<style>
.app-container .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@ -0,0 +1,71 @@
<!--
* @Author: zwq
* @Date: 2023-08-24 14:47:58
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 10:31:56
* @Description:
-->
<template>
<div>
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
max-height="200"
:table-data="tableData" />
</div>
</template>
<script>
import { parseTime } from '../../mixins/code-filter';
import { getWarehouseRealtimeDet } from '@/api/warehouse/warehouseRealtime';
const tableProps = [
{
prop: 'goodsBatch',
label: '产品批次',
},
{
prop: 'numDet',
label: '批次数量',
},
{
prop: 'createTime',
label: '入库时间',
filter: parseTime,
},
];
export default {
props: {
warehouseId: {
type: String,
default: '',
},
},
data() {
return {
urlOptions: {
getDataListURL: getWarehouseRealtimeDet
},
tableProps,
tableData: [],
dataListLoading: false,
};
},
components: {
},
created() {},
mounted() {
this.getDataList()
},
methods: {
//
getDataList() {
this.dataListLoading = true;
this.urlOptions.getDataListURL(this.warehouseId).then(response => {
this.tableData = response.data;
this.dataListLoading = false;
});
},
},
};
</script>

View File

@ -0,0 +1,65 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 15:27:31
* @LastEditors: zwq
* @LastEditTime: 2023-08-01 16:25:54
* @Description:
-->
<template>
<div :class="[className, { 'p-0': noPadding }]">
<slot />
</div>
</template>
<script>
export default {
props: {
size: {
// : xl lg md sm
type: String,
default: 'de',
validator: function (val) {
return ['xl', 'lg', 'de', 'md', 'sm'].indexOf(val) !== -1;
},
},
noPadding: {
type: Boolean,
default: false,
},
},
computed: {
className: function () {
return `${this.size}-title`;
},
},
};
</script>
<style lang="scss" scoped>
$pxls: (xl, 28px) (lg, 24px) (de, 20px) (md, 18px) (sm, 16px);
$mgr: 8px;
@each $size, $height in $pxls {
.#{$size}-title {
font-size: 18px;
line-height: $height;
color: #000;
font-weight: 500;
font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif;
&::before {
content: '';
display: inline-block;
vertical-align: top;
width: 4px;
height: $height + 2px;
border-radius: 1px;
margin-right: $mgr;
background-color: #0b58ff;
}
}
}
.p-0 {
padding: 0;
}
</style>

View File

@ -0,0 +1,93 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2023-11-03 14:51:33
* @Description:
-->
<template>
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:height="300"
:table-data="tableData" />
</template>
<script>
import { parseTime } from '../../mixins/code-filter';
import { getWarehouseRealtimeLocation } from '@/api/warehouse/warehouseRealtimeLocation';
const tableProps = [
{
prop: 'name',
label: '物品名称',
align: 'center',
},
{
prop: 'code',
label: '物品编码',
align: 'center',
},
{
prop: 'spec',
label: '物品规格',
align: 'center',
},
{
prop: 'goodsBatch',
label: '物品批次',
align: 'center',
},
{
prop: 'num',
label: '数量',
align: 'center',
},
{
prop: 'allowTime',
label: '允许留存时长(天)',
align: 'center',
},
{
prop: 'inTime',
label: '入库时间',
align: 'center',
filter: parseTime,
},
{
prop: 'leftTime',
label: '剩余留存时长(天)',
align: 'center',
},
{
prop: 'remark',
label: '备注',
align: 'center',
},
];
export default {
data() {
return {
tableData: [],
tableProps,
listQuery: {
pageSize: 100,
pageNo: 1,
total: 1,
},
dataListLoading: false,
};
},
methods: {
//
init(id) {
this.dataListLoading = true;
getWarehouseRealtimeLocation(id).then((response) => {
this.tableData = response.data;
this.dataListLoading = false;
});
},
},
};
</script>

View File

@ -0,0 +1,122 @@
<template>
<el-dialog
:visible.sync="visible"
:width="'35%'"
:append-to-body="true"
:close-on-click-modal="false"
class="dialog">
<template #title>
<slot name="title">
<div class="titleStyle">
新增产品
</div>
</slot>
</template>
<el-form
ref="dataForm"
:model="dataForm"
:rules="dataRule"
label-width="100px"
@keyup.enter.native="dataFormSubmit()">
<el-form-item label="产品" prop="productInfo">
<el-select
v-model="dataForm.productInfo"
style="width: 100%"
filterable
value-key="id"
placeholder="请选择产品">
<el-option
v-for="item in productArr"
:key="item.id"
:label="item.name"
:value="item" />
</el-select>
</el-form-item>
</el-form>
<el-row style="text-align: right">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</el-row>
</el-dialog>
</template>
<script>
import {
getListByType
} from "@/api/warehouse/warehouseGoods";
export default {
data() {
return {
visible: false,
dataForm: {
index: -1,
productInfo: '',
},
productArr: [],
dataRule: {
productId: [{ required: true, message: '产品不能为空', trigger: 'blur' }],
},
};
},
methods: {
init(index) {
if (index >= 0) {
this.dataForm.index = index;
}
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
getListByType(5).then((response) => {
this.productArr = response.data;
});
});
},
//
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.dataForm.productInfo.goodsId = this.dataForm.productInfo.id
this.dataForm.productInfo.remark = ''
//
if (this.dataForm.index >= 0) {
this.visible = false;
this.$emit('refreshDataList', this.dataForm);
return;
}
//
this.visible = false;
this.$emit('refreshDataList', this.dataForm);
}
});
},
},
};
</script>
<style scoped>
.dialog >>> .el-dialog__body {
padding: 30px 24px;
}
.dialog >>> .el-dialog__header {
font-size: 16px;
color: rgba(0, 0, 0, 0.85);
font-weight: 500;
padding: 13px 24px;
border-bottom: 1px solid #e9e9e9;
}
.dialog >>> .el-dialog__header .titleStyle::before {
content: '';
display: inline-block;
width: 4px;
height: 16px;
background-color: #0b58ff;
border-radius: 1px;
margin-right: 8px;
position: relative;
top: 2px;
}
</style>

View File

@ -0,0 +1,317 @@
<template>
<el-drawer
:visible.sync="visible"
:show-close="false"
:destroy-on-close="true"
:wrapper-closable="false"
class="drawer"
size="60%">
<small-title slot="title" :no-padding="true">库位信息</small-title>
<div class="content">
<div class="visual-part">
<el-form
ref="dataForm"
:model="dataForm"
:rules="dataRule"
label-width="100px"
label-position="top"
@keyup.enter.native="dataFormSubmit">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="库位名称" prop="name">
<el-input
v-model="dataForm.name"
disabled />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="托盘编码" prop="palletCode">
<el-input
v-model="dataForm.palletCode"
@input="$forceUpdate()"
placeholder="请输入托盘编码" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<small-title
style="margin: 16px 0; padding-left: 8px"
:no-padding="true">
产品信息
<!-- <el-alert
title="产品信息新增和修改后,需点击最下方保存按钮确定修改"
type="warning"
show-icon></el-alert> -->
</small-title>
<div class="attr-list">
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:add-button-show="addButtonShow"
@emitButtonClick="addNew"
@emitFun="inputChange"
:height="400"
:table-data="productAttributeList">
<method-btn
slot="handleBtn"
:width="70"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
</div>
</div>
</div>
<div style="position: absolute; bottom: 24px; right: 24px">
<el-button style="margin-right: 10px" @click="goback()">返回</el-button>
<span>
<el-button type="primary" @click="dataFormSubmit()">入库</el-button>
</span>
</div>
<product-attr-add
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="addList" />
</el-drawer>
</template>
<script>
import productAttrAdd from './attr-add';
import inputArea from '../../mixins/inputArea';
import SmallTitle from './SmallTitle';
import { inWarehouseRealtimeLocation,
getWarehouseRealtimeLocation } from '@/api/warehouse/warehouseRealtimeLocation';
const tableBtn = [
{
type: 'delete',
btnName: '删除',
},
];
const tableProps = [
{
prop: 'name',
label: '物品名称',
align: 'center',
},
{
prop: 'code',
label: '物品编码',
align: 'center',
},
{
prop: 'spec',
label: '物品规格',
align: 'center',
},
{
prop: 'goodsBatch',
label: '物品批次',
align: 'center',
subcomponent: inputArea,
width: 100,
},
{
prop: 'num',
label: '数量',
align: 'center',
subcomponent: inputArea,
width: 100,
},
{
prop: 'remark',
label: '备注',
align: 'center',
subcomponent: inputArea,
width: 100,
},
];
export default {
components: { productAttrAdd, SmallTitle },
data() {
return {
visible: false,
addOrUpdateVisible: false,
tableBtn,
tableProps,
productAttributeList: [],
addButtonShow: '新增',
operator: '',
dataForm: {
id: null,
name: '',
palletCode: '',
},
listQuery: {
pageSize: 10,
pageNo: 1,
total: 0,
},
dataRule: {
// palletCode: [
// {
// required: true,
// message: '',
// trigger: 'blur',
// },
// ],
},
};
},
methods: {
initData() {
this.productAttributeList.splice(0);
},
init(val,nickname) {
this.operator = nickname
this.dataForm.id = val.id;
this.dataForm.name = val.name;
this.dataForm.palletCode = val.palletCode;
this.initData();
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
if (this.dataForm.id) {
//
//
this.getList();
}
});
},
getList() {
//
getWarehouseRealtimeLocation(this.dataForm.id).then((response) => {
this.productAttributeList = response.data;
});
},
inputChange(data) {
switch (data.sType) {
case 1:
this.productAttributeList[data._pageIndex - 1][data.prop] =
data[data.prop];
break;
case 2:
this.productAttributeList[data._pageIndex - 1][data.prop] =
data.string ? data.string.split('+')[0] : '';
this.productAttributeList[data._pageIndex - 1][data.prop + 'Name'] =
data.string ? data.string.split('+')[1] : '';
break;
default:
console.log(val);
}
},
handleClick(raw) {
if (raw.type === 'delete') {
this.$confirm(
`确定对${
raw.data.name
? '[名称=' + raw.data.name + ']'
: '[序号=' + raw.data._pageIndex + ']'
}进行删除操作?`,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
this.productAttributeList.splice(raw.data._pageIndex - 1, 1);
})
.catch(() => {});
} else {
this.addNew(raw.data._pageIndex);
}
},
//
dataFormSubmit() {
this.productAttributeList.forEach((item) => {
item.id = '';
});
const data = {
realtimeLocationId : this.dataForm.id,
palletCode : this.dataForm.palletCode,
operator : this.operator,
goodsInfos: this.productAttributeList
}
this.$refs['dataForm'].validate((valid) => {
if (valid) {
//
if (this.dataForm.id) {
inWarehouseRealtimeLocation(data).then((response) => {
this.$modal.msgSuccess('修改成功');
this.visible = false;
this.$emit('refreshDataList');
});
return;
}
}
});
},
// /
addNew(index) {
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(index);
});
},
addList(data) {
this.productAttributeList.push(data.productInfo);
},
goback() {
this.$emit('refreshDataList');
this.visible = false;
this.initData();
},
},
};
</script>
<style scoped>
.drawer >>> .el-drawer {
border-radius: 8px 0 0 8px;
}
.drawer >>> .el-form-item__label {
padding: 0;
}
.drawer >>> .el-form-item {
margin: 0;
}
.drawer >>> .el-drawer__header {
margin: 0;
padding: 32px 32px 24px;
border-bottom: 1px solid #dcdfe6;
margin-bottom: 10px;
}
.drawer >>> .content {
padding: 0 24px 30px;
display: flex;
flex-direction: column;
height: 100%;
}
.drawer >>> .visual-part {
flex: 1 auto;
max-height: 76vh;
overflow: hidden;
overflow-y: scroll;
padding-right: 10px; /* 调整滚动条样式 */
}
.drawer >>> .el-form,
.drawer >>> .attr-list {
padding: 0 16px;
}
</style>

View File

@ -0,0 +1,279 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:isFold="true"
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<!-- 对话框(添加 / 修改) -->
<drawer
v-if="drawerVisible"
ref="drawerRef"
@refreshDataList="getDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
<slot name="footer">
<el-row slot="footer" type="flex" justify="end">
<el-col :span="24">
<el-button size="small" class="btnTextStyle" @click="handleCancel">
取消
</el-button>
</el-col>
</el-row>
</slot>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import Drawer from './drawer';
import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import {
getWarehouseRealtimeLocationPage,
outWarehouseRealtimeLocation,
} from '@/api/warehouse/warehouseRealtimeLocation';
import { listByWarehouse } from '@/api/warehouse/warehouseLocation';
import { listData } from '@/api/system/dict/data';
import { publicFormatter } from '@/utils/dict';
import { mapGetters } from 'vuex';
const tableProps = [
{
prop: 'warehouseName',
label: '仓库名称',
},
{
prop: 'name',
label: '库位名称',
},
{
prop: 'code',
label: '库位编码',
},
{
prop: 'type',
label: '库位类型',
filter: publicFormatter('location_type'),
},
{
prop: 'status',
label: '库位状态',
filter: publicFormatter('AreaDetStatus'),
},
{
prop: 'palletCode',
label: '托盘编码',
},
{
prop: 'inTime',
label: '入库时间',
filter: parseTime,
minWidth: 150,
},
{
prop: 'remark',
label: '备注',
},
];
export default {
mixins: [basicPage],
computed: {
...mapGetters(['nickname']),
},
data() {
return {
urlOptions: {
getDataListURL: getWarehouseRealtimeLocationPage,
outURL: outWarehouseRealtimeLocation,
},
listQuery: {
storageType: 5,
},
tableData: [],
tableProps,
tableBtn: [
this.$auth.hasPermi(`out-material:warehouse-realtime-location:query`)
? {
type: 'info',
btnName: '详情',
}
: undefined,
this.$auth.hasPermi(`out-material:warehouse-realtime-location:query`)
? {
type: 'out',
btnName: '出库',
}
: undefined,
this.$auth.hasPermi(`out-material:warehouse-realtime-location:query`)
? {
type: 'in',
btnName: '入库',
}
: undefined,
].filter((v) => v),
drawerVisible: false,
formConfig: [
{
type: 'select',
label: '库位名',
selectOptions: [],
param: 'name',
defaultSelect: '',
filterable: true,
},
{
type: 'input',
label: '托盘编码',
placeholder: '托盘编码',
param: 'code',
},
{
type: 'select',
label: '库位状态',
selectOptions: [],
param: 'status',
defaultSelect: '',
filterable: true,
labelField: 'label',
valueField: 'value',
},
{
type: 'datePicker',
label: '入库时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: "timestamp",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
],
};
},
components: {
AddOrUpdate,
Drawer,
},
created() {
const queryParams = {
pageNo: 1,
pageSize: 99,
dictType: 'AreaDetStatus',
};
listData(queryParams).then((response) => {
this.formConfig[2].selectOptions = response.data.list;
});
listByWarehouse(this.listQuery.storageType).then((response) => {
this.formConfig[0].selectOptions = response.data;
});
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.locationId = val.name;
this.listQuery.palletCode = val.code;
this.listQuery.status = val.status;
this.listQuery.inTime = val.searchTime?val.searchTime:null;
this.getDataList();
break;
default:
console.log(val);
}
},
otherMethods(val) {
if (val.type === 'out') {
this.$confirm(
`确定对${'[名称=' + val.data.name + ']'}执行出库操作?`,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
const data = {
realtimeLocationId: val.data.id,
operator: this.nickname,
};
this.urlOptions.outURL(data).then(({ data }) => {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList();
},
});
});
})
.catch(() => {});
} else if (val.type === 'in') {
this.drawerVisible = true;
this.$nextTick(() => {
this.$refs.drawerRef.init(val.data, this.nickname);
});
} else if (val.type === 'info') {
this.addOrUpdateVisible = true;
this.addOrEditTitle = val.data.name + ' -产品信息';
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id);
});
}
},
handleCancel() {
this.addOrUpdateVisible = false;
this.addOrEditTitle = '';
},
},
};
</script>
<style>
.app-container .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@ -0,0 +1,96 @@
<!--
* @Author: zwq
* @Date: 2023-08-22 15:01:54
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 16:06:10
* @Description:
-->
<template>
<el-row :gutter="10" class="chart-container">
<el-col :span="14">
<div class="chart-card">
<barChart
ref="barChart"
height="500px"
title="库存总览"
v-if="overviewList.length"
:histogram="overviewList" />
<!-- 没有数据 -->
<div class="no-data-bg" v-else></div>
</div>
</el-col>
<el-col :span="10">
<div class="chart-card">
<pieChart
ref="pieChart"
height="600px"
v-if="rateList.length"
:pie-data="rateList" />
<!-- 没有数据 -->
<div class="no-data-bg" v-else></div>
</div>
</el-col>
</el-row>
</template>
<script>
import barChart from '../../chart/BarChart.vue';
import pieChart from '../../chart/PieChart.vue';
import {
getOverview,
getRate,
} from '@/api/warehouse/warehouseLocation';
export default {
data() {
return {
urlOptions: {
allURL: getOverview,
rateURL: getRate
},
overviewList: [],
rateList: []
};
},
components: {
barChart,
pieChart
},
mounted() {
this.getDataList();
},
methods: {
//
getDataList() {
const data = {
storageType : 3
}
this.urlOptions.allURL(data).then((response) => {
this.overviewList = response.data;
this.$nextTick(() => {
this.$refs.barChart.initChart();
});
});
this.urlOptions.rateURL(data).then((response) => {
this.rateList = response.data;
this.$nextTick(() => {
this.$refs.pieChart.initChart();
});
});
},
},
};
</script>
<style scoped>
.chart-container {
min-height: calc(100vh - 120px - 8px);
background-color: #f0f2f7;
}
.chart-card {
min-height: calc(100vh - 120px - 8px);
background-color: #fff;
padding: 16px;
border-radius: 8px;
}
</style>

View File

@ -0,0 +1,156 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 13:52:10
* @LastEditors: zwq
* @LastEditTime: 2023-11-03 14:56:25
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
v-if="visible"
@keyup.enter.native="dataFormSubmit()"
label-width="100px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="名称" prop="name">
<el-input
v-model="dataForm.name"
clearable
placeholder="请输入名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="编码" prop="code">
<el-input
v-model="dataForm.code"
clearable
placeholder="请输入编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="规格" prop="spec">
<el-input
v-model="dataForm.spec"
clearable
placeholder="请输入规格" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单位" prop="unit">
<el-select
v-model="dataForm.unit"
filterable
clearable
:style="{ width: '100%' }"
placeholder="请选择单位">
<el-option
v-for="item in urlOptions.dictList.dict0"
:key="item.id"
:label="item.label"
:value="parseInt(item.value)"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单日消耗量" prop="dailyUse">
<el-input-number
v-model="dataForm.dailyUse"
clearable
placeholder="请输入单日消耗量" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="允许留存时间" prop="allowTime">
<el-input-number
v-model="dataForm.allowTime"
clearable
placeholder="请输入允许留存时间" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="enabled" label="是否可用">
<el-select
v-model="dataForm.enabled"
filterable
clearable
:style="{ width: '100%' }"
placeholder="请选择是否可用">
<el-option
v-for="item in isorno"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input
v-model="dataForm.remark"
clearable
placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import basicAdd from '../../mixins/basic-add';
import {
createWarehouseGoods,
updateWarehouseGoods,
getWarehouseGoods,
getCode,
} from '@/api/warehouse/warehouseGoods';
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
isGetCode: true,
getDictList: true,
codeURL: getCode,
createURL: createWarehouseGoods,
updateURL: updateWarehouseGoods,
infoURL: getWarehouseGoods,
},
nameList: ['unit_dict'],
dataForm: {
id: undefined,
code: '',
name: '',
spec: '',
unit: '',
dailyUse: 0,
allowTime: 0,
enabled: 1,
remark: '',
},
dataRule: {
code: [
{ required: true, message: '库位编码不能为空', trigger: 'blur' },
],
name: [
{ required: true, message: '库位名称不能为空', trigger: 'blur' },
],
},
isorno: [
{
id: 0,
name: '不可用',
},
{
id: 1,
name: '可用',
},
],
};
},
methods: {},
};
</script>

View File

@ -0,0 +1,183 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="80"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<!-- 对话框(添加 / 修改) -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import codeFilter from '../../mixins/code-filter';
import {
deleteWarehouseGoods,
getWarehouseGoodsPage,
} from "@/api/warehouse/warehouseGoods";
import { publicFormatter } from '@/utils/dict';
const tableProps = [
{
prop: 'name',
label: '名称',
},
{
prop: 'code',
label: '编码',
},
{
prop: 'spec',
label: '规格',
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('unit_dict')
},
{
prop: 'allowTime',
label: '允许留存时长(天)',
},
{
prop: 'dailyUse',
label: '单日消耗量',
},
{
prop: 'enabled',
label: '是否可用',
filter: codeFilter('deactivate'),
},
{
prop: 'remark',
label: '备注',
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseGoodsPage,
deleteURL: deleteWarehouseGoods,
},
tableProps,
listQuery:{
storageType:3
},
tableBtn: [
this.$auth.hasPermi(`pack-material:warehouse-goods:update`)
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi(`pack-material:warehouse-goods:delete`)
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v)=>v),
tableData: [],
formConfig: [
{
type: 'input',
label: '名称',
placeholder: '名称',
param: 'name',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('pack-material:warehouse-goods:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true,
},
],
};
},
components: {
AddOrUpdate,
},
created() {},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.name = val.name;
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true;
this.addOrUpdateHandle();
break;
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
},
};
</script>

View File

@ -0,0 +1,192 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:isFold="true"
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
label="库位详情"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
</div>
</template>
<script>
import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import {
getWarehouseRealtimeHisPage,
} from '@/api/warehouse/warehouseRealtime';
import { getListByType } from '@/api/warehouse/warehouseGoods';
import { listData } from '@/api/system/dict/data';
import { publicFormatter } from '@/utils/dict';
const tableProps = [
{
prop: 'warehouseName',
label: '仓库名称',
},
{
prop: 'name',
label: '物品名称',
},
{
prop: 'code',
label: '物品编码',
},
{
prop: 'spec',
label: '物品规格',
},
{
prop: 'num',
label: '出入库数量',
},
{
prop: 'goodsBatch',
label: '物品批次',
},
{
prop: 'operateStatus',
label: '操作状态',
filter: publicFormatter('warehouse_operate_status'),
},
{
prop: 'operateTime',
label: '操作时间',
filter: parseTime,
minWidth: 150,
},
{
prop: 'operator',
label: '操作人',
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseRealtimeHisPage,
},
listQuery: {
storageType: 3,
},
tableData: [],
tableProps,
tableBtn: [
this.$auth.hasPermi(`pack-material:warehouse-realtime-location-his:query`)
? {
type: 'info',
btnName: '详情',
}
: undefined,
].filter((v) => v),
drawerVisible: false,
formConfig: [
{
type: 'select',
label: '物品名称',
selectOptions: [],
param: 'goodsId',
defaultSelect: '',
filterable: true,
},
{
type: 'input',
label: '操作人',
placeholder: '操作人',
param: 'operator',
},
{
type: 'select',
label: '操作状态',
selectOptions: [],
param: 'status',
defaultSelect: '',
filterable: true,
labelField: 'label',
valueField: 'value',
},
{
type: 'datePicker',
label: '操作时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: "timestamp",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
],
};
},
components: {
},
created() {
const queryParams = {
pageNo: 1,
pageSize: 99,
dictType: 'warehouse_operate_status',
};
listData(queryParams).then((response) => {
this.formConfig[2].selectOptions = response.data.list;
});
getListByType(this.listQuery.storageType).then((response) => {
this.formConfig[0].selectOptions = response.data;
});
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.goodsId = val.goodsId;
this.listQuery.operator = val.operator;
this.listQuery.operateStatus = val.status;
this.listQuery.operateTime = val.searchTime?val.searchTime:null;
this.getDataList();
break;
default:
console.log(val);
}
},
},
};
</script>
<style>
.app-container .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@ -0,0 +1,82 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2023-11-03 16:20:19
* @Description:
-->
<template>
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:height="300"
:table-data="tableData" />
</template>
<script>
import { parseTime } from '../../mixins/code-filter';
import { getWarehouseLocationHisDet } from '@/api/warehouse/warehouseRealtimeLocation';
const tableProps = [
{
prop: 'name',
label: '物品名称',
align: 'center',
},
{
prop: 'code',
label: '物品编码',
align: 'center',
},
{
prop: 'spec',
label: '物品规格',
align: 'center',
},
{
prop: 'batchCode',
label: '物品批次',
align: 'center',
},
{
prop: 'num',
label: '数量',
align: 'center',
},
{
prop: 'allowTime',
label: '允许留存时长(天)',
align: 'center',
},
{
prop: 'remark',
label: '备注',
align: 'center',
},
];
export default {
data() {
return {
tableData: [],
tableProps,
listQuery: {
pageSize: 100,
pageNo: 1,
total: 1,
},
dataListLoading: false,
};
},
methods: {
//
init(id) {
this.dataListLoading = true;
getWarehouseLocationHisDet(id).then((response) => {
this.tableData = response.data;
this.dataListLoading = false;
});
},
},
};
</script>

View File

@ -0,0 +1,223 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:isFold="true"
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
label="库位详情"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<!-- 对话框(添加 / 修改) -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
<slot name="footer">
<el-row slot="footer" type="flex" justify="end">
<el-col :span="24">
<el-button size="small" class="btnTextStyle" @click="handleCancel">
取消
</el-button>
</el-col>
</el-row>
</slot>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import {
getWarehouseLocationHisPage,
} from '@/api/warehouse/warehouseRealtimeLocation';
import { listByWarehouse } from '@/api/warehouse/warehouseLocation';
import { listData } from '@/api/system/dict/data';
import { publicFormatter } from '@/utils/dict';
const tableProps = [
{
prop: 'warehouseName',
label: '仓库名称',
},
{
prop: 'name',
label: '库位名称',
},
{
prop: 'code',
label: '库位编码',
},
{
prop: 'type',
label: '库位类型',
filter: publicFormatter('location_type'),
},
{
prop: 'palletCode',
label: '托盘编码',
},
{
prop: 'operateStatus',
label: '操作状态',
filter: publicFormatter('warehouse_operate_status'),
},
{
prop: 'createTime',
label: '操作时间',
filter: parseTime,
minWidth: 150,
},
{
prop: 'creator',
label: '操作人',
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseLocationHisPage,
},
listQuery: {
storageType: 3,
},
tableData: [],
tableProps,
tableBtn: [
this.$auth.hasPermi(`pack-material:warehouse-realtime-location-his:query`)
? {
type: 'info',
btnName: '详情',
}
: undefined,
].filter((v) => v),
drawerVisible: false,
formConfig: [
{
type: 'select',
label: '库位名',
selectOptions: [],
param: 'name',
defaultSelect: '',
filterable: true,
},
{
type: 'input',
label: '托盘编码',
placeholder: '托盘编码',
param: 'code',
},
{
type: 'select',
label: '操作状态',
selectOptions: [],
param: 'status',
defaultSelect: '',
filterable: true,
labelField: 'label',
valueField: 'value',
},
{
type: 'datePicker',
label: '操作时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: "timestamp",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
],
};
},
components: {
AddOrUpdate,
},
created() {
const queryParams = {
pageNo: 1,
pageSize: 99,
dictType: 'warehouse_operate_status',
};
listData(queryParams).then((response) => {
this.formConfig[2].selectOptions = response.data.list;
});
listByWarehouse(3).then((response) => {
this.formConfig[0].selectOptions = response.data;
});
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.locationId = val.name;
this.listQuery.palletCode = val.code;
this.listQuery.operateStatus = val.status;
this.listQuery.createTime = val.searchTime?val.searchTime:null;
this.getDataList();
break;
default:
console.log(val);
}
},
otherMethods(val) {
if (val.type === 'info') {
this.addOrUpdateVisible = true;
this.addOrEditTitle = val.data.name + ' -产品信息';
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id);
});
}
},
handleCancel() {
this.addOrUpdateVisible = false;
this.addOrEditTitle = '';
},
},
};
</script>
<style>
.app-container .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@ -0,0 +1,221 @@
<!--
* @Author: zwq
* @Date: 2023-08-21 14:26:23
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 14:46:59
* @Description:
-->
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<div class="tips">
<el-tag effect="dark" color="#7362F3" style="border: none">缓存</el-tag>
<el-tag effect="dark" color="#16DC09" style="border: none">活动</el-tag>
<el-tag effect="dark" color="#FFA08F" style="border: none">其它</el-tag>
</div>
<div class="mainbody">
<div v-for="i in total" :key="i">
<el-row>
<el-col :span="24">
<el-row type="flex" class="flex-warp">
<div
class="dashboard-layout-item"
v-for="a in wareData.one.slice((i - 1) * 10, i * 10)"
:key="a.id + a.code"
:title="a.name"
style="background: #fff8e8; float: left">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[a.type - 1],
}" />
<p class="p-name">{{ a.name }}</p>
</div>
</el-row>
<el-row type="flex" class="flex-warp">
<div
class="dashboard-layout-item"
v-for="b in wareData.two.slice((i - 1) * 10, i * 10)"
:key="b.id + b.code"
:title="b.name"
style="background: #fff8e8; float: left">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[b.type - 1],
}" />
<p class="p-name">{{ b.name }}</p>
</div>
</el-row>
</el-col>
</el-row>
<el-divider class="divider"></el-divider>
<el-row>
<el-col :span="24">
<el-row type="flex" class="flex-warp">
<div
class="dashboard-layout-item"
v-for="c in wareData.there.slice((i - 1) * 10, i * 10)"
:key="c.id + c.code"
:title="c.name"
style="background: #fff8e8; float: left">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[c.type - 1],
}" />
<p class="p-name">{{ c.name }}</p>
</div>
</el-row>
<el-row type="flex" class="flex-warp">
<div
class="dashboard-layout-item"
v-for="d in wareData.four.slice((i - 1) * 10, i * 10)"
:key="d.id + d.code"
:title="d.name"
style="background: #fff8e8; float: left">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[d.type - 1],
}" />
<p class="p-name">{{ d.name }}</p>
</div>
</el-row>
</el-col>
</el-row>
</div>
</div>
</div>
</template>
<script>
import { listByWarehouse, listAll } from '@/api/warehouse/warehouseLocation';
export default {
data() {
return {
wareData: {
one: [],
two: [],
there: [],
four: [],
},
total: 0,
bgColor: ['#7362F3', '#16DC09', '#FFA08F'],
formConfig: [
{
type: 'button',
btnName: '刷新',
name: 'search',
color: 'primary',
},
],
};
},
components: {},
mounted() {
this.getDataList();
},
methods: {
//
getDataList() {
(this.wareData = {
one: [],
two: [],
there: [],
four: [],
}),
listAll(1).then((response) => {
response.data.forEach((a, b) => {
if (b % 4 === 0) {
this.wareData.one.push(a);
} else if (b % 4 === 1) {
this.wareData.two.push(a);
} else if (b % 4 === 2) {
this.wareData.there.push(a);
} else if (b % 4 === 3) {
this.wareData.four.push(a);
}
});
this.total = Math.ceil(response.data.length / 40);
});
},
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.getDataList();
break;
default:
console.log(val);
}
},
},
};
</script>
<style lang="scss" scoped>
.mainbody {
display: flex;
gap: 70px;
flex-direction: column;
}
.flex-warp {
flex-wrap: nowrap;
}
.dashboard-layout-item {
width: 100px;
text-align: center;
height: 32px;
box-shadow: 0px 3px 6px 0px rgba(166, 174, 190, 0.8);
border-radius: 2px 4px 4px 2px;
margin: 0 3px 8px 0;
display: flex;
align-items: center;
justify-content: center;
position: relative;
.dashboard-layout-item-cricle {
display: inline-block;
width: 12px;
height: 12px;
border-radius: 6px;
position: absolute;
top: 10px;
left: 3px;
}
.p-name {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
margin-left: 15px;
}
&:hover {
cursor: pointer;
z-index: 10;
transform: scale(1.3) translateZ(0);
}
&:nth-child(2n) {
margin-right: 30px;
}
&:first-child {
margin-left: 50px;
}
&:last-child {
margin-right: 30px;
}
}
.el-divider--horizontal {
margin: 10px 0;
}
.el-divider {
background-color: black;
}
.tips {
position: absolute;
top: 22px;
right: 120px;
}
</style>

View File

@ -0,0 +1,202 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 13:52:10
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 14:17:39
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
v-if="visible"
@keyup.enter.native="dataFormSubmit()"
label-width="100px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="仓库名称" prop="warehouseName">
<el-input
v-model="dataForm.warehouseName"
readonly
placeholder="请输入仓库名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物品名称" prop="goodsId">
<el-select
v-model="dataForm.goodsId"
filterable
clearable
:disabled="dataForm.id ? true : false"
:style="{ width: '100%' }"
@change="setGoodInfo"
placeholder="请选择物品名称">
<el-option
v-for="item in goodsArr"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物品编码" prop="code">
<el-input
v-model="dataForm.code"
readonly
placeholder="请输入物品编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物品规格" prop="spec">
<el-input
v-model="dataForm.spec"
readonly
placeholder="请输入物品规格" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物品批次" prop="goodsBatch">
<el-input
v-if="!dataForm.id ? true : false"
v-model="dataForm.goodsBatch"
clearable
placeholder="请输入物品批次" />
<el-select
v-else
v-model="dataForm.goodsBatch"
filterable
clearable
@change="setBatchInfo"
placeholder="请选择物品名称">
<el-option
v-for="(item, index) in Batch"
:key="index"
:label="item.goodsBatch"
:value="item.goodsBatch"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="入库数量" prop="numDet">
<el-input-number
v-model="dataForm.numDet"
clearable
:min="0"
:max="max?max:9999999"
placeholder="请输入入库数量" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import basicAdd from '../../mixins/basic-add';
import {
createWarehouseRealtime,
outWarehouseRealtime,
getWarehouseRealtime,
getWarehouseRealtimeDet,
} from '@/api/warehouse/warehouseRealtime';
import { getListByType } from '@/api/warehouse/warehouseGoods';
import { getWarehouseList } from '@/api/warehouse/warehouse-info';
import { mapGetters } from 'vuex';
export default {
mixins: [basicAdd],
computed: {
...mapGetters(['nickname']),
},
data() {
return {
urlOptions: {
getOption: true,
createURL: createWarehouseRealtime,
updateURL: outWarehouseRealtime,
infoURL: getWarehouseRealtime,
},
dataForm: {
id: undefined,
warehouseName: '',
warehouseId: '',
goodsId: '',
code: '',
spec: '',
goodsBatch: '',
numDet: '',
operator: '',
},
goodsArr: [],
Batch: [],
max: 0,
dataRule: {
goodsId: [
{ required: true, message: '物品名称不能为空', trigger: 'change' },
],
goodsBatch: [
{
required: true,
message: '物品批次不能为空,若无请填写无',
trigger: 'blur',
},
],
numDet: [
{ required: true, message: '入库数量不能为空', trigger: 'blur' },
],
},
};
},
created() {},
methods: {
getArr() {
this.dataForm.operator = this.nickname
getListByType(3).then((response) => {
this.goodsArr = response.data;
});
getWarehouseList().then((response) => {
response.data.forEach((item) => {
if (item.storageType === 3) {
this.dataForm.warehouseName = item.name;
this.dataForm.warehouseId = item.id;
}
});
});
},
setGoodInfo() {
this.goodsArr.forEach((item) => {
if (item.id === this.dataForm.goodsId) {
this.dataForm.code = item.code;
this.dataForm.spec = item.spec;
}
});
},
setBatchInfo(){
this.Batch.forEach((item) => {
if (item.goodsBatch === this.dataForm.goodsBatch) {
this.max = item.numDet
}
});
},
outWare(data) {
this.getArr();
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
this.dataForm.realTimeId = data.id;
this.dataForm.id = data.id;
this.dataForm.goodsId = data.goodsId;
this.dataForm.code = data.code;
this.dataForm.spec = data.spec;
getWarehouseRealtimeDet(data.id).then((res) => {
this.Batch = res.data;
});
// this.urlOptions.infoURL(data.id).then((response) => {
// this.dataForm = response.data;
// });
});
},
},
};
</script>

View File

@ -0,0 +1,193 @@
<!--
* @Author: zwq
* @Date: 2023-11-03 16:37:06
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 16:01:58
* @Description:
-->
<template>
<div class="app-container">
<search-bar
:isFold="true"
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<el-table
:data="tableData"
:header-cell-style="{
background: '#F2F4F9',
color: '#606266',
}"
border
v-loading="dataListLoading"
style="width: 100%"
ref="dataList">
<el-table-column type="expand">
<template slot-scope="scope">
<product :warehouse-id="scope.row.id"></product>
</template>
</el-table-column>
<el-table-column prop="warehouseName" label="仓库名称" />
<el-table-column prop="name" label="物品名称" />
<el-table-column prop="code" label="物品编码" />
<el-table-column prop="spec" label="物品规格" />
<el-table-column prop="num" label="数量" />
<el-table-column prop="operator" label="操作人" />
<el-table-column prop="latestInTime" label="最新入库时间">
<template v-slot="scope">
<span>{{ parseTime(scope.row.latestInTime) }}</span>
</template>
</el-table-column>
<el-table-column prop="latestOutTime" label="最新出库时间">
<template v-slot="scope">
<span>{{ parseTime(scope.row.latestOutTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" width="100">
<template v-slot="scope">
<el-button
size="mini"
type="text"
@click="handleClick({ data: scope.row, type: 'out' })"
v-hasPermi="['pack-material:warehouse-realtime:update']">
出库
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<!-- 对话框(添加 / 修改) -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog>
</div>
</template>
<script>
import product from './product-mini';
import basicPage from '../../mixins/basic-page';
import { getListByType } from '@/api/warehouse/warehouseGoods';
import AddOrUpdate from './add-or-updata';
import { getWarehouseRealtimePage } from '@/api/warehouse/warehouseRealtime';
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseRealtimePage,
},
tableData: [],
listQuery: {
storageType: 3,
},
formConfig: [
{
type: 'select',
label: '物品名称',
selectOptions: [],
param: 'goodsId',
defaultSelect: '',
filterable: true,
},
{
type: 'input',
label: '操作人',
placeholder: '操作人',
param: 'operator',
},
{
type: 'datePicker',
label: '最新入库时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'timestamp',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'datePicker',
label: '最新出库时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'timestamp',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime1',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
{
type: this.$auth.hasPermi('pack-material:warehouse-realtime:create') ? 'button' : '',
btnName: '入库',
name: 'add',
color: 'success',
plain: true,
},
],
};
},
components: {
product,
AddOrUpdate,
},
created() {
getListByType(this.listQuery.storageType).then((response) => {
this.formConfig[0].selectOptions = response.data;
});
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.goodsId = val.goodsId;
this.listQuery.operator = val.operator;
this.listQuery.latestInTime = val.searchTime?val.searchTime:null;
this.listQuery.latestOutTime = val.searchTime1?val.searchTime1:null;
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '入库';
this.addOrUpdateVisible = true;
this.addOrUpdateHandle();
break;
default:
console.log(val);
}
},
otherMethods(val){
this.addOrUpdateVisible = true;
this.addOrEditTitle = "出库";
this.$nextTick(() => {
this.$refs.addOrUpdate.outWare(val.data);
});
}
},
};
</script>
<style>
.app-container .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@ -0,0 +1,71 @@
<!--
* @Author: zwq
* @Date: 2023-08-24 14:47:58
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 10:31:56
* @Description:
-->
<template>
<div>
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
max-height="200"
:table-data="tableData" />
</div>
</template>
<script>
import { parseTime } from '../../mixins/code-filter';
import { getWarehouseRealtimeDet } from '@/api/warehouse/warehouseRealtime';
const tableProps = [
{
prop: 'goodsBatch',
label: '产品批次',
},
{
prop: 'numDet',
label: '批次数量',
},
{
prop: 'createTime',
label: '入库时间',
filter: parseTime,
},
];
export default {
props: {
warehouseId: {
type: String,
default: '',
},
},
data() {
return {
urlOptions: {
getDataListURL: getWarehouseRealtimeDet
},
tableProps,
tableData: [],
dataListLoading: false,
};
},
components: {
},
created() {},
mounted() {
this.getDataList()
},
methods: {
//
getDataList() {
this.dataListLoading = true;
this.urlOptions.getDataListURL(this.warehouseId).then(response => {
this.tableData = response.data;
this.dataListLoading = false;
});
},
},
};
</script>

View File

@ -0,0 +1,65 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 15:27:31
* @LastEditors: zwq
* @LastEditTime: 2023-08-01 16:25:54
* @Description:
-->
<template>
<div :class="[className, { 'p-0': noPadding }]">
<slot />
</div>
</template>
<script>
export default {
props: {
size: {
// : xl lg md sm
type: String,
default: 'de',
validator: function (val) {
return ['xl', 'lg', 'de', 'md', 'sm'].indexOf(val) !== -1;
},
},
noPadding: {
type: Boolean,
default: false,
},
},
computed: {
className: function () {
return `${this.size}-title`;
},
},
};
</script>
<style lang="scss" scoped>
$pxls: (xl, 28px) (lg, 24px) (de, 20px) (md, 18px) (sm, 16px);
$mgr: 8px;
@each $size, $height in $pxls {
.#{$size}-title {
font-size: 18px;
line-height: $height;
color: #000;
font-weight: 500;
font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif;
&::before {
content: '';
display: inline-block;
vertical-align: top;
width: 4px;
height: $height + 2px;
border-radius: 1px;
margin-right: $mgr;
background-color: #0b58ff;
}
}
}
.p-0 {
padding: 0;
}
</style>

View File

@ -0,0 +1,93 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2023-11-03 14:51:33
* @Description:
-->
<template>
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:height="300"
:table-data="tableData" />
</template>
<script>
import { parseTime } from '../../mixins/code-filter';
import { getWarehouseRealtimeLocation } from '@/api/warehouse/warehouseRealtimeLocation';
const tableProps = [
{
prop: 'name',
label: '物品名称',
align: 'center',
},
{
prop: 'code',
label: '物品编码',
align: 'center',
},
{
prop: 'spec',
label: '物品规格',
align: 'center',
},
{
prop: 'goodsBatch',
label: '物品批次',
align: 'center',
},
{
prop: 'num',
label: '数量',
align: 'center',
},
{
prop: 'allowTime',
label: '允许留存时长(天)',
align: 'center',
},
{
prop: 'inTime',
label: '入库时间',
align: 'center',
filter: parseTime,
},
{
prop: 'leftTime',
label: '剩余留存时长(天)',
align: 'center',
},
{
prop: 'remark',
label: '备注',
align: 'center',
},
];
export default {
data() {
return {
tableData: [],
tableProps,
listQuery: {
pageSize: 100,
pageNo: 1,
total: 1,
},
dataListLoading: false,
};
},
methods: {
//
init(id) {
this.dataListLoading = true;
getWarehouseRealtimeLocation(id).then((response) => {
this.tableData = response.data;
this.dataListLoading = false;
});
},
},
};
</script>

View File

@ -0,0 +1,122 @@
<template>
<el-dialog
:visible.sync="visible"
:width="'35%'"
:append-to-body="true"
:close-on-click-modal="false"
class="dialog">
<template #title>
<slot name="title">
<div class="titleStyle">
新增产品
</div>
</slot>
</template>
<el-form
ref="dataForm"
:model="dataForm"
:rules="dataRule"
label-width="100px"
@keyup.enter.native="dataFormSubmit()">
<el-form-item label="产品" prop="productInfo">
<el-select
v-model="dataForm.productInfo"
style="width: 100%"
filterable
value-key="id"
placeholder="请选择产品">
<el-option
v-for="item in productArr"
:key="item.id"
:label="item.name"
:value="item" />
</el-select>
</el-form-item>
</el-form>
<el-row style="text-align: right">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</el-row>
</el-dialog>
</template>
<script>
import {
getListByType
} from "@/api/warehouse/warehouseGoods";
export default {
data() {
return {
visible: false,
dataForm: {
index: -1,
productInfo: '',
},
productArr: [],
dataRule: {
productId: [{ required: true, message: '产品不能为空', trigger: 'blur' }],
},
};
},
methods: {
init(index) {
if (index >= 0) {
this.dataForm.index = index;
}
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
getListByType(3).then((response) => {
this.productArr = response.data;
});
});
},
//
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.dataForm.productInfo.goodsId = this.dataForm.productInfo.id
this.dataForm.productInfo.remark = ''
//
if (this.dataForm.index >= 0) {
this.visible = false;
this.$emit('refreshDataList', this.dataForm);
return;
}
//
this.visible = false;
this.$emit('refreshDataList', this.dataForm);
}
});
},
},
};
</script>
<style scoped>
.dialog >>> .el-dialog__body {
padding: 30px 24px;
}
.dialog >>> .el-dialog__header {
font-size: 16px;
color: rgba(0, 0, 0, 0.85);
font-weight: 500;
padding: 13px 24px;
border-bottom: 1px solid #e9e9e9;
}
.dialog >>> .el-dialog__header .titleStyle::before {
content: '';
display: inline-block;
width: 4px;
height: 16px;
background-color: #0b58ff;
border-radius: 1px;
margin-right: 8px;
position: relative;
top: 2px;
}
</style>

View File

@ -0,0 +1,317 @@
<template>
<el-drawer
:visible.sync="visible"
:show-close="false"
:destroy-on-close="true"
:wrapper-closable="false"
class="drawer"
size="60%">
<small-title slot="title" :no-padding="true">库位信息</small-title>
<div class="content">
<div class="visual-part">
<el-form
ref="dataForm"
:model="dataForm"
:rules="dataRule"
label-width="100px"
label-position="top"
@keyup.enter.native="dataFormSubmit">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="库位名称" prop="name">
<el-input
v-model="dataForm.name"
disabled />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="托盘编码" prop="palletCode">
<el-input
v-model="dataForm.palletCode"
@input="$forceUpdate()"
placeholder="请输入托盘编码" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<small-title
style="margin: 16px 0; padding-left: 8px"
:no-padding="true">
产品信息
<!-- <el-alert
title="产品信息新增和修改后,需点击最下方保存按钮确定修改"
type="warning"
show-icon></el-alert> -->
</small-title>
<div class="attr-list">
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:add-button-show="addButtonShow"
@emitButtonClick="addNew"
@emitFun="inputChange"
:height="400"
:table-data="productAttributeList">
<method-btn
slot="handleBtn"
:width="70"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
</div>
</div>
</div>
<div style="position: absolute; bottom: 24px; right: 24px">
<el-button style="margin-right: 10px" @click="goback()">返回</el-button>
<span>
<el-button type="primary" @click="dataFormSubmit()">入库</el-button>
</span>
</div>
<product-attr-add
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="addList" />
</el-drawer>
</template>
<script>
import productAttrAdd from './attr-add';
import inputArea from '../../mixins/inputArea';
import SmallTitle from './SmallTitle';
import { inWarehouseRealtimeLocation,
getWarehouseRealtimeLocation } from '@/api/warehouse/warehouseRealtimeLocation';
const tableBtn = [
{
type: 'delete',
btnName: '删除',
},
];
const tableProps = [
{
prop: 'name',
label: '物品名称',
align: 'center',
},
{
prop: 'code',
label: '物品编码',
align: 'center',
},
{
prop: 'spec',
label: '物品规格',
align: 'center',
},
{
prop: 'goodsBatch',
label: '物品批次',
align: 'center',
subcomponent: inputArea,
width: 100,
},
{
prop: 'num',
label: '数量',
align: 'center',
subcomponent: inputArea,
width: 100,
},
{
prop: 'remark',
label: '备注',
align: 'center',
subcomponent: inputArea,
width: 100,
},
];
export default {
components: { productAttrAdd, SmallTitle },
data() {
return {
visible: false,
addOrUpdateVisible: false,
tableBtn,
tableProps,
productAttributeList: [],
addButtonShow: '新增',
operator: '',
dataForm: {
id: null,
name: '',
palletCode: '',
},
listQuery: {
pageSize: 10,
pageNo: 1,
total: 0,
},
dataRule: {
// palletCode: [
// {
// required: true,
// message: '',
// trigger: 'blur',
// },
// ],
},
};
},
methods: {
initData() {
this.productAttributeList.splice(0);
},
init(val,nickname) {
this.operator = nickname
this.dataForm.id = val.id;
this.dataForm.name = val.name;
this.dataForm.palletCode = val.palletCode;
this.initData();
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
if (this.dataForm.id) {
//
//
this.getList();
}
});
},
getList() {
//
getWarehouseRealtimeLocation(this.dataForm.id).then((response) => {
this.productAttributeList = response.data;
});
},
inputChange(data) {
switch (data.sType) {
case 1:
this.productAttributeList[data._pageIndex - 1][data.prop] =
data[data.prop];
break;
case 2:
this.productAttributeList[data._pageIndex - 1][data.prop] =
data.string ? data.string.split('+')[0] : '';
this.productAttributeList[data._pageIndex - 1][data.prop + 'Name'] =
data.string ? data.string.split('+')[1] : '';
break;
default:
console.log(val);
}
},
handleClick(raw) {
if (raw.type === 'delete') {
this.$confirm(
`确定对${
raw.data.name
? '[名称=' + raw.data.name + ']'
: '[序号=' + raw.data._pageIndex + ']'
}进行删除操作?`,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
this.productAttributeList.splice(raw.data._pageIndex - 1, 1);
})
.catch(() => {});
} else {
this.addNew(raw.data._pageIndex);
}
},
//
dataFormSubmit() {
this.productAttributeList.forEach((item) => {
item.id = '';
});
const data = {
realtimeLocationId : this.dataForm.id,
palletCode : this.dataForm.palletCode,
operator : this.operator,
goodsInfos: this.productAttributeList
}
this.$refs['dataForm'].validate((valid) => {
if (valid) {
//
if (this.dataForm.id) {
inWarehouseRealtimeLocation(data).then((response) => {
this.$modal.msgSuccess('修改成功');
this.visible = false;
this.$emit('refreshDataList');
});
return;
}
}
});
},
// /
addNew(index) {
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(index);
});
},
addList(data) {
this.productAttributeList.push(data.productInfo);
},
goback() {
this.$emit('refreshDataList');
this.visible = false;
this.initData();
},
},
};
</script>
<style scoped>
.drawer >>> .el-drawer {
border-radius: 8px 0 0 8px;
}
.drawer >>> .el-form-item__label {
padding: 0;
}
.drawer >>> .el-form-item {
margin: 0;
}
.drawer >>> .el-drawer__header {
margin: 0;
padding: 32px 32px 24px;
border-bottom: 1px solid #dcdfe6;
margin-bottom: 10px;
}
.drawer >>> .content {
padding: 0 24px 30px;
display: flex;
flex-direction: column;
height: 100%;
}
.drawer >>> .visual-part {
flex: 1 auto;
max-height: 76vh;
overflow: hidden;
overflow-y: scroll;
padding-right: 10px; /* 调整滚动条样式 */
}
.drawer >>> .el-form,
.drawer >>> .attr-list {
padding: 0 16px;
}
</style>

View File

@ -0,0 +1,279 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:isFold="true"
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<!-- 对话框(添加 / 修改) -->
<drawer
v-if="drawerVisible"
ref="drawerRef"
@refreshDataList="getDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
<slot name="footer">
<el-row slot="footer" type="flex" justify="end">
<el-col :span="24">
<el-button size="small" class="btnTextStyle" @click="handleCancel">
取消
</el-button>
</el-col>
</el-row>
</slot>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import Drawer from './drawer';
import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import {
getWarehouseRealtimeLocationPage,
outWarehouseRealtimeLocation,
} from '@/api/warehouse/warehouseRealtimeLocation';
import { listByWarehouse } from '@/api/warehouse/warehouseLocation';
import { listData } from '@/api/system/dict/data';
import { publicFormatter } from '@/utils/dict';
import { mapGetters } from 'vuex';
const tableProps = [
{
prop: 'warehouseName',
label: '仓库名称',
},
{
prop: 'name',
label: '库位名称',
},
{
prop: 'code',
label: '库位编码',
},
{
prop: 'type',
label: '库位类型',
filter: publicFormatter('location_type'),
},
{
prop: 'status',
label: '库位状态',
filter: publicFormatter('AreaDetStatus'),
},
{
prop: 'palletCode',
label: '托盘编码',
},
{
prop: 'inTime',
label: '入库时间',
filter: parseTime,
minWidth: 150,
},
{
prop: 'remark',
label: '备注',
},
];
export default {
mixins: [basicPage],
computed: {
...mapGetters(['nickname']),
},
data() {
return {
urlOptions: {
getDataListURL: getWarehouseRealtimeLocationPage,
outURL: outWarehouseRealtimeLocation,
},
listQuery: {
storageType: 3,
},
tableData: [],
tableProps,
tableBtn: [
this.$auth.hasPermi(`pack-material:warehouse-realtime-location:query`)
? {
type: 'info',
btnName: '详情',
}
: undefined,
this.$auth.hasPermi(`pack-material:warehouse-realtime-location:query`)
? {
type: 'out',
btnName: '出库',
}
: undefined,
this.$auth.hasPermi(`pack-material:warehouse-realtime-location:query`)
? {
type: 'in',
btnName: '入库',
}
: undefined,
].filter((v) => v),
drawerVisible: false,
formConfig: [
{
type: 'select',
label: '库位名',
selectOptions: [],
param: 'name',
defaultSelect: '',
filterable: true,
},
{
type: 'input',
label: '托盘编码',
placeholder: '托盘编码',
param: 'code',
},
{
type: 'select',
label: '库位状态',
selectOptions: [],
param: 'status',
defaultSelect: '',
filterable: true,
labelField: 'label',
valueField: 'value',
},
{
type: 'datePicker',
label: '入库时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: "timestamp",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
],
};
},
components: {
AddOrUpdate,
Drawer,
},
created() {
const queryParams = {
pageNo: 1,
pageSize: 99,
dictType: 'AreaDetStatus',
};
listData(queryParams).then((response) => {
this.formConfig[2].selectOptions = response.data.list;
});
listByWarehouse(3).then((response) => {
this.formConfig[0].selectOptions = response.data;
});
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.locationId = val.name;
this.listQuery.palletCode = val.code;
this.listQuery.status = val.status;
this.listQuery.inTime = val.searchTime?val.searchTime:null;
this.getDataList();
break;
default:
console.log(val);
}
},
otherMethods(val) {
if (val.type === 'out') {
this.$confirm(
`确定对${'[名称=' + val.data.name + ']'}执行出库操作?`,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
const data = {
realtimeLocationId: val.data.id,
operator: this.nickname,
};
this.urlOptions.outURL(data).then(({ data }) => {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList();
},
});
});
})
.catch(() => {});
} else if (val.type === 'in') {
this.drawerVisible = true;
this.$nextTick(() => {
this.$refs.drawerRef.init(val.data, this.nickname);
});
} else if (val.type === 'info') {
this.addOrUpdateVisible = true;
this.addOrEditTitle = val.data.name + ' -产品信息';
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id);
});
}
},
handleCancel() {
this.addOrUpdateVisible = false;
this.addOrEditTitle = '';
},
},
};
</script>
<style>
.app-container .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@ -0,0 +1,96 @@
<!--
* @Author: zwq
* @Date: 2023-08-22 15:01:54
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 16:24:11
* @Description:
-->
<template>
<el-row :gutter="10" class="chart-container">
<el-col :span="14">
<div class="chart-card">
<barChart
ref="barChart"
height="500px"
title="库存总览"
v-if="overviewList.length"
:histogram="overviewList" />
<!-- 没有数据 -->
<div class="no-data-bg" v-else></div>
</div>
</el-col>
<el-col :span="10">
<div class="chart-card">
<pieChart
ref="pieChart"
height="600px"
v-if="rateList.length"
:pie-data="rateList" />
<!-- 没有数据 -->
<div class="no-data-bg" v-else></div>
</div>
</el-col>
</el-row>
</template>
<script>
import barChart from '../../chart/BarChart.vue';
import pieChart from '../../chart/PieChart.vue';
import {
getOverview,
getRate,
} from '@/api/warehouse/warehouseLocation';
export default {
data() {
return {
urlOptions: {
allURL: getOverview,
rateURL: getRate
},
overviewList: [],
rateList: []
};
},
components: {
barChart,
pieChart
},
mounted() {
this.getDataList();
},
methods: {
//
getDataList() {
const data = {
storageType : 4
}
this.urlOptions.allURL(data).then((response) => {
this.overviewList = response.data;
this.$nextTick(() => {
this.$refs.barChart.initChart();
});
});
this.urlOptions.rateURL(data).then((response) => {
this.rateList = response.data;
this.$nextTick(() => {
this.$refs.pieChart.initChart();
});
});
},
},
};
</script>
<style scoped>
.chart-container {
min-height: calc(100vh - 120px - 8px);
background-color: #f0f2f7;
}
.chart-card {
min-height: calc(100vh - 120px - 8px);
background-color: #fff;
padding: 16px;
border-radius: 8px;
}
</style>

View File

@ -0,0 +1,156 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 13:52:10
* @LastEditors: zwq
* @LastEditTime: 2023-11-03 14:56:25
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
v-if="visible"
@keyup.enter.native="dataFormSubmit()"
label-width="100px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="名称" prop="name">
<el-input
v-model="dataForm.name"
clearable
placeholder="请输入名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="编码" prop="code">
<el-input
v-model="dataForm.code"
clearable
placeholder="请输入编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="规格" prop="spec">
<el-input
v-model="dataForm.spec"
clearable
placeholder="请输入规格" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单位" prop="unit">
<el-select
v-model="dataForm.unit"
filterable
clearable
:style="{ width: '100%' }"
placeholder="请选择单位">
<el-option
v-for="item in urlOptions.dictList.dict0"
:key="item.id"
:label="item.label"
:value="parseInt(item.value)"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单日消耗量" prop="dailyUse">
<el-input-number
v-model="dataForm.dailyUse"
clearable
placeholder="请输入单日消耗量" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="允许留存时间" prop="allowTime">
<el-input-number
v-model="dataForm.allowTime"
clearable
placeholder="请输入允许留存时间" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="enabled" label="是否可用">
<el-select
v-model="dataForm.enabled"
filterable
clearable
:style="{ width: '100%' }"
placeholder="请选择是否可用">
<el-option
v-for="item in isorno"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input
v-model="dataForm.remark"
clearable
placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import basicAdd from '../../mixins/basic-add';
import {
createWarehouseGoods,
updateWarehouseGoods,
getWarehouseGoods,
getCode,
} from '@/api/warehouse/warehouseGoods';
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
isGetCode: true,
getDictList: true,
codeURL: getCode,
createURL: createWarehouseGoods,
updateURL: updateWarehouseGoods,
infoURL: getWarehouseGoods,
},
nameList: ['unit_dict'],
dataForm: {
id: undefined,
code: '',
name: '',
spec: '',
unit: '',
dailyUse: 0,
allowTime: 0,
enabled: 1,
remark: '',
},
dataRule: {
code: [
{ required: true, message: '库位编码不能为空', trigger: 'blur' },
],
name: [
{ required: true, message: '库位名称不能为空', trigger: 'blur' },
],
},
isorno: [
{
id: 0,
name: '不可用',
},
{
id: 1,
name: '可用',
},
],
};
},
methods: {},
};
</script>

View File

@ -0,0 +1,183 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="80"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<!-- 对话框(添加 / 修改) -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import codeFilter from '../../mixins/code-filter';
import {
deleteWarehouseGoods,
getWarehouseGoodsPage,
} from "@/api/warehouse/warehouseGoods";
import { publicFormatter } from '@/utils/dict';
const tableProps = [
{
prop: 'name',
label: '名称',
},
{
prop: 'code',
label: '编码',
},
{
prop: 'spec',
label: '规格',
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('unit_dict')
},
{
prop: 'allowTime',
label: '允许留存时长(天)',
},
{
prop: 'dailyUse',
label: '单日消耗量',
},
{
prop: 'enabled',
label: '是否可用',
filter: codeFilter('deactivate'),
},
{
prop: 'remark',
label: '备注',
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseGoodsPage,
deleteURL: deleteWarehouseGoods,
},
tableProps,
listQuery:{
storageType:4
},
tableBtn: [
this.$auth.hasPermi(`part-material:warehouse-goods:update`)
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi(`part-material:warehouse-goods:delete`)
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v)=>v),
tableData: [],
formConfig: [
{
type: 'input',
label: '名称',
placeholder: '名称',
param: 'name',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('part-material:warehouse-goods:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true,
},
],
};
},
components: {
AddOrUpdate,
},
created() {},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.name = val.name;
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true;
this.addOrUpdateHandle();
break;
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
},
};
</script>

View File

@ -0,0 +1,192 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:isFold="true"
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
label="库位详情"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
</div>
</template>
<script>
import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import {
getWarehouseRealtimeHisPage,
} from '@/api/warehouse/warehouseRealtime';
import { getListByType } from '@/api/warehouse/warehouseGoods';
import { listData } from '@/api/system/dict/data';
import { publicFormatter } from '@/utils/dict';
const tableProps = [
{
prop: 'warehouseName',
label: '仓库名称',
},
{
prop: 'name',
label: '物品名称',
},
{
prop: 'code',
label: '物品编码',
},
{
prop: 'spec',
label: '物品规格',
},
{
prop: 'num',
label: '出入库数量',
},
{
prop: 'goodsBatch',
label: '物品批次',
},
{
prop: 'operateStatus',
label: '操作状态',
filter: publicFormatter('warehouse_operate_status'),
},
{
prop: 'operateTime',
label: '操作时间',
filter: parseTime,
minWidth: 150,
},
{
prop: 'operator',
label: '操作人',
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseRealtimeHisPage,
},
listQuery: {
storageType: 4,
},
tableData: [],
tableProps,
tableBtn: [
this.$auth.hasPermi(`part-material:warehouse-realtime-location-his:query`)
? {
type: 'info',
btnName: '详情',
}
: undefined,
].filter((v) => v),
drawerVisible: false,
formConfig: [
{
type: 'select',
label: '物品名称',
selectOptions: [],
param: 'goodsId',
defaultSelect: '',
filterable: true,
},
{
type: 'input',
label: '操作人',
placeholder: '操作人',
param: 'operator',
},
{
type: 'select',
label: '操作状态',
selectOptions: [],
param: 'status',
defaultSelect: '',
filterable: true,
labelField: 'label',
valueField: 'value',
},
{
type: 'datePicker',
label: '操作时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: "timestamp",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
],
};
},
components: {
},
created() {
const queryParams = {
pageNo: 1,
pageSize: 99,
dictType: 'warehouse_operate_status',
};
listData(queryParams).then((response) => {
this.formConfig[2].selectOptions = response.data.list;
});
getListByType(this.listQuery.storageType).then((response) => {
this.formConfig[0].selectOptions = response.data;
});
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.goodsId = val.goodsId;
this.listQuery.operator = val.operator;
this.listQuery.operateStatus = val.status;
this.listQuery.operateTime = val.searchTime?val.searchTime:null;
this.getDataList();
break;
default:
console.log(val);
}
},
},
};
</script>
<style>
.app-container .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@ -0,0 +1,82 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2023-11-03 16:20:19
* @Description:
-->
<template>
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:height="300"
:table-data="tableData" />
</template>
<script>
import { parseTime } from '../../mixins/code-filter';
import { getWarehouseLocationHisDet } from '@/api/warehouse/warehouseRealtimeLocation';
const tableProps = [
{
prop: 'name',
label: '物品名称',
align: 'center',
},
{
prop: 'code',
label: '物品编码',
align: 'center',
},
{
prop: 'spec',
label: '物品规格',
align: 'center',
},
{
prop: 'batchCode',
label: '物品批次',
align: 'center',
},
{
prop: 'num',
label: '数量',
align: 'center',
},
{
prop: 'allowTime',
label: '允许留存时长(天)',
align: 'center',
},
{
prop: 'remark',
label: '备注',
align: 'center',
},
];
export default {
data() {
return {
tableData: [],
tableProps,
listQuery: {
pageSize: 100,
pageNo: 1,
total: 1,
},
dataListLoading: false,
};
},
methods: {
//
init(id) {
this.dataListLoading = true;
getWarehouseLocationHisDet(id).then((response) => {
this.tableData = response.data;
this.dataListLoading = false;
});
},
},
};
</script>

View File

@ -0,0 +1,223 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:isFold="true"
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
label="库位详情"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<!-- 对话框(添加 / 修改) -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
<slot name="footer">
<el-row slot="footer" type="flex" justify="end">
<el-col :span="24">
<el-button size="small" class="btnTextStyle" @click="handleCancel">
取消
</el-button>
</el-col>
</el-row>
</slot>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import {
getWarehouseLocationHisPage,
} from '@/api/warehouse/warehouseRealtimeLocation';
import { listByWarehouse } from '@/api/warehouse/warehouseLocation';
import { listData } from '@/api/system/dict/data';
import { publicFormatter } from '@/utils/dict';
const tableProps = [
{
prop: 'warehouseName',
label: '仓库名称',
},
{
prop: 'name',
label: '库位名称',
},
{
prop: 'code',
label: '库位编码',
},
{
prop: 'type',
label: '库位类型',
filter: publicFormatter('location_type'),
},
{
prop: 'palletCode',
label: '托盘编码',
},
{
prop: 'operateStatus',
label: '操作状态',
filter: publicFormatter('warehouse_operate_status'),
},
{
prop: 'createTime',
label: '操作时间',
filter: parseTime,
minWidth: 150,
},
{
prop: 'creator',
label: '操作人',
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseLocationHisPage,
},
listQuery: {
storageType: 4,
},
tableData: [],
tableProps,
tableBtn: [
this.$auth.hasPermi(`part-material:warehouse-realtime-location-his:query`)
? {
type: 'info',
btnName: '详情',
}
: undefined,
].filter((v) => v),
drawerVisible: false,
formConfig: [
{
type: 'select',
label: '库位名',
selectOptions: [],
param: 'name',
defaultSelect: '',
filterable: true,
},
{
type: 'input',
label: '托盘编码',
placeholder: '托盘编码',
param: 'code',
},
{
type: 'select',
label: '操作状态',
selectOptions: [],
param: 'status',
defaultSelect: '',
filterable: true,
labelField: 'label',
valueField: 'value',
},
{
type: 'datePicker',
label: '操作时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: "timestamp",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
],
};
},
components: {
AddOrUpdate,
},
created() {
const queryParams = {
pageNo: 1,
pageSize: 99,
dictType: 'warehouse_operate_status',
};
listData(queryParams).then((response) => {
this.formConfig[2].selectOptions = response.data.list;
});
listByWarehouse(this.listQuery.storageType).then((response) => {
this.formConfig[0].selectOptions = response.data;
});
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.locationId = val.name;
this.listQuery.palletCode = val.code;
this.listQuery.operateStatus = val.status;
this.listQuery.createTime = val.searchTime?val.searchTime:null;
this.getDataList();
break;
default:
console.log(val);
}
},
otherMethods(val) {
if (val.type === 'info') {
this.addOrUpdateVisible = true;
this.addOrEditTitle = val.data.name + ' -产品信息';
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id);
});
}
},
handleCancel() {
this.addOrUpdateVisible = false;
this.addOrEditTitle = '';
},
},
};
</script>
<style>
.app-container .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@ -0,0 +1,221 @@
<!--
* @Author: zwq
* @Date: 2023-08-21 14:26:23
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 14:46:59
* @Description:
-->
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<div class="tips">
<el-tag effect="dark" color="#7362F3" style="border: none">缓存</el-tag>
<el-tag effect="dark" color="#16DC09" style="border: none">活动</el-tag>
<el-tag effect="dark" color="#FFA08F" style="border: none">其它</el-tag>
</div>
<div class="mainbody">
<div v-for="i in total" :key="i">
<el-row>
<el-col :span="24">
<el-row type="flex" class="flex-warp">
<div
class="dashboard-layout-item"
v-for="a in wareData.one.slice((i - 1) * 10, i * 10)"
:key="a.id + a.code"
:title="a.name"
style="background: #fff8e8; float: left">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[a.type - 1],
}" />
<p class="p-name">{{ a.name }}</p>
</div>
</el-row>
<el-row type="flex" class="flex-warp">
<div
class="dashboard-layout-item"
v-for="b in wareData.two.slice((i - 1) * 10, i * 10)"
:key="b.id + b.code"
:title="b.name"
style="background: #fff8e8; float: left">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[b.type - 1],
}" />
<p class="p-name">{{ b.name }}</p>
</div>
</el-row>
</el-col>
</el-row>
<el-divider class="divider"></el-divider>
<el-row>
<el-col :span="24">
<el-row type="flex" class="flex-warp">
<div
class="dashboard-layout-item"
v-for="c in wareData.there.slice((i - 1) * 10, i * 10)"
:key="c.id + c.code"
:title="c.name"
style="background: #fff8e8; float: left">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[c.type - 1],
}" />
<p class="p-name">{{ c.name }}</p>
</div>
</el-row>
<el-row type="flex" class="flex-warp">
<div
class="dashboard-layout-item"
v-for="d in wareData.four.slice((i - 1) * 10, i * 10)"
:key="d.id + d.code"
:title="d.name"
style="background: #fff8e8; float: left">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[d.type - 1],
}" />
<p class="p-name">{{ d.name }}</p>
</div>
</el-row>
</el-col>
</el-row>
</div>
</div>
</div>
</template>
<script>
import { listByWarehouse, listAll } from '@/api/warehouse/warehouseLocation';
export default {
data() {
return {
wareData: {
one: [],
two: [],
there: [],
four: [],
},
total: 0,
bgColor: ['#7362F3', '#16DC09', '#FFA08F'],
formConfig: [
{
type: 'button',
btnName: '刷新',
name: 'search',
color: 'primary',
},
],
};
},
components: {},
mounted() {
this.getDataList();
},
methods: {
//
getDataList() {
(this.wareData = {
one: [],
two: [],
there: [],
four: [],
}),
listAll(1).then((response) => {
response.data.forEach((a, b) => {
if (b % 4 === 0) {
this.wareData.one.push(a);
} else if (b % 4 === 1) {
this.wareData.two.push(a);
} else if (b % 4 === 2) {
this.wareData.there.push(a);
} else if (b % 4 === 3) {
this.wareData.four.push(a);
}
});
this.total = Math.ceil(response.data.length / 40);
});
},
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.getDataList();
break;
default:
console.log(val);
}
},
},
};
</script>
<style lang="scss" scoped>
.mainbody {
display: flex;
gap: 70px;
flex-direction: column;
}
.flex-warp {
flex-wrap: nowrap;
}
.dashboard-layout-item {
width: 100px;
text-align: center;
height: 32px;
box-shadow: 0px 3px 6px 0px rgba(166, 174, 190, 0.8);
border-radius: 2px 4px 4px 2px;
margin: 0 3px 8px 0;
display: flex;
align-items: center;
justify-content: center;
position: relative;
.dashboard-layout-item-cricle {
display: inline-block;
width: 12px;
height: 12px;
border-radius: 6px;
position: absolute;
top: 10px;
left: 3px;
}
.p-name {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
margin-left: 15px;
}
&:hover {
cursor: pointer;
z-index: 10;
transform: scale(1.3) translateZ(0);
}
&:nth-child(2n) {
margin-right: 30px;
}
&:first-child {
margin-left: 50px;
}
&:last-child {
margin-right: 30px;
}
}
.el-divider--horizontal {
margin: 10px 0;
}
.el-divider {
background-color: black;
}
.tips {
position: absolute;
top: 22px;
right: 120px;
}
</style>

View File

@ -0,0 +1,202 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 13:52:10
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 16:24:26
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
v-if="visible"
@keyup.enter.native="dataFormSubmit()"
label-width="100px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="仓库名称" prop="warehouseName">
<el-input
v-model="dataForm.warehouseName"
readonly
placeholder="请输入仓库名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物品名称" prop="goodsId">
<el-select
v-model="dataForm.goodsId"
filterable
clearable
:disabled="dataForm.id ? true : false"
:style="{ width: '100%' }"
@change="setGoodInfo"
placeholder="请选择物品名称">
<el-option
v-for="item in goodsArr"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物品编码" prop="code">
<el-input
v-model="dataForm.code"
readonly
placeholder="请输入物品编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物品规格" prop="spec">
<el-input
v-model="dataForm.spec"
readonly
placeholder="请输入物品规格" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物品批次" prop="goodsBatch">
<el-input
v-if="!dataForm.id ? true : false"
v-model="dataForm.goodsBatch"
clearable
placeholder="请输入物品批次" />
<el-select
v-else
v-model="dataForm.goodsBatch"
filterable
clearable
@change="setBatchInfo"
placeholder="请选择物品名称">
<el-option
v-for="(item, index) in Batch"
:key="index"
:label="item.goodsBatch"
:value="item.goodsBatch"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="入库数量" prop="numDet">
<el-input-number
v-model="dataForm.numDet"
clearable
:min="0"
:max="max?max:9999999"
placeholder="请输入入库数量" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import basicAdd from '../../mixins/basic-add';
import {
createWarehouseRealtime,
outWarehouseRealtime,
getWarehouseRealtime,
getWarehouseRealtimeDet,
} from '@/api/warehouse/warehouseRealtime';
import { getListByType } from '@/api/warehouse/warehouseGoods';
import { getWarehouseList } from '@/api/warehouse/warehouse-info';
import { mapGetters } from 'vuex';
export default {
mixins: [basicAdd],
computed: {
...mapGetters(['nickname']),
},
data() {
return {
urlOptions: {
getOption: true,
createURL: createWarehouseRealtime,
updateURL: outWarehouseRealtime,
infoURL: getWarehouseRealtime,
},
dataForm: {
id: undefined,
warehouseName: '',
warehouseId: '',
goodsId: '',
code: '',
spec: '',
goodsBatch: '',
numDet: '',
operator: '',
},
goodsArr: [],
Batch: [],
max: 0,
dataRule: {
goodsId: [
{ required: true, message: '物品名称不能为空', trigger: 'change' },
],
goodsBatch: [
{
required: true,
message: '物品批次不能为空,若无请填写无',
trigger: 'blur',
},
],
numDet: [
{ required: true, message: '入库数量不能为空', trigger: 'blur' },
],
},
};
},
created() {},
methods: {
getArr() {
this.dataForm.operator = this.nickname
getListByType(4).then((response) => {
this.goodsArr = response.data;
});
getWarehouseList().then((response) => {
response.data.forEach((item) => {
if (item.storageType === 4) {
this.dataForm.warehouseName = item.name;
this.dataForm.warehouseId = item.id;
}
});
});
},
setGoodInfo() {
this.goodsArr.forEach((item) => {
if (item.id === this.dataForm.goodsId) {
this.dataForm.code = item.code;
this.dataForm.spec = item.spec;
}
});
},
setBatchInfo(){
this.Batch.forEach((item) => {
if (item.goodsBatch === this.dataForm.goodsBatch) {
this.max = item.numDet
}
});
},
outWare(data) {
this.getArr();
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
this.dataForm.realTimeId = data.id;
this.dataForm.id = data.id;
this.dataForm.goodsId = data.goodsId;
this.dataForm.code = data.code;
this.dataForm.spec = data.spec;
getWarehouseRealtimeDet(data.id).then((res) => {
this.Batch = res.data;
});
// this.urlOptions.infoURL(data.id).then((response) => {
// this.dataForm = response.data;
// });
});
},
},
};
</script>

View File

@ -0,0 +1,193 @@
<!--
* @Author: zwq
* @Date: 2023-11-03 16:37:06
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 16:24:57
* @Description:
-->
<template>
<div class="app-container">
<search-bar
:isFold="true"
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<el-table
:data="tableData"
:header-cell-style="{
background: '#F2F4F9',
color: '#606266',
}"
border
v-loading="dataListLoading"
style="width: 100%"
ref="dataList">
<el-table-column type="expand">
<template slot-scope="scope">
<product :warehouse-id="scope.row.id"></product>
</template>
</el-table-column>
<el-table-column prop="warehouseName" label="仓库名称" />
<el-table-column prop="name" label="物品名称" />
<el-table-column prop="code" label="物品编码" />
<el-table-column prop="spec" label="物品规格" />
<el-table-column prop="num" label="数量" />
<el-table-column prop="operator" label="操作人" />
<el-table-column prop="latestInTime" label="最新入库时间">
<template v-slot="scope">
<span>{{ parseTime(scope.row.latestInTime) }}</span>
</template>
</el-table-column>
<el-table-column prop="latestOutTime" label="最新出库时间">
<template v-slot="scope">
<span>{{ parseTime(scope.row.latestOutTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" width="100">
<template v-slot="scope">
<el-button
size="mini"
type="text"
@click="handleClick({ data: scope.row, type: 'out' })"
v-hasPermi="['part-material:warehouse-realtime:update']">
出库
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<!-- 对话框(添加 / 修改) -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog>
</div>
</template>
<script>
import product from './product-mini';
import basicPage from '../../mixins/basic-page';
import { getListByType } from '@/api/warehouse/warehouseGoods';
import AddOrUpdate from './add-or-updata';
import { getWarehouseRealtimePage } from '@/api/warehouse/warehouseRealtime';
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseRealtimePage,
},
tableData: [],
listQuery: {
storageType: 4,
},
formConfig: [
{
type: 'select',
label: '物品名称',
selectOptions: [],
param: 'goodsId',
defaultSelect: '',
filterable: true,
},
{
type: 'input',
label: '操作人',
placeholder: '操作人',
param: 'operator',
},
{
type: 'datePicker',
label: '最新入库时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'timestamp',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'datePicker',
label: '最新出库时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'timestamp',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime1',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
{
type: this.$auth.hasPermi('part-material:warehouse-realtime:create') ? 'button' : '',
btnName: '入库',
name: 'add',
color: 'success',
plain: true,
},
],
};
},
components: {
product,
AddOrUpdate,
},
created() {
getListByType(this.listQuery.storageType).then((response) => {
this.formConfig[0].selectOptions = response.data;
});
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.goodsId = val.goodsId;
this.listQuery.operator = val.operator;
this.listQuery.latestInTime = val.searchTime?val.searchTime:null;
this.listQuery.latestOutTime = val.searchTime1?val.searchTime1:null;
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '入库';
this.addOrUpdateVisible = true;
this.addOrUpdateHandle();
break;
default:
console.log(val);
}
},
otherMethods(val){
this.addOrUpdateVisible = true;
this.addOrEditTitle = "出库";
this.$nextTick(() => {
this.$refs.addOrUpdate.outWare(val.data);
});
}
},
};
</script>
<style>
.app-container .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@ -0,0 +1,71 @@
<!--
* @Author: zwq
* @Date: 2023-08-24 14:47:58
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 10:31:56
* @Description:
-->
<template>
<div>
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
max-height="200"
:table-data="tableData" />
</div>
</template>
<script>
import { parseTime } from '../../mixins/code-filter';
import { getWarehouseRealtimeDet } from '@/api/warehouse/warehouseRealtime';
const tableProps = [
{
prop: 'goodsBatch',
label: '产品批次',
},
{
prop: 'numDet',
label: '批次数量',
},
{
prop: 'createTime',
label: '入库时间',
filter: parseTime,
},
];
export default {
props: {
warehouseId: {
type: String,
default: '',
},
},
data() {
return {
urlOptions: {
getDataListURL: getWarehouseRealtimeDet
},
tableProps,
tableData: [],
dataListLoading: false,
};
},
components: {
},
created() {},
mounted() {
this.getDataList()
},
methods: {
//
getDataList() {
this.dataListLoading = true;
this.urlOptions.getDataListURL(this.warehouseId).then(response => {
this.tableData = response.data;
this.dataListLoading = false;
});
},
},
};
</script>

View File

@ -0,0 +1,65 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 15:27:31
* @LastEditors: zwq
* @LastEditTime: 2023-08-01 16:25:54
* @Description:
-->
<template>
<div :class="[className, { 'p-0': noPadding }]">
<slot />
</div>
</template>
<script>
export default {
props: {
size: {
// : xl lg md sm
type: String,
default: 'de',
validator: function (val) {
return ['xl', 'lg', 'de', 'md', 'sm'].indexOf(val) !== -1;
},
},
noPadding: {
type: Boolean,
default: false,
},
},
computed: {
className: function () {
return `${this.size}-title`;
},
},
};
</script>
<style lang="scss" scoped>
$pxls: (xl, 28px) (lg, 24px) (de, 20px) (md, 18px) (sm, 16px);
$mgr: 8px;
@each $size, $height in $pxls {
.#{$size}-title {
font-size: 18px;
line-height: $height;
color: #000;
font-weight: 500;
font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif;
&::before {
content: '';
display: inline-block;
vertical-align: top;
width: 4px;
height: $height + 2px;
border-radius: 1px;
margin-right: $mgr;
background-color: #0b58ff;
}
}
}
.p-0 {
padding: 0;
}
</style>

View File

@ -0,0 +1,93 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2023-11-03 14:51:33
* @Description:
-->
<template>
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:height="300"
:table-data="tableData" />
</template>
<script>
import { parseTime } from '../../mixins/code-filter';
import { getWarehouseRealtimeLocation } from '@/api/warehouse/warehouseRealtimeLocation';
const tableProps = [
{
prop: 'name',
label: '物品名称',
align: 'center',
},
{
prop: 'code',
label: '物品编码',
align: 'center',
},
{
prop: 'spec',
label: '物品规格',
align: 'center',
},
{
prop: 'goodsBatch',
label: '物品批次',
align: 'center',
},
{
prop: 'num',
label: '数量',
align: 'center',
},
{
prop: 'allowTime',
label: '允许留存时长(天)',
align: 'center',
},
{
prop: 'inTime',
label: '入库时间',
align: 'center',
filter: parseTime,
},
{
prop: 'leftTime',
label: '剩余留存时长(天)',
align: 'center',
},
{
prop: 'remark',
label: '备注',
align: 'center',
},
];
export default {
data() {
return {
tableData: [],
tableProps,
listQuery: {
pageSize: 100,
pageNo: 1,
total: 1,
},
dataListLoading: false,
};
},
methods: {
//
init(id) {
this.dataListLoading = true;
getWarehouseRealtimeLocation(id).then((response) => {
this.tableData = response.data;
this.dataListLoading = false;
});
},
},
};
</script>

View File

@ -0,0 +1,122 @@
<template>
<el-dialog
:visible.sync="visible"
:width="'35%'"
:append-to-body="true"
:close-on-click-modal="false"
class="dialog">
<template #title>
<slot name="title">
<div class="titleStyle">
新增产品
</div>
</slot>
</template>
<el-form
ref="dataForm"
:model="dataForm"
:rules="dataRule"
label-width="100px"
@keyup.enter.native="dataFormSubmit()">
<el-form-item label="产品" prop="productInfo">
<el-select
v-model="dataForm.productInfo"
style="width: 100%"
filterable
value-key="id"
placeholder="请选择产品">
<el-option
v-for="item in productArr"
:key="item.id"
:label="item.name"
:value="item" />
</el-select>
</el-form-item>
</el-form>
<el-row style="text-align: right">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</el-row>
</el-dialog>
</template>
<script>
import {
getListByType
} from "@/api/warehouse/warehouseGoods";
export default {
data() {
return {
visible: false,
dataForm: {
index: -1,
productInfo: '',
},
productArr: [],
dataRule: {
productId: [{ required: true, message: '产品不能为空', trigger: 'blur' }],
},
};
},
methods: {
init(index) {
if (index >= 0) {
this.dataForm.index = index;
}
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
getListByType(4).then((response) => {
this.productArr = response.data;
});
});
},
//
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.dataForm.productInfo.goodsId = this.dataForm.productInfo.id
this.dataForm.productInfo.remark = ''
//
if (this.dataForm.index >= 0) {
this.visible = false;
this.$emit('refreshDataList', this.dataForm);
return;
}
//
this.visible = false;
this.$emit('refreshDataList', this.dataForm);
}
});
},
},
};
</script>
<style scoped>
.dialog >>> .el-dialog__body {
padding: 30px 24px;
}
.dialog >>> .el-dialog__header {
font-size: 16px;
color: rgba(0, 0, 0, 0.85);
font-weight: 500;
padding: 13px 24px;
border-bottom: 1px solid #e9e9e9;
}
.dialog >>> .el-dialog__header .titleStyle::before {
content: '';
display: inline-block;
width: 4px;
height: 16px;
background-color: #0b58ff;
border-radius: 1px;
margin-right: 8px;
position: relative;
top: 2px;
}
</style>

View File

@ -0,0 +1,317 @@
<template>
<el-drawer
:visible.sync="visible"
:show-close="false"
:destroy-on-close="true"
:wrapper-closable="false"
class="drawer"
size="60%">
<small-title slot="title" :no-padding="true">库位信息</small-title>
<div class="content">
<div class="visual-part">
<el-form
ref="dataForm"
:model="dataForm"
:rules="dataRule"
label-width="100px"
label-position="top"
@keyup.enter.native="dataFormSubmit">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="库位名称" prop="name">
<el-input
v-model="dataForm.name"
disabled />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="托盘编码" prop="palletCode">
<el-input
v-model="dataForm.palletCode"
@input="$forceUpdate()"
placeholder="请输入托盘编码" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<small-title
style="margin: 16px 0; padding-left: 8px"
:no-padding="true">
产品信息
<!-- <el-alert
title="产品信息新增和修改后,需点击最下方保存按钮确定修改"
type="warning"
show-icon></el-alert> -->
</small-title>
<div class="attr-list">
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:add-button-show="addButtonShow"
@emitButtonClick="addNew"
@emitFun="inputChange"
:height="400"
:table-data="productAttributeList">
<method-btn
slot="handleBtn"
:width="70"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
</div>
</div>
</div>
<div style="position: absolute; bottom: 24px; right: 24px">
<el-button style="margin-right: 10px" @click="goback()">返回</el-button>
<span>
<el-button type="primary" @click="dataFormSubmit()">入库</el-button>
</span>
</div>
<product-attr-add
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="addList" />
</el-drawer>
</template>
<script>
import productAttrAdd from './attr-add';
import inputArea from '../../mixins/inputArea';
import SmallTitle from './SmallTitle';
import { inWarehouseRealtimeLocation,
getWarehouseRealtimeLocation } from '@/api/warehouse/warehouseRealtimeLocation';
const tableBtn = [
{
type: 'delete',
btnName: '删除',
},
];
const tableProps = [
{
prop: 'name',
label: '物品名称',
align: 'center',
},
{
prop: 'code',
label: '物品编码',
align: 'center',
},
{
prop: 'spec',
label: '物品规格',
align: 'center',
},
{
prop: 'goodsBatch',
label: '物品批次',
align: 'center',
subcomponent: inputArea,
width: 100,
},
{
prop: 'num',
label: '数量',
align: 'center',
subcomponent: inputArea,
width: 100,
},
{
prop: 'remark',
label: '备注',
align: 'center',
subcomponent: inputArea,
width: 100,
},
];
export default {
components: { productAttrAdd, SmallTitle },
data() {
return {
visible: false,
addOrUpdateVisible: false,
tableBtn,
tableProps,
productAttributeList: [],
addButtonShow: '新增',
operator: '',
dataForm: {
id: null,
name: '',
palletCode: '',
},
listQuery: {
pageSize: 10,
pageNo: 1,
total: 0,
},
dataRule: {
// palletCode: [
// {
// required: true,
// message: '',
// trigger: 'blur',
// },
// ],
},
};
},
methods: {
initData() {
this.productAttributeList.splice(0);
},
init(val,nickname) {
this.operator = nickname
this.dataForm.id = val.id;
this.dataForm.name = val.name;
this.dataForm.palletCode = val.palletCode;
this.initData();
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
if (this.dataForm.id) {
//
//
this.getList();
}
});
},
getList() {
//
getWarehouseRealtimeLocation(this.dataForm.id).then((response) => {
this.productAttributeList = response.data;
});
},
inputChange(data) {
switch (data.sType) {
case 1:
this.productAttributeList[data._pageIndex - 1][data.prop] =
data[data.prop];
break;
case 2:
this.productAttributeList[data._pageIndex - 1][data.prop] =
data.string ? data.string.split('+')[0] : '';
this.productAttributeList[data._pageIndex - 1][data.prop + 'Name'] =
data.string ? data.string.split('+')[1] : '';
break;
default:
console.log(val);
}
},
handleClick(raw) {
if (raw.type === 'delete') {
this.$confirm(
`确定对${
raw.data.name
? '[名称=' + raw.data.name + ']'
: '[序号=' + raw.data._pageIndex + ']'
}进行删除操作?`,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
this.productAttributeList.splice(raw.data._pageIndex - 1, 1);
})
.catch(() => {});
} else {
this.addNew(raw.data._pageIndex);
}
},
//
dataFormSubmit() {
this.productAttributeList.forEach((item) => {
item.id = '';
});
const data = {
realtimeLocationId : this.dataForm.id,
palletCode : this.dataForm.palletCode,
operator : this.operator,
goodsInfos: this.productAttributeList
}
this.$refs['dataForm'].validate((valid) => {
if (valid) {
//
if (this.dataForm.id) {
inWarehouseRealtimeLocation(data).then((response) => {
this.$modal.msgSuccess('修改成功');
this.visible = false;
this.$emit('refreshDataList');
});
return;
}
}
});
},
// /
addNew(index) {
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(index);
});
},
addList(data) {
this.productAttributeList.push(data.productInfo);
},
goback() {
this.$emit('refreshDataList');
this.visible = false;
this.initData();
},
},
};
</script>
<style scoped>
.drawer >>> .el-drawer {
border-radius: 8px 0 0 8px;
}
.drawer >>> .el-form-item__label {
padding: 0;
}
.drawer >>> .el-form-item {
margin: 0;
}
.drawer >>> .el-drawer__header {
margin: 0;
padding: 32px 32px 24px;
border-bottom: 1px solid #dcdfe6;
margin-bottom: 10px;
}
.drawer >>> .content {
padding: 0 24px 30px;
display: flex;
flex-direction: column;
height: 100%;
}
.drawer >>> .visual-part {
flex: 1 auto;
max-height: 76vh;
overflow: hidden;
overflow-y: scroll;
padding-right: 10px; /* 调整滚动条样式 */
}
.drawer >>> .el-form,
.drawer >>> .attr-list {
padding: 0 16px;
}
</style>

View File

@ -0,0 +1,279 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:isFold="true"
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<!-- 对话框(添加 / 修改) -->
<drawer
v-if="drawerVisible"
ref="drawerRef"
@refreshDataList="getDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
<slot name="footer">
<el-row slot="footer" type="flex" justify="end">
<el-col :span="24">
<el-button size="small" class="btnTextStyle" @click="handleCancel">
取消
</el-button>
</el-col>
</el-row>
</slot>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import Drawer from './drawer';
import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import {
getWarehouseRealtimeLocationPage,
outWarehouseRealtimeLocation,
} from '@/api/warehouse/warehouseRealtimeLocation';
import { listByWarehouse } from '@/api/warehouse/warehouseLocation';
import { listData } from '@/api/system/dict/data';
import { publicFormatter } from '@/utils/dict';
import { mapGetters } from 'vuex';
const tableProps = [
{
prop: 'warehouseName',
label: '仓库名称',
},
{
prop: 'name',
label: '库位名称',
},
{
prop: 'code',
label: '库位编码',
},
{
prop: 'type',
label: '库位类型',
filter: publicFormatter('location_type'),
},
{
prop: 'status',
label: '库位状态',
filter: publicFormatter('AreaDetStatus'),
},
{
prop: 'palletCode',
label: '托盘编码',
},
{
prop: 'inTime',
label: '入库时间',
filter: parseTime,
minWidth: 150,
},
{
prop: 'remark',
label: '备注',
},
];
export default {
mixins: [basicPage],
computed: {
...mapGetters(['nickname']),
},
data() {
return {
urlOptions: {
getDataListURL: getWarehouseRealtimeLocationPage,
outURL: outWarehouseRealtimeLocation,
},
listQuery: {
storageType: 4,
},
tableData: [],
tableProps,
tableBtn: [
this.$auth.hasPermi(`part-material:warehouse-realtime-location:query`)
? {
type: 'info',
btnName: '详情',
}
: undefined,
this.$auth.hasPermi(`part-material:warehouse-realtime-location:query`)
? {
type: 'out',
btnName: '出库',
}
: undefined,
this.$auth.hasPermi(`part-material:warehouse-realtime-location:query`)
? {
type: 'in',
btnName: '入库',
}
: undefined,
].filter((v) => v),
drawerVisible: false,
formConfig: [
{
type: 'select',
label: '库位名',
selectOptions: [],
param: 'name',
defaultSelect: '',
filterable: true,
},
{
type: 'input',
label: '托盘编码',
placeholder: '托盘编码',
param: 'code',
},
{
type: 'select',
label: '库位状态',
selectOptions: [],
param: 'status',
defaultSelect: '',
filterable: true,
labelField: 'label',
valueField: 'value',
},
{
type: 'datePicker',
label: '入库时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: "timestamp",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
],
};
},
components: {
AddOrUpdate,
Drawer,
},
created() {
const queryParams = {
pageNo: 1,
pageSize: 99,
dictType: 'AreaDetStatus',
};
listData(queryParams).then((response) => {
this.formConfig[2].selectOptions = response.data.list;
});
listByWarehouse(this.listQuery.storageType).then((response) => {
this.formConfig[0].selectOptions = response.data;
});
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.locationId = val.name;
this.listQuery.palletCode = val.code;
this.listQuery.status = val.status;
this.listQuery.inTime = val.searchTime?val.searchTime:null;
this.getDataList();
break;
default:
console.log(val);
}
},
otherMethods(val) {
if (val.type === 'out') {
this.$confirm(
`确定对${'[名称=' + val.data.name + ']'}执行出库操作?`,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
const data = {
realtimeLocationId: val.data.id,
operator: this.nickname,
};
this.urlOptions.outURL(data).then(({ data }) => {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList();
},
});
});
})
.catch(() => {});
} else if (val.type === 'in') {
this.drawerVisible = true;
this.$nextTick(() => {
this.$refs.drawerRef.init(val.data, this.nickname);
});
} else if (val.type === 'info') {
this.addOrUpdateVisible = true;
this.addOrEditTitle = val.data.name + ' -产品信息';
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id);
});
}
},
handleCancel() {
this.addOrUpdateVisible = false;
this.addOrEditTitle = '';
},
},
};
</script>
<style>
.app-container .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@ -0,0 +1,96 @@
<!--
* @Author: zwq
* @Date: 2023-08-22 15:01:54
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 15:18:38
* @Description:
-->
<template>
<el-row :gutter="10" class="chart-container">
<el-col :span="14">
<div class="chart-card">
<barChart
ref="barChart"
height="500px"
title="库存总览"
v-if="overviewList.length"
:histogram="overviewList" />
<!-- 没有数据 -->
<div class="no-data-bg" v-else></div>
</div>
</el-col>
<el-col :span="10">
<div class="chart-card">
<pieChart
ref="pieChart"
height="600px"
v-if="rateList.length"
:pie-data="rateList" />
<!-- 没有数据 -->
<div class="no-data-bg" v-else></div>
</div>
</el-col>
</el-row>
</template>
<script>
import barChart from '../../chart/BarChart.vue';
import pieChart from '../../chart/PieChart.vue';
import {
getOverview,
getRate,
} from '@/api/warehouse/warehouseLocation';
export default {
data() {
return {
urlOptions: {
allURL: getOverview,
rateURL: getRate
},
overviewList: [],
rateList: []
};
},
components: {
barChart,
pieChart
},
mounted() {
this.getDataList();
},
methods: {
//
getDataList() {
const data = {
storageType : 1
}
this.urlOptions.allURL(data).then((response) => {
this.overviewList = response.data;
this.$nextTick(() => {
this.$refs.barChart.initChart();
});
});
this.urlOptions.rateURL(data).then((response) => {
this.rateList = response.data;
this.$nextTick(() => {
this.$refs.pieChart.initChart();
});
});
},
},
};
</script>
<style scoped>
.chart-container {
min-height: calc(100vh - 120px - 8px);
background-color: #f0f2f7;
}
.chart-card {
min-height: calc(100vh - 120px - 8px);
background-color: #fff;
padding: 16px;
border-radius: 8px;
}
</style>

View File

@ -0,0 +1,156 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 13:52:10
* @LastEditors: zwq
* @LastEditTime: 2023-11-03 14:56:25
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
v-if="visible"
@keyup.enter.native="dataFormSubmit()"
label-width="100px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="名称" prop="name">
<el-input
v-model="dataForm.name"
clearable
placeholder="请输入名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="编码" prop="code">
<el-input
v-model="dataForm.code"
clearable
placeholder="请输入编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="规格" prop="spec">
<el-input
v-model="dataForm.spec"
clearable
placeholder="请输入规格" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单位" prop="unit">
<el-select
v-model="dataForm.unit"
filterable
clearable
:style="{ width: '100%' }"
placeholder="请选择单位">
<el-option
v-for="item in urlOptions.dictList.dict0"
:key="item.id"
:label="item.label"
:value="parseInt(item.value)"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单日消耗量" prop="dailyUse">
<el-input-number
v-model="dataForm.dailyUse"
clearable
placeholder="请输入单日消耗量" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="允许留存时间" prop="allowTime">
<el-input-number
v-model="dataForm.allowTime"
clearable
placeholder="请输入允许留存时间" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="enabled" label="是否可用">
<el-select
v-model="dataForm.enabled"
filterable
clearable
:style="{ width: '100%' }"
placeholder="请选择是否可用">
<el-option
v-for="item in isorno"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input
v-model="dataForm.remark"
clearable
placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import basicAdd from '../../mixins/basic-add';
import {
createWarehouseGoods,
updateWarehouseGoods,
getWarehouseGoods,
getCode,
} from '@/api/warehouse/warehouseGoods';
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
isGetCode: true,
getDictList: true,
codeURL: getCode,
createURL: createWarehouseGoods,
updateURL: updateWarehouseGoods,
infoURL: getWarehouseGoods,
},
nameList: ['unit_dict'],
dataForm: {
id: undefined,
code: '',
name: '',
spec: '',
unit: '',
dailyUse: 0,
allowTime: 0,
enabled: 1,
remark: '',
},
dataRule: {
code: [
{ required: true, message: '库位编码不能为空', trigger: 'blur' },
],
name: [
{ required: true, message: '库位名称不能为空', trigger: 'blur' },
],
},
isorno: [
{
id: 0,
name: '不可用',
},
{
id: 1,
name: '可用',
},
],
};
},
methods: {},
};
</script>

View File

@ -0,0 +1,183 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="80"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<!-- 对话框(添加 / 修改) -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import codeFilter from '../../mixins/code-filter';
import {
deleteWarehouseGoods,
getWarehouseGoodsPage,
} from "@/api/warehouse/warehouseGoods";
import { publicFormatter } from '@/utils/dict';
const tableProps = [
{
prop: 'name',
label: '名称',
},
{
prop: 'code',
label: '编码',
},
{
prop: 'spec',
label: '规格',
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('unit_dict')
},
{
prop: 'allowTime',
label: '允许留存时长(天)',
},
{
prop: 'dailyUse',
label: '单日消耗量',
},
{
prop: 'enabled',
label: '是否可用',
filter: codeFilter('deactivate'),
},
{
prop: 'remark',
label: '备注',
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getWarehouseGoodsPage,
deleteURL: deleteWarehouseGoods,
},
tableProps,
listQuery:{
storageType:1
},
tableBtn: [
this.$auth.hasPermi(`raw-material:warehouse-goods:update`)
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi(`raw-material:warehouse-goods:delete`)
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v)=>v),
tableData: [],
formConfig: [
{
type: 'input',
label: '名称',
placeholder: '名称',
param: 'name',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('raw-material:warehouse-goods:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true,
},
],
};
},
components: {
AddOrUpdate,
},
created() {},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.name = val.name;
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true;
this.addOrUpdateHandle();
break;
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
},
};
</script>

Some files were not shown because too many files have changed in this diff Show More