projects/mes-test #133
							
								
								
									
										73
									
								
								src/api/base/delivery.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										73
									
								
								src/api/base/delivery.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,73 @@
 | 
			
		||||
// 成品发货
 | 
			
		||||
import request from '@/utils/request'
 | 
			
		||||
// 获得成品发货清单分页
 | 
			
		||||
export function deliveryLogPage(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/extend/delivery-log/page',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 获取发货进度分页
 | 
			
		||||
export function deliveryProgressPage(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/extend/delivery-progress/page',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 获取发货进度分页
 | 
			
		||||
export function deliveryLogDetPage(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/extend/delivery-log-det/page',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 创建成品发货清单
 | 
			
		||||
export function deliveryLogCreate(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/extend/delivery-log/create',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 更新成品发货清单
 | 
			
		||||
export function deliveryLogUpdate(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/extend/delivery-log/update',
 | 
			
		||||
    method: 'put',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 获得成品发货清单
 | 
			
		||||
export function getDeliveryLog(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/extend/delivery-log/get',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 删除成品发货清单
 | 
			
		||||
export function deliveryLogDelete(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/extend/delivery-log/delete',
 | 
			
		||||
    method: 'delete',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 装车
 | 
			
		||||
export function deliveryLogDetCreate(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/extend/delivery-log-det/create',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
@@ -94,3 +94,47 @@ export function orderIssue(data) {
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 获得工单
 | 
			
		||||
export function getWorkOrderById(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/core-work-order/get',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 订单监控
 | 
			
		||||
export function orderMonitor(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/order/orderMonitor',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 获得所有客户列表
 | 
			
		||||
export function customerList() {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/core-customer/listAll',
 | 
			
		||||
    method: 'get'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 获得订单详情
 | 
			
		||||
export function orderDetail(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/order/getDetail',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 产品bom消耗信息
 | 
			
		||||
export function bomUseNum(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/material-product-bom/bomUseNum',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
@@ -14,4 +14,13 @@ export function getWorker(query) {
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 获得该班组其他可选组员列表(除去现有组员)
 | 
			
		||||
export function otherWorkerList(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/group-team-det/otherWorkerList',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
@@ -16,4 +16,13 @@ export function getSchedulingMonitoringRecord(query) {
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 获得所有列表
 | 
			
		||||
export function groupClassesListAll(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/group-classes/listAll',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										75
									
								
								src/api/warehouse/warehouse-info.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										75
									
								
								src/api/warehouse/warehouse-info.js
									
									
									
									
									
										Normal 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'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										76
									
								
								src/api/warehouse/warehouseGoods.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										76
									
								
								src/api/warehouse/warehouseGoods.js
									
									
									
									
									
										Normal 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'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										97
									
								
								src/api/warehouse/warehouseLocation.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										97
									
								
								src/api/warehouse/warehouseLocation.js
									
									
									
									
									
										Normal 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'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										83
									
								
								src/api/warehouse/warehouseRealtime.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										83
									
								
								src/api/warehouse/warehouseRealtime.js
									
									
									
									
									
										Normal 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'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										85
									
								
								src/api/warehouse/warehouseRealtimeLocation.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										85
									
								
								src/api/warehouse/warehouseRealtimeLocation.js
									
									
									
									
									
										Normal 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'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
@@ -180,6 +180,7 @@ input, textarea{
 | 
			
		||||
// 抽屉head区域---start
 | 
			
		||||
.el-drawer__header {
 | 
			
		||||
  padding-bottom: 20px;
 | 
			
		||||
  padding-left: 30px;
 | 
			
		||||
  margin-bottom: 23px;
 | 
			
		||||
  font-size: 20px;
 | 
			
		||||
  font-weight: 500;
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										162
									
								
								src/views/delivery/deliveryLog/components/addOrUpdate.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										162
									
								
								src/views/delivery/deliveryLog/components/addOrUpdate.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,162 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <el-form ref="addOrUpdate" :rules="rules" label-width="130px" :model="form">
 | 
			
		||||
    <el-row>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
        <el-form-item label="订单名" prop="orderId">
 | 
			
		||||
          <el-select v-model="form.orderId" placeholder="请选择" style="width: 100%;">
 | 
			
		||||
            <el-option
 | 
			
		||||
              v-for="item in orderList"
 | 
			
		||||
              :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="name">
 | 
			
		||||
          <el-input v-model="form.name"></el-input>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
    </el-row>
 | 
			
		||||
    <el-row>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
        <el-form-item label="发货时间" prop="deliveryTime">
 | 
			
		||||
          <el-date-picker
 | 
			
		||||
            v-model="form.deliveryTime"
 | 
			
		||||
            type="datetime"
 | 
			
		||||
            format='yyyy-MM-dd HH:mm:ss'
 | 
			
		||||
            value-format="timestamp"
 | 
			
		||||
            style="width: 100%;"
 | 
			
		||||
            placeholder="选择日期">
 | 
			
		||||
          </el-date-picker>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
        <el-form-item label="发货单号" prop="code">
 | 
			
		||||
          <el-input v-model="form.code"></el-input>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
    </el-row>
 | 
			
		||||
    <el-row>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
        <el-form-item label="发货负责人" prop="deliveryPersonId">
 | 
			
		||||
          <el-select v-model="form.deliveryPersonId" placeholder="请选择" style="width: 100%;">
 | 
			
		||||
            <el-option
 | 
			
		||||
              v-for="item in personList"
 | 
			
		||||
              :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="principal">
 | 
			
		||||
          <el-input v-model="form.principal"></el-input>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
    </el-row>
 | 
			
		||||
    <el-row>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
        <el-form-item label="运输联系方式" prop="principalCall">
 | 
			
		||||
          <el-input v-model="form.principalCall"></el-input>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
        <el-form-item label="运输费用" prop="principalCost">
 | 
			
		||||
          <el-input-number v-model="form.principalCost" :min="0" :max='9999999999' :precision='2'></el-input-number>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
    </el-row>
 | 
			
		||||
    <el-row>
 | 
			
		||||
      <el-col :span='24'>
 | 
			
		||||
        <el-form-item label="备注" prop="remark">
 | 
			
		||||
          <el-input v-model="form.remark"></el-input>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
    </el-row>
 | 
			
		||||
  </el-form>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import { orderList } from '@/api/base/orderManage'
 | 
			
		||||
import { getWorkerList } from '@/api/base/worker'
 | 
			
		||||
import { deliveryLogCreate, deliveryLogUpdate, getDeliveryLog } from '@/api/base/delivery'
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'AddOrUpdate',
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      form: {
 | 
			
		||||
        id: '',
 | 
			
		||||
        orderId: '',
 | 
			
		||||
        name: '',
 | 
			
		||||
        code: '',
 | 
			
		||||
        deliveryTime: null,
 | 
			
		||||
        deliveryPersonId: '',
 | 
			
		||||
        principal: '',
 | 
			
		||||
        principalCall: '',
 | 
			
		||||
        principalCost: 0.00,
 | 
			
		||||
        remark: ''
 | 
			
		||||
      },
 | 
			
		||||
      isEdit: false,
 | 
			
		||||
      rules: {
 | 
			
		||||
        orderId: [{ required: true, message: "订单名不能为空", trigger: "change" }],
 | 
			
		||||
        name: [{ required: true, message: "发货单名称不能为空", trigger: "blur" }],
 | 
			
		||||
        code: [{ required: true, message: "发货单号不能为空", trigger: "blur" }]
 | 
			
		||||
      },
 | 
			
		||||
      orderList: [],
 | 
			
		||||
      personList: []
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    init(id) {
 | 
			
		||||
      this.getSelectList()
 | 
			
		||||
      if (id) {
 | 
			
		||||
        this.form.id = id
 | 
			
		||||
        this.isEdit = true
 | 
			
		||||
        getDeliveryLog({id}).then(res => {
 | 
			
		||||
          this.form = res.data || {}
 | 
			
		||||
        })
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    getSelectList() {
 | 
			
		||||
      orderList().then(res => {
 | 
			
		||||
        this.orderList = res.data || []
 | 
			
		||||
      })
 | 
			
		||||
      getWorkerList().then(res => {
 | 
			
		||||
        this.personList = res.data || []
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    submitForm() {
 | 
			
		||||
      this.$refs['addOrUpdate'].validate((valid) => {
 | 
			
		||||
        if (valid) {
 | 
			
		||||
          console.log(this.form)
 | 
			
		||||
          if (this.isEdit) {
 | 
			
		||||
            //编辑
 | 
			
		||||
            deliveryLogUpdate({ ...this.form }).then((res) => {
 | 
			
		||||
              if (res.code === 0) {
 | 
			
		||||
                this.$modal.msgSuccess("操作成功");
 | 
			
		||||
                this.$emit('successSubmit')
 | 
			
		||||
              }
 | 
			
		||||
            })
 | 
			
		||||
          } else {
 | 
			
		||||
            deliveryLogCreate({ ...this.form }).then((res) => {
 | 
			
		||||
              if (res.code === 0) {
 | 
			
		||||
                this.$modal.msgSuccess("操作成功");
 | 
			
		||||
                this.$emit('successSubmit')
 | 
			
		||||
              }
 | 
			
		||||
            })
 | 
			
		||||
          }
 | 
			
		||||
        } else {
 | 
			
		||||
          return false
 | 
			
		||||
        }
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    formClear() {
 | 
			
		||||
      this.$refs.addOrUpdate.resetFields()
 | 
			
		||||
      this.form.principalCost = 0.00
 | 
			
		||||
      this.isEdit = false
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										170
									
								
								src/views/delivery/deliveryLog/components/deliveryLogDetail.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										170
									
								
								src/views/delivery/deliveryLog/components/deliveryLogDetail.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,170 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <el-drawer
 | 
			
		||||
    title="发货清单详情"
 | 
			
		||||
    size="60%"
 | 
			
		||||
    :append-to-body="true"
 | 
			
		||||
    :visible.sync="centervisible"
 | 
			
		||||
    @close='close'>
 | 
			
		||||
    <div class="box1">
 | 
			
		||||
      <el-row>
 | 
			
		||||
        <el-col :span='12'>
 | 
			
		||||
          <span class="title">订单名:</span>
 | 
			
		||||
          <span class="text">{{orderName ? orderName : '-'}}</span>
 | 
			
		||||
        </el-col>
 | 
			
		||||
        <el-col :span='12'>
 | 
			
		||||
          <span class="title">发货单号:</span>
 | 
			
		||||
          <span class="text">{{code ? code : '-'}}</span>
 | 
			
		||||
        </el-col>
 | 
			
		||||
      </el-row>
 | 
			
		||||
    </div>
 | 
			
		||||
    <div class="box2">
 | 
			
		||||
      <div class="boxTitle">
 | 
			
		||||
        <span class="blueTitle"></span>
 | 
			
		||||
        <span>详情</span>
 | 
			
		||||
      </div>
 | 
			
		||||
      <base-table
 | 
			
		||||
        :page="queryParams.pageNo"
 | 
			
		||||
        :limit="queryParams.pageSize"
 | 
			
		||||
        :table-props="tableProps"
 | 
			
		||||
        :table-data="tableData"
 | 
			
		||||
        :max-height="tableH"
 | 
			
		||||
      />
 | 
			
		||||
      <pagination
 | 
			
		||||
        :page.sync="queryParams.pageNo"
 | 
			
		||||
        :limit.sync="queryParams.pageSize"
 | 
			
		||||
        :total="total"
 | 
			
		||||
        @pagination="getList"
 | 
			
		||||
      />
 | 
			
		||||
    </div>
 | 
			
		||||
  </el-drawer>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import { parseTime } from '@/utils/ruoyi'
 | 
			
		||||
import { deliveryLogDetPage } from '@/api/base/delivery'
 | 
			
		||||
const tableProps = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'createTime',
 | 
			
		||||
    label: '添加时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 150
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'deliveryCarCode',
 | 
			
		||||
    label: '装车单号',
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'loadTime',
 | 
			
		||||
    label: '装车时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 150
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'productName',
 | 
			
		||||
    label: '装车产品'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'packagingSize',
 | 
			
		||||
    label: '装箱规格(片/箱)',
 | 
			
		||||
    width: 120
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'packagingNum',
 | 
			
		||||
    label: '箱数'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'quantity',
 | 
			
		||||
    label: '装车总量'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'productDate',
 | 
			
		||||
    label: '产品批次',
 | 
			
		||||
    minWidth: 150,
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  }
 | 
			
		||||
]
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'DeliveryLogDetail',
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      centervisible: false,
 | 
			
		||||
      queryParams: {
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        pageSize: 20,
 | 
			
		||||
        logId: ''
 | 
			
		||||
      },
 | 
			
		||||
      total: 0,
 | 
			
		||||
      tableProps,
 | 
			
		||||
      tableData: [],
 | 
			
		||||
      tableH: this.tableHeight(275),
 | 
			
		||||
      orderName: '',
 | 
			
		||||
      code: ''
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    window.addEventListener('resize', () => {
 | 
			
		||||
      this.tableH = this.tableHeight(275)
 | 
			
		||||
    })
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    init(param) {
 | 
			
		||||
      this.orderName = param.orderName
 | 
			
		||||
      this.code = param.code
 | 
			
		||||
      this.queryParams.logId = param.id
 | 
			
		||||
      this.centervisible = true
 | 
			
		||||
      this.getList()
 | 
			
		||||
    },
 | 
			
		||||
    getList() {
 | 
			
		||||
      deliveryLogDetPage({...this.queryParams}).then(res => {
 | 
			
		||||
        this.tableData = res.data.list || []
 | 
			
		||||
        this.total = res.data.total || 0
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    close() {
 | 
			
		||||
      this.orderName = ''
 | 
			
		||||
      this.code = ''
 | 
			
		||||
      this.queryParams.pageNo = 1
 | 
			
		||||
      this.queryParams.pageSize = 20
 | 
			
		||||
      this.queryParams.logId = ''
 | 
			
		||||
      this.tableData = []
 | 
			
		||||
      this.total = 0
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
<style scoped lang='scss'>
 | 
			
		||||
.boxTitle {
 | 
			
		||||
  display: inline-block;
 | 
			
		||||
  font-size: 16px;
 | 
			
		||||
  font-weight: 400;
 | 
			
		||||
  color: #000000;
 | 
			
		||||
  margin:0 10px 10px 0;
 | 
			
		||||
}
 | 
			
		||||
.blueTitle {
 | 
			
		||||
  content: '';
 | 
			
		||||
  display: inline-block;
 | 
			
		||||
  width: 4px;
 | 
			
		||||
  height: 18px;
 | 
			
		||||
  background-color: #0B58FF;
 | 
			
		||||
  border-radius: 1px;
 | 
			
		||||
  margin-right: 8px;
 | 
			
		||||
  vertical-align: bottom;
 | 
			
		||||
}
 | 
			
		||||
.box1 {
 | 
			
		||||
  padding: 8px 8px 8px 40px;
 | 
			
		||||
  .title {
 | 
			
		||||
    height: 16px;
 | 
			
		||||
    font-weight: 600;
 | 
			
		||||
    color: rgba(0,0,0,0.85);
 | 
			
		||||
  }
 | 
			
		||||
  .text {
 | 
			
		||||
    height: 16px;
 | 
			
		||||
    font-weight: 400;
 | 
			
		||||
    color: rgba(102,102,102,0.75);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
.box2 {
 | 
			
		||||
  padding:32px 32px 30px 30px;
 | 
			
		||||
  height: calc(100vh - 125px);
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										141
									
								
								src/views/delivery/deliveryLog/components/loadedPage.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										141
									
								
								src/views/delivery/deliveryLog/components/loadedPage.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,141 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <el-form ref="addOrUpdate" :rules="rules" label-width="130px" :model="form">
 | 
			
		||||
    <el-row>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
        <el-form-item label="发货单号">
 | 
			
		||||
          <el-input v-model="code" disabled></el-input>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
        <el-form-item label="装车单号" prop="deliveryCarCode">
 | 
			
		||||
          <el-input v-model="form.deliveryCarCode"></el-input>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
    </el-row>
 | 
			
		||||
    <el-row>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
        <el-form-item label="装车时间" prop="loadTime">
 | 
			
		||||
          <el-date-picker
 | 
			
		||||
            v-model="form.loadTime"
 | 
			
		||||
            type="datetime"
 | 
			
		||||
            format='yyyy-MM-dd HH:mm:ss'
 | 
			
		||||
            value-format="timestamp"
 | 
			
		||||
            style="width: 100%;"
 | 
			
		||||
            placeholder="选择日期">
 | 
			
		||||
          </el-date-picker>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
        <el-form-item label="车辆联系人" prop="contactPerson">
 | 
			
		||||
          <el-input v-model="form.contactPerson"></el-input>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
    </el-row>
 | 
			
		||||
    <el-row>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
        <el-form-item label="联系方式" prop="contactPersonCall">
 | 
			
		||||
          <el-input v-model="form.contactPersonCall"></el-input>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
        <el-form-item label="装车产品" prop="productId">
 | 
			
		||||
          <el-select v-model="form.productId" placeholder="请选择" style="width: 100%;">
 | 
			
		||||
            <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-row>
 | 
			
		||||
    <el-row>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
        <el-form-item label="装箱规格(片/箱)" prop="packagingSize">
 | 
			
		||||
          <el-input-number v-model="form.packagingSize" :min="0" :max='9999999999' style="width:100%"></el-input-number>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
        <el-form-item label="产品批次" prop="productDate">
 | 
			
		||||
          <el-input v-model="form.productDate" placeholder="多个批次用','隔开"></el-input>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
    </el-row>
 | 
			
		||||
    <el-row>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
        <el-form-item label="箱/托数" prop="packagingNum">
 | 
			
		||||
          <el-input-number v-model="form.packagingNum" :min="0" :max='9999999999' style="width:100%"></el-input-number>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
        <el-form-item label="装车总量" prop="quantity">
 | 
			
		||||
          <el-input-number v-model="form.quantity" :min="0" :max='9999999999' style="width:100%"></el-input-number>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
    </el-row>
 | 
			
		||||
  </el-form>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import { getProductAll } from '@/api/base/product'
 | 
			
		||||
import { deliveryLogDetCreate } from '@/api/base/delivery'
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'LoadedPage',
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      form: {
 | 
			
		||||
        logId: '',
 | 
			
		||||
        deliveryCarCode: '',
 | 
			
		||||
        loadTime: null,
 | 
			
		||||
        contactPerson: '',
 | 
			
		||||
        contactPersonCall: '',
 | 
			
		||||
        productId: '',
 | 
			
		||||
        packagingSize: null,
 | 
			
		||||
        productDate: '',
 | 
			
		||||
        packagingNum: null,
 | 
			
		||||
        quantity: null
 | 
			
		||||
      },
 | 
			
		||||
      code: '',
 | 
			
		||||
      rules: {
 | 
			
		||||
        deliveryCarCode: [{ required: true, message: "装车单号不能为空", trigger: "blur" }],
 | 
			
		||||
        productId: [{ required: true, message: "装车产品不能为空", trigger: "change" }],
 | 
			
		||||
        packagingSize: [{ required: true, message: "装箱规格不能为空", trigger: "blur" }],
 | 
			
		||||
        packagingNum: [{ required: true, message: "箱/托数不能为空", trigger: "blur" }],
 | 
			
		||||
        quantity: [{ required: true, message: "装车总量不能为空", trigger: "blur" }]
 | 
			
		||||
      },
 | 
			
		||||
      productList: []
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    init(id, code) {
 | 
			
		||||
      this.getSelectList()
 | 
			
		||||
      this.form.logId = id
 | 
			
		||||
      this.code = code
 | 
			
		||||
    },
 | 
			
		||||
    getSelectList() {
 | 
			
		||||
      getProductAll().then(res => {
 | 
			
		||||
        this.productList = res.data || []
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    submitForm() {
 | 
			
		||||
      this.$refs['addOrUpdate'].validate((valid) => {
 | 
			
		||||
        if (valid) {
 | 
			
		||||
          console.log(this.form)
 | 
			
		||||
          deliveryLogDetCreate({ ...this.form }).then((res) => {
 | 
			
		||||
            if (res.code === 0) {
 | 
			
		||||
              this.$modal.msgSuccess("操作成功");
 | 
			
		||||
              this.$emit('successSubmit')
 | 
			
		||||
            }
 | 
			
		||||
          })
 | 
			
		||||
        } else {
 | 
			
		||||
          return false
 | 
			
		||||
        }
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    formClear() {
 | 
			
		||||
      this.$refs.addOrUpdate.resetFields()
 | 
			
		||||
      this.code = ''
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										285
									
								
								src/views/delivery/deliveryLog/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										285
									
								
								src/views/delivery/deliveryLog/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,285 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
    <!-- 搜索工作栏 -->
 | 
			
		||||
    <search-bar
 | 
			
		||||
      :formConfigs="formConfig"
 | 
			
		||||
      ref="searchBarForm"
 | 
			
		||||
      @headBtnClick="buttonClick"
 | 
			
		||||
    />
 | 
			
		||||
    <!-- 列表 -->
 | 
			
		||||
    <base-table
 | 
			
		||||
      :page="queryParams.pageNo"
 | 
			
		||||
      :limit="queryParams.pageSize"
 | 
			
		||||
      :table-props="tableProps"
 | 
			
		||||
      :table-data="list"
 | 
			
		||||
      :max-height="tableH"
 | 
			
		||||
    >
 | 
			
		||||
      <method-btn
 | 
			
		||||
        v-if="tableBtn.length"
 | 
			
		||||
        slot="handleBtn"
 | 
			
		||||
        :width="160"
 | 
			
		||||
        label="操作"
 | 
			
		||||
        :method-list="tableBtn"
 | 
			
		||||
        @clickBtn="handleClick"
 | 
			
		||||
      />
 | 
			
		||||
    </base-table>
 | 
			
		||||
    <pagination
 | 
			
		||||
      :page.sync="queryParams.pageNo"
 | 
			
		||||
      :limit.sync="queryParams.pageSize"
 | 
			
		||||
      :total="total"
 | 
			
		||||
      @pagination="getList"
 | 
			
		||||
    />
 | 
			
		||||
    <!-- 新增 -->
 | 
			
		||||
    <base-dialog
 | 
			
		||||
			:dialogTitle="addOrEditTitle"
 | 
			
		||||
			:dialogVisible="centervisible"
 | 
			
		||||
			@cancel="handleCancel"
 | 
			
		||||
			@confirm="handleConfirm"
 | 
			
		||||
			:before-close="handleCancel"
 | 
			
		||||
			width="50%"
 | 
			
		||||
    >
 | 
			
		||||
			<add-or-update ref="addOrUpdate" @successSubmit="successSubmit" />
 | 
			
		||||
		</base-dialog>
 | 
			
		||||
    <!-- 装车 -->
 | 
			
		||||
    <base-dialog
 | 
			
		||||
			dialogTitle="装车"
 | 
			
		||||
			:dialogVisible="centervisible2"
 | 
			
		||||
			@cancel="handleCancel2"
 | 
			
		||||
			@confirm="handleConfirm2"
 | 
			
		||||
			:before-close="handleCancel2"
 | 
			
		||||
			width="50%"
 | 
			
		||||
    >
 | 
			
		||||
			<loaded-page ref="loadedPage" @successSubmit="successSubmit2" />
 | 
			
		||||
		</base-dialog>
 | 
			
		||||
    <!-- 发货详情 -->
 | 
			
		||||
    <delivery-log-detail ref='deliveryLogDetail' v-if='showDetail' />
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import { parseTime } from '@/utils/ruoyi'
 | 
			
		||||
import { deliveryLogPage, deliveryLogDelete } from '@/api/base/delivery'
 | 
			
		||||
import AddOrUpdate from './components/addOrUpdate'
 | 
			
		||||
import LoadedPage from './components/loadedPage'
 | 
			
		||||
import DeliveryLogDetail from './components/deliveryLogDetail.vue'
 | 
			
		||||
const tableProps = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'orderName',
 | 
			
		||||
    label: '订单名',
 | 
			
		||||
    minWidth: 100,
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'name',
 | 
			
		||||
    label: '发货单名称',
 | 
			
		||||
    minWidth: 100,
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'deliveryTime',
 | 
			
		||||
    label: '发货时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 150
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'code',
 | 
			
		||||
    label: '发货单号',
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'deliverPerName',
 | 
			
		||||
    label: '发货负责人',
 | 
			
		||||
    minWidth: 100
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'principal',
 | 
			
		||||
    label: '运输负责人',
 | 
			
		||||
    minWidth: 100
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'principalCall',
 | 
			
		||||
    label: '运输联系方式',
 | 
			
		||||
    minWidth: 110,
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'principalCost',
 | 
			
		||||
    label: '运输费用'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'remark',
 | 
			
		||||
    label: '备注',
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  }
 | 
			
		||||
]
 | 
			
		||||
export default {
 | 
			
		||||
  name: "DeliveryLog",
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      formConfig: [
 | 
			
		||||
        {
 | 
			
		||||
          type: 'input',
 | 
			
		||||
          label: '订单名',
 | 
			
		||||
          param: 'orderName'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'input',
 | 
			
		||||
          label: '发货单名称',
 | 
			
		||||
          param: 'name'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'input',
 | 
			
		||||
          label: '发货单号',
 | 
			
		||||
          param: 'code'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'button',
 | 
			
		||||
          btnName: '查询',
 | 
			
		||||
          name: 'search',
 | 
			
		||||
          color: 'primary'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'separate'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'button',
 | 
			
		||||
          btnName: '新增',
 | 
			
		||||
          name: 'add',
 | 
			
		||||
          color: 'success',
 | 
			
		||||
          plain: true
 | 
			
		||||
        }
 | 
			
		||||
      ],
 | 
			
		||||
      // 查询参数
 | 
			
		||||
      queryParams: {
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        pageSize: 20,
 | 
			
		||||
        orderName: '',
 | 
			
		||||
        code: '',
 | 
			
		||||
        name: ''
 | 
			
		||||
      },
 | 
			
		||||
      tableProps,
 | 
			
		||||
      list: [],
 | 
			
		||||
      tableH: this.tableHeight(260),
 | 
			
		||||
      total: 0,
 | 
			
		||||
      tableBtn: [
 | 
			
		||||
      this.$auth.hasPermi('base:group-team:update')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'loaded',
 | 
			
		||||
              btnName: '装车'
 | 
			
		||||
            }
 | 
			
		||||
          : undefined,
 | 
			
		||||
      this.$auth.hasPermi('base:group-team:update')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'detail',
 | 
			
		||||
              btnName: '详情'
 | 
			
		||||
            }
 | 
			
		||||
          : undefined,
 | 
			
		||||
        this.$auth.hasPermi('base:group-team:update')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'edit',
 | 
			
		||||
              btnName: '编辑'
 | 
			
		||||
            }
 | 
			
		||||
          : undefined,
 | 
			
		||||
        this.$auth.hasPermi('base:group-team:delete')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'delete',
 | 
			
		||||
              btnName: '删除'
 | 
			
		||||
            }
 | 
			
		||||
          : undefined
 | 
			
		||||
      ].filter((v) => v),
 | 
			
		||||
      addOrEditTitle: '',
 | 
			
		||||
      centervisible: false,
 | 
			
		||||
      centervisible2: false,
 | 
			
		||||
      showDetail: false
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  created() {
 | 
			
		||||
    window.addEventListener('resize', () => {
 | 
			
		||||
      this.tableH = this.tableHeight(260)
 | 
			
		||||
    })
 | 
			
		||||
    this.getList();
 | 
			
		||||
  },
 | 
			
		||||
  components: { AddOrUpdate, LoadedPage, DeliveryLogDetail },
 | 
			
		||||
  methods: {
 | 
			
		||||
    getList() {
 | 
			
		||||
      deliveryLogPage({...this.queryParams}).then(res => {
 | 
			
		||||
        this.list = res.data.list || []
 | 
			
		||||
        this.total = res.data.total || 0
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    buttonClick(val) {
 | 
			
		||||
      if (val.btnName === 'search') {
 | 
			
		||||
        this.queryParams.name = val.name
 | 
			
		||||
        this.queryParams.orderName = val.orderName
 | 
			
		||||
        this.queryParams.code = val.code
 | 
			
		||||
        this.getList()
 | 
			
		||||
      } else {
 | 
			
		||||
        this.addOrEditTitle = '新增'
 | 
			
		||||
        this.centervisible = true
 | 
			
		||||
        this.$nextTick(() => {
 | 
			
		||||
          this.$refs.addOrUpdate.init()
 | 
			
		||||
        })
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    handleClick(val) {
 | 
			
		||||
      console.log(val)
 | 
			
		||||
      switch (val.type) {
 | 
			
		||||
        case 'edit':
 | 
			
		||||
          this.addOrEditTitle = '编辑'
 | 
			
		||||
          this.centervisible = true
 | 
			
		||||
          this.$nextTick(() => {
 | 
			
		||||
            this.$refs.addOrUpdate.init(val.data.id)
 | 
			
		||||
          })
 | 
			
		||||
          break
 | 
			
		||||
        case 'delete':
 | 
			
		||||
          this.handleDelete(val.data)
 | 
			
		||||
          break
 | 
			
		||||
        case 'loaded':
 | 
			
		||||
          this.centervisible2 = true
 | 
			
		||||
          this.$nextTick(() => {
 | 
			
		||||
            this.$refs.loadedPage.init(val.data.id, val.data.code)
 | 
			
		||||
          })
 | 
			
		||||
          break
 | 
			
		||||
        default:
 | 
			
		||||
          this.showDetail = true
 | 
			
		||||
          this.$nextTick(() => {
 | 
			
		||||
            this.$refs.deliveryLogDetail.init(val.data)
 | 
			
		||||
          })
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    // 新增
 | 
			
		||||
    handleCancel() {
 | 
			
		||||
      this.$refs.addOrUpdate.formClear()
 | 
			
		||||
      this.centervisible = false
 | 
			
		||||
      this.addOrEditTitle = ''
 | 
			
		||||
    },
 | 
			
		||||
    handleConfirm() {
 | 
			
		||||
      this.$refs.addOrUpdate.submitForm()
 | 
			
		||||
    },
 | 
			
		||||
    successSubmit() {
 | 
			
		||||
      this.handleCancel()
 | 
			
		||||
      this.getList()
 | 
			
		||||
    },
 | 
			
		||||
    // 删除
 | 
			
		||||
    handleDelete(val) {
 | 
			
		||||
      this.$modal.confirm('是否确认删除发货单名为"' + val.name + '"的数据项?').then(function() {
 | 
			
		||||
          return deliveryLogDelete({ id: val.id })
 | 
			
		||||
        }).then(() => {
 | 
			
		||||
          this.getList();
 | 
			
		||||
          this.$modal.msgSuccess("操作成功");
 | 
			
		||||
        }).catch(() => {});
 | 
			
		||||
    },
 | 
			
		||||
    // 装车
 | 
			
		||||
    handleCancel2() {
 | 
			
		||||
      this.$refs.loadedPage.formClear()
 | 
			
		||||
      this.centervisible2 = false
 | 
			
		||||
    },
 | 
			
		||||
    handleConfirm2() {
 | 
			
		||||
      this.$refs.loadedPage.submitForm()
 | 
			
		||||
    },
 | 
			
		||||
    successSubmit2() {
 | 
			
		||||
      this.handleCancel2()
 | 
			
		||||
      this.getList()
 | 
			
		||||
    },
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
@@ -0,0 +1,365 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <el-drawer
 | 
			
		||||
    title="发货进度"
 | 
			
		||||
    :visible.sync="centervisible"
 | 
			
		||||
    size="80%"
 | 
			
		||||
    class="deliveryLogDetail"
 | 
			
		||||
    @close='closeA'>
 | 
			
		||||
    <div class="box1">
 | 
			
		||||
      <div class="box_col">
 | 
			
		||||
        <div class="blodTip">订单名</div>
 | 
			
		||||
        <div class="lightTip">{{orderMsg.orderName ? orderMsg.orderName : '-'}}</div>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="box_col">
 | 
			
		||||
        <div class="blodTip">订单数量</div>
 | 
			
		||||
        <div class="lightTip">{{orderMsg.orderNum ? orderMsg.orderNum : '-'}}</div>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="box_col">
 | 
			
		||||
        <div class="blodTip">装货数量</div>
 | 
			
		||||
        <div class="lightTip">{{orderMsg.num ? orderMsg.num : '-'}}</div>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="box_col">
 | 
			
		||||
        <div class="blodTip">累积占比(%)</div>
 | 
			
		||||
        <div class="lightTip">{{orderMsg.rate ? orderMsg.rate : '-'}}</div>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="box_col">
 | 
			
		||||
        <div class="blodTip">累积运输费用</div>
 | 
			
		||||
        <div class="lightTip">{{orderMsg.cost ? orderMsg.cost : '-'}}</div>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <div class="box2">
 | 
			
		||||
      <div class="boxTitle">
 | 
			
		||||
        <span class="blueTitle"></span>
 | 
			
		||||
        <span>发货清单</span>
 | 
			
		||||
      </div>
 | 
			
		||||
      <el-tabs v-model="activeName" @tab-click="toggleTab">
 | 
			
		||||
        <el-tab-pane label="数据列表" name="dataList">
 | 
			
		||||
          <!-- 列表 -->
 | 
			
		||||
          <base-table
 | 
			
		||||
            :page="queryParams.pageNo"
 | 
			
		||||
            :limit="queryParams.pageSize"
 | 
			
		||||
            :table-props="tableProps"
 | 
			
		||||
            :table-data="tableData"
 | 
			
		||||
            :max-height="tableH"
 | 
			
		||||
          >
 | 
			
		||||
            <method-btn
 | 
			
		||||
              v-if="tableBtn.length"
 | 
			
		||||
              slot="handleBtn"
 | 
			
		||||
              :width="150"
 | 
			
		||||
              label="操作"
 | 
			
		||||
              :method-list="tableBtn"
 | 
			
		||||
              @clickBtn="viewDetDetail"
 | 
			
		||||
            />
 | 
			
		||||
          </base-table>
 | 
			
		||||
          <pagination
 | 
			
		||||
            :page.sync="queryParams.pageNo"
 | 
			
		||||
            :limit.sync="queryParams.pageSize"
 | 
			
		||||
            :total="total"
 | 
			
		||||
            @pagination="getList"
 | 
			
		||||
          />
 | 
			
		||||
        </el-tab-pane>
 | 
			
		||||
        <el-tab-pane label="环形图" name="barChart">
 | 
			
		||||
          <div 
 | 
			
		||||
            id="logDetPieBar"
 | 
			
		||||
            style="width: 182px; height: 180px;"
 | 
			
		||||
          ></div>
 | 
			
		||||
        </el-tab-pane>
 | 
			
		||||
      </el-tabs>
 | 
			
		||||
    </div>
 | 
			
		||||
    <!-- 详情抽屉 -->
 | 
			
		||||
    <el-drawer
 | 
			
		||||
      title="发货详情"
 | 
			
		||||
      size="60%"
 | 
			
		||||
      :append-to-body="true"
 | 
			
		||||
      :visible.sync="innerDrawer"
 | 
			
		||||
      @close='closeB'>
 | 
			
		||||
      <div class="box3">
 | 
			
		||||
        <el-row>
 | 
			
		||||
          <el-col :span='12'>
 | 
			
		||||
            <span class="title">订单名:</span>
 | 
			
		||||
            <span class="text">{{orderMsg.orderName ? orderMsg.orderName : '-'}}</span>
 | 
			
		||||
          </el-col>
 | 
			
		||||
          <el-col :span='12'>
 | 
			
		||||
            <span class="title">发货单号:</span>
 | 
			
		||||
            <span class="text">{{logCode ? logCode : '-'}}</span>
 | 
			
		||||
          </el-col>
 | 
			
		||||
        </el-row>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="box4">
 | 
			
		||||
        <div class="boxTitle">
 | 
			
		||||
          <span class="blueTitle"></span>
 | 
			
		||||
          <span>详情</span>
 | 
			
		||||
        </div>
 | 
			
		||||
        <base-table
 | 
			
		||||
          :page="queryParams2.pageNo"
 | 
			
		||||
          :limit="queryParams2.pageSize"
 | 
			
		||||
          :table-props="tableProps2"
 | 
			
		||||
          :table-data="tableData2"
 | 
			
		||||
          :max-height="tableH2"
 | 
			
		||||
        />
 | 
			
		||||
        <pagination
 | 
			
		||||
          :page.sync="queryParams2.pageNo"
 | 
			
		||||
          :limit.sync="queryParams2.pageSize"
 | 
			
		||||
          :total="total2"
 | 
			
		||||
          @pagination="getList2"
 | 
			
		||||
        />
 | 
			
		||||
      </div>
 | 
			
		||||
    </el-drawer>
 | 
			
		||||
  </el-drawer>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import { deliveryLogPage, deliveryLogDetPage } from '@/api/base/delivery'
 | 
			
		||||
import { parseTime } from '@/utils/ruoyi'
 | 
			
		||||
const tableProps = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'deliveryTime',
 | 
			
		||||
    label: '发货时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 150
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'code',
 | 
			
		||||
    label: '发货单号',
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'orderNum',
 | 
			
		||||
    label: '订单数量'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'num',
 | 
			
		||||
    label: '发货数量'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'rate',
 | 
			
		||||
    label: '发货比列(%)'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'principalCost',
 | 
			
		||||
    label: '运输费用'
 | 
			
		||||
  }
 | 
			
		||||
]
 | 
			
		||||
const tableProps2 = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'createTime',
 | 
			
		||||
    label: '添加时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 150
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'deliveryCarCode',
 | 
			
		||||
    label: '装车单号',
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'loadTime',
 | 
			
		||||
    label: '装车时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 150
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'productName',
 | 
			
		||||
    label: '装车产品',
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'packagingSize',
 | 
			
		||||
    label: '装箱规格(片/箱)'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'packagingNum',
 | 
			
		||||
    label: '箱数'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'quantity',
 | 
			
		||||
    label: '装车总量'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'productDate',
 | 
			
		||||
    label: '产品批次',
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  }
 | 
			
		||||
]
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'DeliveryLogDetDetail',
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      centervisible: false,
 | 
			
		||||
      activeName: 'dataList',
 | 
			
		||||
      // 查询参数
 | 
			
		||||
      queryParams: {
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        pageSize: 100,
 | 
			
		||||
        orderId: ''
 | 
			
		||||
      },
 | 
			
		||||
      orderMsg: {},
 | 
			
		||||
      tableProps,
 | 
			
		||||
      tableData: [],
 | 
			
		||||
      tableH: this.tableHeight(350),
 | 
			
		||||
      tableBtn: [
 | 
			
		||||
        this.$auth.hasPermi('base:group-team:update')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'detDetail',
 | 
			
		||||
              btnName: '查看发货详情'
 | 
			
		||||
            }
 | 
			
		||||
          : undefined
 | 
			
		||||
      ].filter((v) => v),
 | 
			
		||||
      innerDrawer: false,
 | 
			
		||||
      // 详情
 | 
			
		||||
      queryParams2: {
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        pageSize: 20,
 | 
			
		||||
        logId: ''
 | 
			
		||||
      },
 | 
			
		||||
      tableProps2,
 | 
			
		||||
      tableData2: [],
 | 
			
		||||
      tableH2: this.tableHeight(275),
 | 
			
		||||
      total2: 0,
 | 
			
		||||
      logCode: ''
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    window.addEventListener('resize', () => {
 | 
			
		||||
      this.tableH = this.tableHeight(350)
 | 
			
		||||
    })
 | 
			
		||||
    window.addEventListener('resize', () => {
 | 
			
		||||
      this.tableH2 = this.tableHeight(275)
 | 
			
		||||
    })
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    init(params) {
 | 
			
		||||
      this.queryParams.orderId = params.orderId
 | 
			
		||||
      this.orderMsg = params
 | 
			
		||||
      this.centervisible = true
 | 
			
		||||
      this.getList()
 | 
			
		||||
    },
 | 
			
		||||
    getList() {
 | 
			
		||||
      deliveryLogPage({...this.queryParams}).then(res => {
 | 
			
		||||
        this.tableData = res.data.list || []
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    toggleTab() {
 | 
			
		||||
 | 
			
		||||
    },
 | 
			
		||||
    getBar() {
 | 
			
		||||
      
 | 
			
		||||
    },
 | 
			
		||||
    viewDetDetail(val) {
 | 
			
		||||
      this.logCode = val.data.code
 | 
			
		||||
      this.innerDrawer = true
 | 
			
		||||
      this.queryParams2.logId = val.data.id
 | 
			
		||||
      this.getList2()
 | 
			
		||||
    },
 | 
			
		||||
    closeA() {
 | 
			
		||||
      // 清空数据
 | 
			
		||||
      this.activeName = 'dataList'
 | 
			
		||||
      this.queryParams.orderId = ''
 | 
			
		||||
      this.tableData = []
 | 
			
		||||
      this.orderMsg = {}
 | 
			
		||||
      this.innerDrawer = false
 | 
			
		||||
    },
 | 
			
		||||
    getList2() {
 | 
			
		||||
      deliveryLogDetPage({...this.queryParams2}).then(res => {
 | 
			
		||||
        this.tableData2 = res.data.list || []
 | 
			
		||||
        this.total2 = res.data.total || 0
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    closeB() {
 | 
			
		||||
      this.logCode = ''
 | 
			
		||||
      this.queryParams2.pageNo = 1
 | 
			
		||||
      this.queryParams2.pageSize = 20
 | 
			
		||||
      this.queryParams2.logId = ''
 | 
			
		||||
      this.tableData2 = []
 | 
			
		||||
      this.total2 = 0
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
<style scoped lang='scss'>
 | 
			
		||||
.box1 {
 | 
			
		||||
  height: 56px;
 | 
			
		||||
  .box_col {
 | 
			
		||||
    display: inline-block;
 | 
			
		||||
    width: 20%;
 | 
			
		||||
    padding: 8px 8px 8px 40px;
 | 
			
		||||
    .blodTip {
 | 
			
		||||
      height: 16px;
 | 
			
		||||
      font-weight: 600;
 | 
			
		||||
      color: rgba(0,0,0,0.85);
 | 
			
		||||
      margin-bottom: 8px;
 | 
			
		||||
    }
 | 
			
		||||
    .lightTip {
 | 
			
		||||
      height: 16px;
 | 
			
		||||
      font-weight: 400;
 | 
			
		||||
      color: rgba(102,102,102,0.75);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
.box2 {
 | 
			
		||||
    padding:32px 32px 30px 30px;
 | 
			
		||||
    height: calc(100vh - 150px);
 | 
			
		||||
}
 | 
			
		||||
.boxTitle {
 | 
			
		||||
  display: inline-block;
 | 
			
		||||
  font-size: 16px;
 | 
			
		||||
  font-weight: 400;
 | 
			
		||||
  color: #000000;
 | 
			
		||||
  margin:0 10px 10px 0;
 | 
			
		||||
}
 | 
			
		||||
.blueTitle {
 | 
			
		||||
  content: '';
 | 
			
		||||
  display: inline-block;
 | 
			
		||||
  width: 4px;
 | 
			
		||||
  height: 18px;
 | 
			
		||||
  background-color: #0B58FF;
 | 
			
		||||
  border-radius: 1px;
 | 
			
		||||
  margin-right: 8px;
 | 
			
		||||
  vertical-align: bottom;
 | 
			
		||||
}
 | 
			
		||||
.box3 {
 | 
			
		||||
  padding: 8px 8px 8px 40px;
 | 
			
		||||
  .title {
 | 
			
		||||
    height: 16px;
 | 
			
		||||
    font-weight: 600;
 | 
			
		||||
    color: rgba(0,0,0,0.85);
 | 
			
		||||
  }
 | 
			
		||||
  .text {
 | 
			
		||||
    height: 16px;
 | 
			
		||||
    font-weight: 400;
 | 
			
		||||
    color: rgba(102,102,102,0.75);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
.box4 {
 | 
			
		||||
  padding:32px 32px 30px 30px;
 | 
			
		||||
  height: calc(100vh - 125px);
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
<style lang='scss'>
 | 
			
		||||
.deliveryLogDetail {
 | 
			
		||||
  .el-tabs__nav::after {
 | 
			
		||||
    content: "";
 | 
			
		||||
    position: absolute;
 | 
			
		||||
    left: 0;
 | 
			
		||||
    bottom: 0;
 | 
			
		||||
    width: 100%;
 | 
			
		||||
    height: 2px;
 | 
			
		||||
    background-color: #e4e7ed;
 | 
			
		||||
    /* z-index: 1; */
 | 
			
		||||
  }
 | 
			
		||||
  .el-tabs__nav-wrap::after {
 | 
			
		||||
    width: 0;
 | 
			
		||||
  }
 | 
			
		||||
  .el-tabs__item {
 | 
			
		||||
    padding: 0 10px;
 | 
			
		||||
  }
 | 
			
		||||
  .el-tabs__item:hover {
 | 
			
		||||
    color: rgba(0, 0, 0, 0.85);
 | 
			
		||||
  }
 | 
			
		||||
  .el-tabs__item.is-active {
 | 
			
		||||
    color: rgba(0, 0, 0, 0.85);
 | 
			
		||||
  }
 | 
			
		||||
  .el-tabs__item {
 | 
			
		||||
    color: rgba(0, 0, 0, 0.45);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										130
									
								
								src/views/delivery/deliveryLogDet/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										130
									
								
								src/views/delivery/deliveryLogDet/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,130 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
    <!-- 搜索工作栏 -->
 | 
			
		||||
    <search-bar
 | 
			
		||||
      :formConfigs="formConfig"
 | 
			
		||||
      ref="searchBarForm"
 | 
			
		||||
      @headBtnClick="buttonClick"
 | 
			
		||||
    />
 | 
			
		||||
    <!-- 列表 -->
 | 
			
		||||
    <base-table
 | 
			
		||||
      :page="queryParams.pageNo"
 | 
			
		||||
      :limit="queryParams.pageSize"
 | 
			
		||||
      :table-props="tableProps"
 | 
			
		||||
      :table-data="list"
 | 
			
		||||
      :max-height="tableH"
 | 
			
		||||
    >
 | 
			
		||||
      <method-btn
 | 
			
		||||
        v-if="tableBtn.length"
 | 
			
		||||
        slot="handleBtn"
 | 
			
		||||
        :width="80"
 | 
			
		||||
        label="操作"
 | 
			
		||||
        :method-list="tableBtn"
 | 
			
		||||
        @clickBtn="handleClick"
 | 
			
		||||
      />
 | 
			
		||||
    </base-table>
 | 
			
		||||
    <pagination
 | 
			
		||||
      :page.sync="queryParams.pageNo"
 | 
			
		||||
      :limit.sync="queryParams.pageSize"
 | 
			
		||||
      :total="total"
 | 
			
		||||
      @pagination="getList"
 | 
			
		||||
    />
 | 
			
		||||
    <!-- 详情抽屉 -->
 | 
			
		||||
    <delivery-log-det-detail ref='deliveryLogDetail'/>
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import { deliveryProgressPage } from '@/api/base/delivery'
 | 
			
		||||
import DeliveryLogDetDetail from './components/deliveryLogDetDetail.vue'
 | 
			
		||||
const tableProps = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'orderName',
 | 
			
		||||
    label: '订单名',
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'customerName',
 | 
			
		||||
    label: '客户名称',
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'unit',
 | 
			
		||||
    label: '单位'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'orderNum',
 | 
			
		||||
    label: '订单数量'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'num',
 | 
			
		||||
    label: '发货数量'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'rate',
 | 
			
		||||
    label: '累积发货比例(%)'
 | 
			
		||||
  }
 | 
			
		||||
]
 | 
			
		||||
export default {
 | 
			
		||||
  name: "DeliveryLogDet",
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      formConfig: [
 | 
			
		||||
        {
 | 
			
		||||
          type: 'input',
 | 
			
		||||
          label: '订单名',
 | 
			
		||||
          param: 'orderName'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'button',
 | 
			
		||||
          btnName: '查询',
 | 
			
		||||
          name: 'search',
 | 
			
		||||
          color: 'primary'
 | 
			
		||||
        }
 | 
			
		||||
      ],
 | 
			
		||||
      // 查询参数
 | 
			
		||||
      queryParams: {
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        pageSize: 20,
 | 
			
		||||
        orderName: ''
 | 
			
		||||
      },
 | 
			
		||||
      tableProps,
 | 
			
		||||
      list: [],
 | 
			
		||||
      tableH: this.tableHeight(260),
 | 
			
		||||
      total: 0,
 | 
			
		||||
      tableBtn: [
 | 
			
		||||
      this.$auth.hasPermi('base:group-team:update')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'detail',
 | 
			
		||||
              btnName: '详情'
 | 
			
		||||
            }
 | 
			
		||||
          : undefined
 | 
			
		||||
      ].filter((v) => v)
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  components: { DeliveryLogDetDetail },
 | 
			
		||||
  created() {
 | 
			
		||||
    window.addEventListener('resize', () => {
 | 
			
		||||
      this.tableH = this.tableHeight(260)
 | 
			
		||||
    })
 | 
			
		||||
    this.getList();
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    getList() {
 | 
			
		||||
      deliveryProgressPage({...this.queryParams}).then(res => {
 | 
			
		||||
        this.list = res.data.list || []
 | 
			
		||||
        this.total = res.data.total || 0
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    buttonClick(val) {
 | 
			
		||||
      this.queryParams.orderName = val.orderName
 | 
			
		||||
      this.getList()
 | 
			
		||||
    },
 | 
			
		||||
    handleClick(val) {
 | 
			
		||||
      console.log(val)
 | 
			
		||||
      this.$nextTick(() => {
 | 
			
		||||
        this.$refs.deliveryLogDetail.init(val.data)
 | 
			
		||||
      })
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
@@ -142,7 +142,7 @@ export default {
 | 
			
		||||
          {
 | 
			
		||||
            type: 'input',
 | 
			
		||||
            label: '关键字',
 | 
			
		||||
            placeholder: '关键字',
 | 
			
		||||
            placeholder: '姓名',
 | 
			
		||||
            param: 'workerName'
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
@@ -168,7 +168,7 @@ export default {
 | 
			
		||||
          {
 | 
			
		||||
            type: 'input',
 | 
			
		||||
            label: '关键字',
 | 
			
		||||
            placeholder: '关键字',
 | 
			
		||||
            placeholder: '姓名',
 | 
			
		||||
            param: 'workerName'
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
@@ -242,12 +242,13 @@ export default {
 | 
			
		||||
      this.getList()
 | 
			
		||||
    },
 | 
			
		||||
    handleClick(val) {
 | 
			
		||||
      console.log(val)
 | 
			
		||||
      switch (val.type) {
 | 
			
		||||
        case 'edit':
 | 
			
		||||
          this.addOrEditTitle = '编辑'
 | 
			
		||||
          this.centervisible = true
 | 
			
		||||
          this.$nextTick(() => {
 | 
			
		||||
            this.$refs.workerTeamAdd.init({'teamId': this.queryParams.teamId, id: val.data.id})
 | 
			
		||||
            this.$refs.workerTeamAdd.init({'teamId': this.queryParams.teamId, 'id': val.data.id, 'workName':val.data.workerName, 'majorName':val.data.workerMajorName})
 | 
			
		||||
          })
 | 
			
		||||
          break
 | 
			
		||||
        default:
 | 
			
		||||
@@ -266,6 +267,16 @@ export default {
 | 
			
		||||
        }).catch(() => {});
 | 
			
		||||
    },
 | 
			
		||||
    closeD() {
 | 
			
		||||
      this.teamData.teamName = ''
 | 
			
		||||
      this.teamData.leaderName = ''
 | 
			
		||||
      this.teamData.teamNum = ''
 | 
			
		||||
      this.teamData.leaderTelephone = ''
 | 
			
		||||
      this.teamData.teamId = ''
 | 
			
		||||
      this.queryParams.pageNo = 1
 | 
			
		||||
      this.queryParams.pageSize = 20
 | 
			
		||||
      this.queryParams.teamId = ''
 | 
			
		||||
      this.queryParams.workerName = ''
 | 
			
		||||
      this.total = 0
 | 
			
		||||
      this.$emit('closeDrawer')
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <el-form ref="form" :rules="rules" label-width="100px" :model="form">
 | 
			
		||||
    <el-form-item label="员工" prop="workerId">
 | 
			
		||||
    <el-form-item label="员工" prop="workerId" v-if='!isEdit'>
 | 
			
		||||
      <el-select v-model="form.workerId" placeholder="请选择" filterable style="width: 100%;" @change="selectWorker()">
 | 
			
		||||
        <el-option
 | 
			
		||||
          v-for="item in workerList"
 | 
			
		||||
@@ -10,6 +10,9 @@
 | 
			
		||||
        </el-option>
 | 
			
		||||
      </el-select>
 | 
			
		||||
    </el-form-item>
 | 
			
		||||
    <el-form-item label="员工" prop="workerId" v-if='isEdit'>
 | 
			
		||||
      <el-input v-model="workName" disabled></el-input>
 | 
			
		||||
    </el-form-item>
 | 
			
		||||
    <el-form-item label="专业" prop="majorName">
 | 
			
		||||
      <el-input v-model="form.majorName" disabled></el-input>
 | 
			
		||||
    </el-form-item>
 | 
			
		||||
@@ -19,7 +22,7 @@
 | 
			
		||||
  </el-form>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import { getWorkerList } from '@/api/base/worker'
 | 
			
		||||
import { otherWorkerList } from '@/api/base/worker'
 | 
			
		||||
import { teamDetCreate, teamDetUpdate, groupTeamDet } from '@/api/base/groupTeam'
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'WorkerTeamAdd',
 | 
			
		||||
@@ -33,6 +36,8 @@ export default {
 | 
			
		||||
        majorName: '',
 | 
			
		||||
        id: ''
 | 
			
		||||
      },
 | 
			
		||||
      isEdit: false,
 | 
			
		||||
      workName: '',//编辑时用
 | 
			
		||||
      rules: {
 | 
			
		||||
        workerId: [{ required: true, message: '员工不能为空', trigger: 'change' }]
 | 
			
		||||
      }
 | 
			
		||||
@@ -41,7 +46,9 @@ export default {
 | 
			
		||||
  methods: {
 | 
			
		||||
    init(param) {
 | 
			
		||||
      this.form.teamId = param.teamId
 | 
			
		||||
      getWorkerList().then(res => {
 | 
			
		||||
      this.form.majorName = param.majorName
 | 
			
		||||
      this.workName = param.workName
 | 
			
		||||
      otherWorkerList({teamId:this.form.teamId}).then(res => {
 | 
			
		||||
        this.workerList = res.data || []
 | 
			
		||||
        if (param.id) {
 | 
			
		||||
          this.isEdit = true
 | 
			
		||||
@@ -49,7 +56,6 @@ export default {
 | 
			
		||||
          groupTeamDet({id: this.form.id}).then((res) => {
 | 
			
		||||
            if (res.code === 0) {
 | 
			
		||||
              this.form.workerId = res.data.workerId
 | 
			
		||||
              this.selectWorker()
 | 
			
		||||
              this.form.remark = res.data.remark
 | 
			
		||||
            }
 | 
			
		||||
          })
 | 
			
		||||
@@ -106,6 +112,8 @@ export default {
 | 
			
		||||
    },
 | 
			
		||||
    formClear() {
 | 
			
		||||
      this.$refs.form.resetFields()
 | 
			
		||||
      this.workName = ''
 | 
			
		||||
      this.form.majorName = ''
 | 
			
		||||
      this.isEdit = false
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
@@ -34,36 +34,42 @@
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import { groupTeamSchedulingPage } from '@/api/monitoring/teamProduction'
 | 
			
		||||
import { groupTeamSchedulingPage, groupClassesListAll } from '@/api/monitoring/teamProduction'
 | 
			
		||||
import { parseTime } from '@/utils/ruoyi'
 | 
			
		||||
import TeamProductionDetail from './components/teamProductionDetail'
 | 
			
		||||
const tableProps = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'createTime',
 | 
			
		||||
    label: '排班创建时间',
 | 
			
		||||
    filter: parseTime
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 150
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'startDay',
 | 
			
		||||
    label: '上班日期'
 | 
			
		||||
    label: '上班日期',
 | 
			
		||||
    minWidth: 100
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'startTime',
 | 
			
		||||
    label: '上班时间',
 | 
			
		||||
    filter: parseTime
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 150
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'endTime',
 | 
			
		||||
    label: '下班时间',
 | 
			
		||||
    filter: parseTime
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 150
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'classesName',
 | 
			
		||||
    label: '班次名称'
 | 
			
		||||
    label: '班次名称',
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'teamName',
 | 
			
		||||
    label: '班组名称'
 | 
			
		||||
    label: '班组名称',
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  }
 | 
			
		||||
]
 | 
			
		||||
const tableBtn = [
 | 
			
		||||
@@ -93,8 +99,9 @@ export default {
 | 
			
		||||
          type: 'datePicker',
 | 
			
		||||
          label: '上班日期',
 | 
			
		||||
          dateType: 'date',
 | 
			
		||||
          format: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
          valueFormat: "timestamp",
 | 
			
		||||
          format: 'yyyy-MM-dd',
 | 
			
		||||
          valueFormat: 'yyyy-MM-dd',
 | 
			
		||||
          // valueFormat: "timestamp",
 | 
			
		||||
          param: 'startDay',
 | 
			
		||||
          defaultSelect: '',
 | 
			
		||||
          width: 200
 | 
			
		||||
@@ -117,7 +124,7 @@ export default {
 | 
			
		||||
      tableProps,
 | 
			
		||||
      tableBtn,
 | 
			
		||||
      list: [],
 | 
			
		||||
      tableH: this.tableHeight(220),
 | 
			
		||||
      tableH: this.tableHeight(260),
 | 
			
		||||
      total: 0,
 | 
			
		||||
      paramVisible: false
 | 
			
		||||
    }
 | 
			
		||||
@@ -125,25 +132,30 @@ export default {
 | 
			
		||||
  components: { TeamProductionDetail },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    window.addEventListener('resize', () => {
 | 
			
		||||
      this.tableH = this.tableHeight(220)
 | 
			
		||||
      this.tableH = this.tableHeight(260)
 | 
			
		||||
    })
 | 
			
		||||
    this.getGroupClass()
 | 
			
		||||
    this.getList()
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    buttonClick(val) {
 | 
			
		||||
      this.queryParams.pageNo = 1;
 | 
			
		||||
      this.queryParams.cnName = val.cnName
 | 
			
		||||
      this.queryParams.classesId = val.classesId
 | 
			
		||||
      this.queryParams.teamName = val.teamName
 | 
			
		||||
      this.queryParams.startDay = val.startDay
 | 
			
		||||
      this.getList()
 | 
			
		||||
    },
 | 
			
		||||
    getList() {
 | 
			
		||||
      groupTeamSchedulingPage().then(res => {
 | 
			
		||||
      groupTeamSchedulingPage({...this.queryParams}).then(res => {
 | 
			
		||||
        console.log(res)
 | 
			
		||||
        this.list = res.data.list || []
 | 
			
		||||
        this.total = res.data.total || 0
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    getGroupClass() {
 | 
			
		||||
      
 | 
			
		||||
      groupClassesListAll().then(res => {
 | 
			
		||||
        this.formConfig[0].selectOptions = res.data || []
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    handleClick(val) {
 | 
			
		||||
      console.log(val)
 | 
			
		||||
 
 | 
			
		||||
@@ -5,8 +5,8 @@
 | 
			
		||||
        <el-form-item label="工单名称" prop="name" v-if='!isBind'>
 | 
			
		||||
          <el-input v-model="form.name"></el-input>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-form-item label="产品名称" prop="orderId"  v-if='isBind'>
 | 
			
		||||
          <el-select v-model="form.orderId" placeholder="请选择" style="width: 100%;">
 | 
			
		||||
        <el-form-item label="工单名称" prop="workOrderId"  v-if='isBind'>
 | 
			
		||||
          <el-select v-model="form.workOrderId" placeholder="请选择" style="width: 100%;" @change="getWorkOrderMsg">
 | 
			
		||||
            <el-option
 | 
			
		||||
              v-for="item in workOrderList"
 | 
			
		||||
              :key="item.id"
 | 
			
		||||
@@ -25,7 +25,7 @@
 | 
			
		||||
    <el-row>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
        <el-form-item label="产品名称" prop="planProductId">
 | 
			
		||||
          <el-select v-model="form.planProductId" placeholder="请选择" style="width: 100%;" @change="selectProduct">
 | 
			
		||||
          <el-select v-model="form.planProductId" placeholder="请选择" :disabled="isBind"  style="width: 100%;" @change="selectProduct">
 | 
			
		||||
            <el-option
 | 
			
		||||
              v-for="item in productList"
 | 
			
		||||
              :key="item.id"
 | 
			
		||||
@@ -49,7 +49,8 @@
 | 
			
		||||
            type="datetime"
 | 
			
		||||
            value-format="yyyy-MM-dd HH:mm:ss"
 | 
			
		||||
            style="width: 100%;"
 | 
			
		||||
            placeholder="选择日期">
 | 
			
		||||
            placeholder="选择日期"
 | 
			
		||||
            :disabled="isBind">
 | 
			
		||||
          </el-date-picker>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
@@ -60,7 +61,8 @@
 | 
			
		||||
            type="datetime"
 | 
			
		||||
            value-format="yyyy-MM-dd HH:mm:ss"
 | 
			
		||||
            style="width: 100%;"
 | 
			
		||||
            placeholder="选择日期">
 | 
			
		||||
            placeholder="选择日期"
 | 
			
		||||
            :disabled="isBind">
 | 
			
		||||
          </el-date-picker>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
@@ -68,19 +70,19 @@
 | 
			
		||||
    <el-row>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
        <el-form-item label="计划投入数量" prop="planAssignQuantity">
 | 
			
		||||
          <el-input-number v-model="form.planAssignQuantity" :min="0" :max="9999999999999" style="width: 100%;"></el-input-number>
 | 
			
		||||
          <el-input-number v-model="form.planAssignQuantity" :min="0" :max="9999999999999" :disabled="isBind" 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="form.planQuantity" :min="0" :max="9999999999999" style="width: 100%;"></el-input-number>
 | 
			
		||||
          <el-input-number v-model="form.planQuantity" :min="0" :max="9999999999999" :disabled="isBind" 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="form.processFlowId" placeholder="请选择" style="width: 100%;">
 | 
			
		||||
          <el-select v-model="form.processFlowId" placeholder="请选择" :disabled="isBind" style="width: 100%;">
 | 
			
		||||
            <el-option
 | 
			
		||||
              v-for="item in processFlowList"
 | 
			
		||||
              :key="item.id"
 | 
			
		||||
@@ -92,7 +94,7 @@
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
        <el-form-item label="物料计算方式" prop="materialMethod">
 | 
			
		||||
          <el-radio-group v-model="form.materialMethod">
 | 
			
		||||
          <el-radio-group v-model="form.materialMethod" :disabled="isBind">
 | 
			
		||||
            <el-radio :label="1">产品基础</el-radio>
 | 
			
		||||
            <el-radio :label="2">工艺扩展</el-radio>
 | 
			
		||||
          </el-radio-group>
 | 
			
		||||
@@ -102,7 +104,7 @@
 | 
			
		||||
    <el-row>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
        <el-form-item label="优先级" prop="priority">
 | 
			
		||||
          <el-select v-model="form.priority" placeholder="请选择" style="width: 100%;">
 | 
			
		||||
          <el-select v-model="form.priority" placeholder="请选择" style="width: 100%;" :disabled="isBind">
 | 
			
		||||
            <el-option
 | 
			
		||||
              v-for="item in getDictDatas(DICT_TYPE.ORDER_PRIORITY)"
 | 
			
		||||
              :key="item.value"
 | 
			
		||||
@@ -114,7 +116,7 @@
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
        <el-form-item label="工单类型" prop="type">
 | 
			
		||||
          <el-select v-model="form.type" placeholder="请选择" style="width: 100%;">
 | 
			
		||||
          <el-select v-model="form.type" placeholder="请选择" style="width: 100%;" :disabled="isBind">
 | 
			
		||||
            <el-option
 | 
			
		||||
              v-for="item in workOrderTypeList"
 | 
			
		||||
              :key="item.id"
 | 
			
		||||
@@ -128,7 +130,7 @@
 | 
			
		||||
    <el-row>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
        <el-form-item label="关联产线" prop="productLineId">
 | 
			
		||||
          <el-select v-model="form.productLineId" placeholder="请选择" multiple style="width: 100%;">
 | 
			
		||||
          <el-select v-model="form.productLineId" placeholder="请选择" multiple style="width: 100%;" :disabled="isBind">
 | 
			
		||||
            <el-option
 | 
			
		||||
              v-for="item in productLineList"
 | 
			
		||||
              :key="item.id"
 | 
			
		||||
@@ -140,7 +142,7 @@
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
        <el-form-item label="负责人" prop="workers">
 | 
			
		||||
          <el-input v-model="form.workers"></el-input>
 | 
			
		||||
          <el-input v-model="form.workers" :disabled="isBind"></el-input>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
    </el-row>
 | 
			
		||||
@@ -155,8 +157,9 @@
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import { getProductAll } from '@/api/base/product'
 | 
			
		||||
import { getProcessFlowList, getWorkOrderCode, orderIssue, workOrderList } from '@/api/base/orderManage'
 | 
			
		||||
import { getProcessFlowList, getWorkOrderCode, orderIssue, workOrderList, getWorkOrderById } from '@/api/base/orderManage'
 | 
			
		||||
import { getLineAll } from '@/api/base/productionLine'
 | 
			
		||||
import moment from 'moment'
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'AddWorkOrder',
 | 
			
		||||
  data() {
 | 
			
		||||
@@ -185,7 +188,8 @@ export default {
 | 
			
		||||
        planProductId: [{ required: true, message: "产品名称不能为空", trigger: "change" }],
 | 
			
		||||
        planAssignQuantity: [{ required: true, message: "计划投入数量不能为空", trigger: "blur" }],
 | 
			
		||||
        planQuantity: [{ required: true, message: "计划生产数量不能为空", trigger: "blur" }],
 | 
			
		||||
        productLineId: [{ required: true, message: "产品不能为空", trigger: "change" }]
 | 
			
		||||
        productLineId: [{ required: true, message: "产线不能为空", trigger: "change" }],
 | 
			
		||||
        planAssignmentQuantity: [{ required: true, message: "计划分配订单量不能为空", trigger: "blur" }]
 | 
			
		||||
      },
 | 
			
		||||
      productList: [],
 | 
			
		||||
      processFlowList: [],
 | 
			
		||||
@@ -202,7 +206,6 @@ export default {
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    init(id, param) {
 | 
			
		||||
      console.log(id)
 | 
			
		||||
      this.form.orderId = id
 | 
			
		||||
      this.getList()
 | 
			
		||||
      if (param === 'add') {
 | 
			
		||||
@@ -249,33 +252,29 @@ export default {
 | 
			
		||||
    addWorkOrderSubmit() {
 | 
			
		||||
      this.$refs['addWorkOrder'].validate((valid) => {
 | 
			
		||||
        if (valid) {
 | 
			
		||||
          this.form.planStartTime = this.planStartTime ? new Date(this.planStartTime).valueOf() : ''
 | 
			
		||||
          this.form.planFinishTime = this.planFinishTime ? new Date(this.planFinishTime).valueOf() : ''
 | 
			
		||||
          console.log(this.form)
 | 
			
		||||
          orderIssue({ ...this.form }).then(res => {
 | 
			
		||||
            if (res.code === 0) {
 | 
			
		||||
              this.$modal.msgSuccess("操作成功")
 | 
			
		||||
              this.$emit('addWorkOrderSubmit')
 | 
			
		||||
            }
 | 
			
		||||
          })
 | 
			
		||||
          // if (this.isEdit) {
 | 
			
		||||
          //   //编辑
 | 
			
		||||
          //   orderUpdate({ ...this.form }).then((res) => {
 | 
			
		||||
          //     if (res.code === 0) {
 | 
			
		||||
          //       this.$modal.msgSuccess("操作成功");
 | 
			
		||||
          //       this.$emit('successSubmit')
 | 
			
		||||
          //     }
 | 
			
		||||
          //   })
 | 
			
		||||
          // } else {
 | 
			
		||||
          //   this.form.status = 1
 | 
			
		||||
          //   this.form.triggerOrigin = 1
 | 
			
		||||
          //   orderCreate({ ...this.form }).then((res) => {
 | 
			
		||||
          //     if (res.code === 0) {
 | 
			
		||||
          //       this.$modal.msgSuccess("操作成功");
 | 
			
		||||
          //       this.$emit('successSubmit')
 | 
			
		||||
          //     }
 | 
			
		||||
          //   })
 | 
			
		||||
          // }
 | 
			
		||||
          if (this.isBind) {
 | 
			
		||||
            //绑定工单
 | 
			
		||||
            orderIssue({
 | 
			
		||||
              workOrderId: this.form.workOrderId,
 | 
			
		||||
              orderId: this.form.orderId,
 | 
			
		||||
              planAssignmentQuantity: this.form.planAssignmentQuantity
 | 
			
		||||
             }).then((res) => {
 | 
			
		||||
              if (res.code === 0) {
 | 
			
		||||
                this.$modal.msgSuccess("操作成功")
 | 
			
		||||
                this.$emit('addWorkOrderSubmit')
 | 
			
		||||
              }
 | 
			
		||||
            })
 | 
			
		||||
          } else {
 | 
			
		||||
            // 新增工单
 | 
			
		||||
            this.form.planStartTime = this.planStartTime ? new Date(this.planStartTime).valueOf() : ''
 | 
			
		||||
            this.form.planFinishTime = this.planFinishTime ? new Date(this.planFinishTime).valueOf() : ''
 | 
			
		||||
            orderIssue({ ...this.form }).then(res => {
 | 
			
		||||
              if (res.code === 0) {
 | 
			
		||||
                this.$modal.msgSuccess("操作成功")
 | 
			
		||||
                this.$emit('addWorkOrderSubmit')
 | 
			
		||||
              }
 | 
			
		||||
            })
 | 
			
		||||
          }
 | 
			
		||||
        } else {
 | 
			
		||||
          return false
 | 
			
		||||
        }
 | 
			
		||||
@@ -283,6 +282,37 @@ export default {
 | 
			
		||||
    },
 | 
			
		||||
    formClear() {
 | 
			
		||||
      this.$refs.addWorkOrder.resetFields()
 | 
			
		||||
      this.form.materialMethod = 1
 | 
			
		||||
      this.form.planAssignQuantity = 0
 | 
			
		||||
      this.form.planQuantity = 0
 | 
			
		||||
      this.planFinishTime = ''
 | 
			
		||||
      this.planStartTime = ''
 | 
			
		||||
      this.form.planFinishTime = ''
 | 
			
		||||
      this.form.planStartTime = ''
 | 
			
		||||
      this.isBind = false
 | 
			
		||||
    },
 | 
			
		||||
    // 绑定工单,选择工单时获取工单信息
 | 
			
		||||
    getWorkOrderMsg() {
 | 
			
		||||
      if (this.form.workOrderId) {
 | 
			
		||||
        getWorkOrderById({id:this.form.workOrderId}).then(res => {
 | 
			
		||||
          if (res.code === 0) {
 | 
			
		||||
            this.form.code = res.data.code
 | 
			
		||||
            this.form.planProductId = res.data.planProductId
 | 
			
		||||
            this.selectProduct(this.form.planProductId)
 | 
			
		||||
            this.form.productSpec = res.data.productSpec
 | 
			
		||||
            this.planStartTime = res.data.planStartTime ? moment.unix(res.data.planStartTime).format('YYYY-MM-DD HH:mm:ss') : null
 | 
			
		||||
            this.planFinishTime = res.data.planFinishTime ? moment.unix(res.data.planFinishTime).format('YYYY-MM-DD HH:mm:ss') : null
 | 
			
		||||
            this.form.planAssignQuantity = res.data.planAssignQuantity
 | 
			
		||||
            this.form.planQuantity = res.data.planQuantity
 | 
			
		||||
            this.form.processFlowId = res.data.processFlowId
 | 
			
		||||
            this.form.materialMethod = res.data.materialMethod
 | 
			
		||||
            this.form.priority = res.data.priority ? res.data.priority + '' : ''
 | 
			
		||||
            this.form.productLineId = res.data.productLineIds
 | 
			
		||||
            this.form.type = res.data.type
 | 
			
		||||
            this.form.workers = res.data.workers
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,11 +0,0 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div>111</div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'BindWorkOrder',
 | 
			
		||||
  data() {
 | 
			
		||||
    return {}
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
@@ -50,28 +50,16 @@
 | 
			
		||||
      :before-close="addWorkOrderCancel"
 | 
			
		||||
      width='70%'
 | 
			
		||||
    >
 | 
			
		||||
      <add-work-order ref="addWorkOrder" @successSubmit="addWorkOrderSubmit" />
 | 
			
		||||
      <add-work-order ref="addWorkOrder" @addWorkOrderSubmit="addWorkOrderSubmit" />
 | 
			
		||||
    </base-dialog>
 | 
			
		||||
    <!-- 绑定工单 -->
 | 
			
		||||
    <!-- <base-dialog
 | 
			
		||||
      dialogTitle="绑定工单"
 | 
			
		||||
      :dialogVisible="bindWorkOrdervisible"
 | 
			
		||||
      @cancel="bindWorkOrderCancel"
 | 
			
		||||
      @confirm="bindWorkOrderConfirm"
 | 
			
		||||
      :before-close="bindWorkOrderCancel"
 | 
			
		||||
      width='70%'
 | 
			
		||||
    >
 | 
			
		||||
      <bind-work-order ref="bindWorkOrder" @successSubmit="bindWorkOrderSubmit" />
 | 
			
		||||
    </base-dialog> -->
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import { parseTime } from '@/utils/ruoyi'
 | 
			
		||||
import { getOrderPage, orderDelete } from '@/api/base/orderManage'
 | 
			
		||||
import { getOrderPage, orderDelete, customerList } from '@/api/base/orderManage'
 | 
			
		||||
import OrderAdd from './components/orderAdd'
 | 
			
		||||
import AddWorkOrder from './components/addWorkOrder'
 | 
			
		||||
import BindWorkOrder from './components/bindWorkOrder'
 | 
			
		||||
import { publicFormatter } from '@/utils/dict';
 | 
			
		||||
import { publicFormatter } from '@/utils/dict'
 | 
			
		||||
const tableProps = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'createTime',
 | 
			
		||||
@@ -81,7 +69,9 @@ const tableProps = [
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'name',
 | 
			
		||||
    label: '订单名称'
 | 
			
		||||
    label: '订单名称',
 | 
			
		||||
    minWidth: 120,
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'code',
 | 
			
		||||
@@ -90,7 +80,8 @@ const tableProps = [
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'customerId',
 | 
			
		||||
    label: '客户(?)'
 | 
			
		||||
    label: '客户',
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'triggerOrigin',
 | 
			
		||||
@@ -109,19 +100,22 @@ const tableProps = [
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'planQuantity',
 | 
			
		||||
    label: '计划加工量'
 | 
			
		||||
    label: '计划加工量',
 | 
			
		||||
    width: 90
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'actualQuantity',
 | 
			
		||||
    label: '实际加工量'
 | 
			
		||||
    label: '实际加工量',
 | 
			
		||||
    width: 90
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'planProductId',
 | 
			
		||||
    label: '产品(?)'
 | 
			
		||||
    prop: 'productName',
 | 
			
		||||
    label: '产品',
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'unit',
 | 
			
		||||
    label: '单位(?)'
 | 
			
		||||
    label: '单位'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'price',
 | 
			
		||||
@@ -229,26 +223,39 @@ export default {
 | 
			
		||||
      centervisible: false,
 | 
			
		||||
      priorityList: this.getDictDatas(this.DICT_TYPE.ORDER_PRIORITY),
 | 
			
		||||
      workIssueTitle: '',
 | 
			
		||||
      addWorkOrdervisible: false
 | 
			
		||||
      // bindWorkOrdervisible: false
 | 
			
		||||
      addWorkOrdervisible: false,
 | 
			
		||||
      orderDetailVisible: false
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  components: { OrderAdd, AddWorkOrder, BindWorkOrder },
 | 
			
		||||
  components: { OrderAdd, AddWorkOrder },
 | 
			
		||||
  created() {
 | 
			
		||||
    window.addEventListener('resize', () => {
 | 
			
		||||
      this.tableH = this.tableHeight(260)
 | 
			
		||||
    })
 | 
			
		||||
    this.getSelectList()
 | 
			
		||||
    this.getList();
 | 
			
		||||
    this.getList()
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    getSelectList() {
 | 
			
		||||
      console.log(this.getDictDatas(this.DICT_TYPE.ORDER_PRIORITY))
 | 
			
		||||
    },
 | 
			
		||||
    getList() {
 | 
			
		||||
      getOrderPage({...this.queryParams}).then(res => {
 | 
			
		||||
        this.list = res.data.records || []
 | 
			
		||||
        let arr = res.data.records || []
 | 
			
		||||
        this.total = res.data.total || 0
 | 
			
		||||
        if (arr.length > 0) {
 | 
			
		||||
          customerList().then(result => {
 | 
			
		||||
            let tempData = result.data || []
 | 
			
		||||
            if (tempData.length > 0) {
 | 
			
		||||
              arr.map(item => {
 | 
			
		||||
                for (let i of tempData) {
 | 
			
		||||
                  if (item.customerId === i.id) {
 | 
			
		||||
                    item.customerId = i.name
 | 
			
		||||
                  }
 | 
			
		||||
                }
 | 
			
		||||
              })
 | 
			
		||||
              this.list = arr
 | 
			
		||||
            }
 | 
			
		||||
          })
 | 
			
		||||
        }else {
 | 
			
		||||
          this.list = arr
 | 
			
		||||
        }
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    buttonClick(val) {
 | 
			
		||||
@@ -256,7 +263,7 @@ export default {
 | 
			
		||||
      if (val.btnName === 'search') {
 | 
			
		||||
        this.queryParams.name = val.name
 | 
			
		||||
        this.queryParams.status = val.status
 | 
			
		||||
        if (val.timeVal.length > 0) {
 | 
			
		||||
        if (val.timeVal && val.timeVal.length > 0) {
 | 
			
		||||
          this.queryParams.lastIssuedTime[0] = val.timeVal[0] + ' 00:00:00'
 | 
			
		||||
          this.queryParams.lastIssuedTime[1] = val.timeVal[1] + ' 23:59:59'
 | 
			
		||||
        } else {
 | 
			
		||||
@@ -285,6 +292,7 @@ export default {
 | 
			
		||||
          this.handleDelete(val.data)
 | 
			
		||||
          break
 | 
			
		||||
        case 'detail':
 | 
			
		||||
          this.$router.push({ name: 'OrderDetailData', params: { orderId: val.data.id }})
 | 
			
		||||
          break
 | 
			
		||||
        case 'add':
 | 
			
		||||
          this.workIssueTitle = '新增工单'
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										314
									
								
								src/views/order/base/orderManage/orderDetailData.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										314
									
								
								src/views/order/base/orderManage/orderDetailData.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,314 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="orderDetailData">
 | 
			
		||||
    <div class="box1">
 | 
			
		||||
      <div class="boxTitle">
 | 
			
		||||
        <span class="blueTitle"></span>
 | 
			
		||||
        <span>订单编码: 432784632747238</span>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div style="padding-left: 14px;">
 | 
			
		||||
        <el-row>
 | 
			
		||||
          <el-col :span='4'>
 | 
			
		||||
            <div class="blodTip">订单名</div>
 | 
			
		||||
            <div class="lightTip">{{orderMsg.name}}</div>
 | 
			
		||||
          </el-col>
 | 
			
		||||
          <el-col :span='4'>
 | 
			
		||||
            <div class="blodTip">产品信息</div>
 | 
			
		||||
            <div class="lightTip">{{orderMsg.productName}}</div>
 | 
			
		||||
          </el-col>
 | 
			
		||||
          <el-col :span='4'>
 | 
			
		||||
            <div class="blodTip">产品规格</div>
 | 
			
		||||
            <div class="lightTip">{{orderMsg.specifications}}</div>
 | 
			
		||||
          </el-col>
 | 
			
		||||
          <el-col :span='4'>
 | 
			
		||||
            <div class="blodTip">客户</div>
 | 
			
		||||
            <div class="lightTip">{{orderMsg.customerName}}</div>
 | 
			
		||||
          </el-col>
 | 
			
		||||
          <el-col :span='4'>
 | 
			
		||||
            <div class="blodTip">包装规格</div>
 | 
			
		||||
            <div class="lightTip">{{ getDictDataLabel(DICT_TYPE.PACK_SPEC, orderMsg.packSpec)}}</div>
 | 
			
		||||
          </el-col>
 | 
			
		||||
          <el-col :span='4'>
 | 
			
		||||
            <div class="blodTip">物料计算方式</div>
 | 
			
		||||
            <div class="lightTip">{{orderMsg.materialMethod ? (orderMsg.materialMethod === 1 ? '产品基础' : '工艺扩展') : ''}}</div>
 | 
			
		||||
          </el-col>
 | 
			
		||||
        </el-row>
 | 
			
		||||
        <el-row>
 | 
			
		||||
          <el-col :span='4'>
 | 
			
		||||
            <div class="blodTip">创建时间</div>
 | 
			
		||||
            <div class="lightTip">{{ parseTime(orderMsg.triggerTime) }}</div>
 | 
			
		||||
          </el-col>
 | 
			
		||||
          <el-col :span='4'>
 | 
			
		||||
            <div class="blodTip">计划开始时间</div>
 | 
			
		||||
            <div class="lightTip">{{ parseTime(orderMsg.planStartTime) }}</div>
 | 
			
		||||
          </el-col>
 | 
			
		||||
          <el-col :span='4'>
 | 
			
		||||
            <div class="blodTip">计划完成时间</div>
 | 
			
		||||
            <div class="lightTip">{{ parseTime(orderMsg.planFinishTime) }}</div>
 | 
			
		||||
          </el-col>
 | 
			
		||||
          <el-col :span='4'>
 | 
			
		||||
            <div class="blodTip">计划加工数量</div>
 | 
			
		||||
            <div class="lightTip">{{orderMsg.planQuantity}}</div>
 | 
			
		||||
          </el-col>
 | 
			
		||||
          <el-col :span='4'>
 | 
			
		||||
            <div class="blodTip">加工平方数(平方米)</div>
 | 
			
		||||
            <div class="lightTip">{{orderMsg.planArea}}</div>
 | 
			
		||||
          </el-col>
 | 
			
		||||
          <el-col :span='4'>
 | 
			
		||||
            <div class="blodTip">预计用时(时)</div>
 | 
			
		||||
            <div class="lightTip">{{ orderMsg.expectTime }}</div>
 | 
			
		||||
          </el-col>
 | 
			
		||||
        </el-row>
 | 
			
		||||
        <el-row>
 | 
			
		||||
          <el-col :span='4'>
 | 
			
		||||
            <div class="blodTip">状态</div>
 | 
			
		||||
            <div class="lightTip">{{getDictDataLabel(DICT_TYPE.ORDER_STATUS, orderMsg.status)}}</div>
 | 
			
		||||
          </el-col>
 | 
			
		||||
          <el-col :span='4'>
 | 
			
		||||
            <div class="blodTip">实际开始时间</div>
 | 
			
		||||
            <div class="lightTip">{{ parseTime(orderMsg.startProduceTime) }}</div>
 | 
			
		||||
          </el-col>
 | 
			
		||||
          <el-col :span='4'>
 | 
			
		||||
            <div class="blodTip">实际完成时间</div>
 | 
			
		||||
            <div class="lightTip">{{ parseTime(orderMsg.finishProduceTime) }}</div>
 | 
			
		||||
          </el-col>
 | 
			
		||||
          <el-col :span='4'>
 | 
			
		||||
            <div class="blodTip">实际生产数量</div>
 | 
			
		||||
            <div class="lightTip">{{orderMsg.actualQuantity	}}</div>
 | 
			
		||||
          </el-col>
 | 
			
		||||
          <el-col :span='4'>
 | 
			
		||||
            <div class="blodTip">完成比%</div>
 | 
			
		||||
            <div class="lightTip">{{orderMsg.completeProp}}</div>
 | 
			
		||||
          </el-col>
 | 
			
		||||
          <el-col :span='4'>
 | 
			
		||||
            <div class="blodTip">废片数量</div>
 | 
			
		||||
            <div class="lightTip">{{orderMsg.nokQuantity}}</div>
 | 
			
		||||
          </el-col>
 | 
			
		||||
        </el-row>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <div class="box2">
 | 
			
		||||
      <div class="boxTitle">
 | 
			
		||||
        <span class="blueTitle"></span>
 | 
			
		||||
        <span>工单信息</span>
 | 
			
		||||
      </div>
 | 
			
		||||
      <!-- 列表 -->
 | 
			
		||||
      <base-table
 | 
			
		||||
        :page="queryParams.pageNo"
 | 
			
		||||
        :limit="queryParams.pageSize"
 | 
			
		||||
        :table-props="tableProps1"
 | 
			
		||||
        :table-data="list1"
 | 
			
		||||
        :max-height="tableH"
 | 
			
		||||
      />
 | 
			
		||||
    </div>
 | 
			
		||||
    <div class="box3">
 | 
			
		||||
      <div class="boxTitle">
 | 
			
		||||
        <span class="blueTitle"></span>
 | 
			
		||||
        <span>预计用料信息</span>
 | 
			
		||||
      </div>
 | 
			
		||||
      <!-- 列表 -->
 | 
			
		||||
      <base-table
 | 
			
		||||
        :page="queryParams.pageNo"
 | 
			
		||||
        :limit="queryParams.pageSize"
 | 
			
		||||
        :table-props="tableProps2"
 | 
			
		||||
        :table-data="list2"
 | 
			
		||||
        :max-height="tableH"
 | 
			
		||||
      />
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import { parseTime } from '@/utils/ruoyi'
 | 
			
		||||
import { publicFormatter } from '@/utils/dict';
 | 
			
		||||
const tableProps1 = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'issueTime',
 | 
			
		||||
    label: '下发时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 150
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'name',
 | 
			
		||||
    label: '工单名',
 | 
			
		||||
    minWidth: 100,
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'code',
 | 
			
		||||
    label: '工单编码',
 | 
			
		||||
    minWidth: 150
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'planQuantity',
 | 
			
		||||
    label: '计划加工量',
 | 
			
		||||
    width: 90
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'actualQuantity',
 | 
			
		||||
    label: '实际加工量',
 | 
			
		||||
    width: 90
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'actualArea',
 | 
			
		||||
    label: '加工平方数',
 | 
			
		||||
    width: 90
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'status',
 | 
			
		||||
    label: '状态',
 | 
			
		||||
    filter: publicFormatter('order_status')
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'startProduceTime',
 | 
			
		||||
    label: '开始时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 150
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'finishProduceTime',
 | 
			
		||||
    label: '结束时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 150
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'productLineNames',
 | 
			
		||||
    label: '关联产线',
 | 
			
		||||
    filter: (val) => val.join(','),
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'workers',
 | 
			
		||||
    label: '负责人'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'remark',
 | 
			
		||||
    label: '备注'
 | 
			
		||||
  }
 | 
			
		||||
]
 | 
			
		||||
const tableProps2 = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'materialName',
 | 
			
		||||
    label: '物料名称'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'unit',
 | 
			
		||||
    label: '单位',
 | 
			
		||||
    filter: publicFormatter('unit_dict')
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'num',
 | 
			
		||||
    label: '剩余生产预计消耗'
 | 
			
		||||
  }
 | 
			
		||||
]
 | 
			
		||||
import { orderDetail, bomUseNum } from '@/api/base/orderManage'
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'OrderDetailData',
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      orderId: '',
 | 
			
		||||
      tableProps1,
 | 
			
		||||
      tableProps2,
 | 
			
		||||
      list1: [],
 | 
			
		||||
      list2: [],
 | 
			
		||||
      tableH: this.tableHeight(510) / 2,
 | 
			
		||||
      // 查询参数
 | 
			
		||||
      queryParams: {
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        pageSize: 500
 | 
			
		||||
      },
 | 
			
		||||
      orderMsg: {}
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    window.addEventListener('resize', () => {
 | 
			
		||||
      this.tableH = this.tableHeight(510) / 2
 | 
			
		||||
    })
 | 
			
		||||
    this.orderId = this.$route.params.orderId
 | 
			
		||||
    this.getMsg()
 | 
			
		||||
  },
 | 
			
		||||
  watch: {
 | 
			
		||||
    $route: 'initData'
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    initData(to) {
 | 
			
		||||
      if (to.name === 'OrderDetailData') {
 | 
			
		||||
        this.orderId = this.$route.params.orderId
 | 
			
		||||
        this.getMsg()
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    getMsg() {
 | 
			
		||||
      orderDetail({
 | 
			
		||||
        id: this.orderId
 | 
			
		||||
      }).then(res => {
 | 
			
		||||
        this.orderMsg = res.data
 | 
			
		||||
        this.list1 = res.data.coreWorkOrderRespVOS
 | 
			
		||||
        bomUseNum({
 | 
			
		||||
          productId: this.orderMsg.planProductId
 | 
			
		||||
        }).then(res2 => {
 | 
			
		||||
          if (res2.data && res2.data.length > 0) {
 | 
			
		||||
            let arr = res2.data
 | 
			
		||||
            arr.map(item => {
 | 
			
		||||
              if (item) {
 | 
			
		||||
                item.num = item.num * this.orderMsg.remainingQuantity
 | 
			
		||||
              }
 | 
			
		||||
            })
 | 
			
		||||
            this.list2 = arr
 | 
			
		||||
          }else {
 | 
			
		||||
            this.list2 = []
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
      })
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
<style lang='scss' scoped>
 | 
			
		||||
.orderDetailData {
 | 
			
		||||
  background-color: rgb(242, 244, 249);
 | 
			
		||||
  .box1, .box2, .box3 {
 | 
			
		||||
    background-color: #fff;
 | 
			
		||||
    border-radius: 9px;
 | 
			
		||||
  }
 | 
			
		||||
  .box2 {
 | 
			
		||||
    height: calc((100vh - 360px) / 2);
 | 
			
		||||
    padding: 12px 16px 0;
 | 
			
		||||
    margin: 8px 0;
 | 
			
		||||
  }
 | 
			
		||||
  .box1 {
 | 
			
		||||
    height: 215px;
 | 
			
		||||
    padding: 16px 16px 0 16px;
 | 
			
		||||
    .blodTip {
 | 
			
		||||
      height: 16px;
 | 
			
		||||
      font-weight: 600;
 | 
			
		||||
      color: rgba(0,0,0,0.85);
 | 
			
		||||
      margin-bottom: 8px;
 | 
			
		||||
    }
 | 
			
		||||
    .lightTip {
 | 
			
		||||
      height: 16px;
 | 
			
		||||
      font-weight: 400;
 | 
			
		||||
      color: rgba(102,102,102,0.75);
 | 
			
		||||
      margin-bottom: 12px;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  .box3 {
 | 
			
		||||
    padding: 16px;
 | 
			
		||||
    height: calc((100vh - 360px) / 2);
 | 
			
		||||
    }
 | 
			
		||||
  .boxTitle {
 | 
			
		||||
    display: inline-block;
 | 
			
		||||
    font-size: 16px;
 | 
			
		||||
    font-weight: 400;
 | 
			
		||||
    color: #000000;
 | 
			
		||||
    margin:0 10px 20px 0;
 | 
			
		||||
  }
 | 
			
		||||
  .blueTitle {
 | 
			
		||||
    content: '';
 | 
			
		||||
    display: inline-block;
 | 
			
		||||
    width: 4px;
 | 
			
		||||
    height: 18px;
 | 
			
		||||
    background-color: #0B58FF;
 | 
			
		||||
    border-radius: 1px;
 | 
			
		||||
    margin-right: 8px;
 | 
			
		||||
    vertical-align: bottom;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										383
									
								
								src/views/order/monitoring/orderCompletionMonitoring/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										383
									
								
								src/views/order/monitoring/orderCompletionMonitoring/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,383 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container orderMonitoring">
 | 
			
		||||
    <!-- 搜索工作栏 -->
 | 
			
		||||
    <search-bar
 | 
			
		||||
      :formConfigs="formConfig"
 | 
			
		||||
      ref="searchBarForm"
 | 
			
		||||
      @headBtnClick="buttonClick"
 | 
			
		||||
    />
 | 
			
		||||
    <el-tabs v-model="activeName" @tab-click="handleClick">
 | 
			
		||||
      <el-tab-pane label="数据列表" name="dataList">
 | 
			
		||||
        <!-- 列表 -->
 | 
			
		||||
        <base-table
 | 
			
		||||
          :page="queryParams.pageNo"
 | 
			
		||||
          :limit="queryParams.pageSize"
 | 
			
		||||
          :table-props="tableProps"
 | 
			
		||||
          :table-data="list"
 | 
			
		||||
          :max-height="tableH"
 | 
			
		||||
        >
 | 
			
		||||
          <method-btn
 | 
			
		||||
            v-if="tableBtn.length"
 | 
			
		||||
            slot="handleBtn"
 | 
			
		||||
            :width="250"
 | 
			
		||||
            label="操作"
 | 
			
		||||
            :method-list="tableBtn"
 | 
			
		||||
            @clickBtn="handleClick"
 | 
			
		||||
          />
 | 
			
		||||
        </base-table>
 | 
			
		||||
      </el-tab-pane>
 | 
			
		||||
      <el-tab-pane label="柱状图" name="barChart">
 | 
			
		||||
        <div class="boxTitle">
 | 
			
		||||
          <span class="blueTitle"></span>
 | 
			
		||||
          <span>各订单环形图</span>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div 
 | 
			
		||||
          id="orderPieBar"
 | 
			
		||||
          style="width: 182px; height: 180px;"
 | 
			
		||||
        ></div>
 | 
			
		||||
      </el-tab-pane>
 | 
			
		||||
    </el-tabs>
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import * as echarts from 'echarts'
 | 
			
		||||
import { parseTime } from '@/utils/ruoyi'
 | 
			
		||||
import { publicFormatter } from '@/utils/dict'
 | 
			
		||||
import { orderMonitor, orderList } from '@/api/base/orderManage'
 | 
			
		||||
const tableProps = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'name',
 | 
			
		||||
    label: '订单名称'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'customerName',
 | 
			
		||||
    label: '客户'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'productname',
 | 
			
		||||
    label: '产品'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'planStartTime',
 | 
			
		||||
    label: '计划开始时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 150
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'planFinishTime',
 | 
			
		||||
    label: '计划完成时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 150
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'status',
 | 
			
		||||
    label: '订单状态',
 | 
			
		||||
    filter: publicFormatter('order_priority')
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'startProduceTime',
 | 
			
		||||
    label: '实际开始时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 150
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'finishProduceTime',
 | 
			
		||||
    label: '实际完成时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 150
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'productLines',
 | 
			
		||||
    label: '加工线',
 | 
			
		||||
    filter: (val) => val ? val.join(',') : '',
 | 
			
		||||
    minWidth: 180
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'planQuantity',
 | 
			
		||||
    label: '计划生产量',
 | 
			
		||||
    width: 100
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'actualquantity',
 | 
			
		||||
    label: '实际产出量',
 | 
			
		||||
    width: 100
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'completeRate',
 | 
			
		||||
    label: '订单完成率',
 | 
			
		||||
    width: 100
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'workOrderNum',
 | 
			
		||||
    label: '关联工单数量',
 | 
			
		||||
    width: 100
 | 
			
		||||
  }
 | 
			
		||||
]
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'OrderCompletionMonitoring',
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      formConfig: [
 | 
			
		||||
        {
 | 
			
		||||
          type: 'select',
 | 
			
		||||
          label: '订单名称',
 | 
			
		||||
          selectOptions: [],
 | 
			
		||||
          param: 'name'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'datePicker',
 | 
			
		||||
          label: '时间段',
 | 
			
		||||
          dateType: 'daterange',
 | 
			
		||||
          format: 'yyyy-MM-dd',
 | 
			
		||||
          valueFormat: "yyyy-MM-dd",
 | 
			
		||||
          rangeSeparator: '-',
 | 
			
		||||
          startPlaceholder: '开始时间',
 | 
			
		||||
          endPlaceholder: '结束时间',
 | 
			
		||||
          param: 'timeVal',
 | 
			
		||||
          defaultSelect: [],
 | 
			
		||||
          width: 250
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'button',
 | 
			
		||||
          btnName: '查询',
 | 
			
		||||
          name: 'search',
 | 
			
		||||
          color: 'primary'
 | 
			
		||||
        }
 | 
			
		||||
      ],
 | 
			
		||||
      activeName: 'barChart',
 | 
			
		||||
      // 查询参数
 | 
			
		||||
      queryParams: {
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        pageSize: 20,
 | 
			
		||||
        name: null,
 | 
			
		||||
        startProduceTime: []
 | 
			
		||||
      },
 | 
			
		||||
      tableProps,
 | 
			
		||||
      list: [],
 | 
			
		||||
      tableH: this.tableHeight(270),
 | 
			
		||||
      total: 0,
 | 
			
		||||
      tableBtn: [
 | 
			
		||||
      this.$auth.hasPermi('base:group-team:update')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'orderDetail',
 | 
			
		||||
              btnName: '工单详情'
 | 
			
		||||
            }
 | 
			
		||||
          : undefined,
 | 
			
		||||
      this.$auth.hasPermi('base:group-team:update')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'qualityDetail',
 | 
			
		||||
              btnName: '质量详情'
 | 
			
		||||
            }
 | 
			
		||||
          : undefined,
 | 
			
		||||
      this.$auth.hasPermi('base:group-team:update')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'sendOutDetail',
 | 
			
		||||
              btnName: '发货详情'
 | 
			
		||||
            }
 | 
			
		||||
          : undefined
 | 
			
		||||
      ].filter((v) => v),
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    window.addEventListener('resize', () => {
 | 
			
		||||
      this.tableH = this.tableHeight(270)
 | 
			
		||||
    })
 | 
			
		||||
    this.getOrderList()
 | 
			
		||||
    this.getPage()
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    getOrderList() {
 | 
			
		||||
      orderList({}).then(res => {
 | 
			
		||||
        this.formConfig[0].selectOptions = res.data || []
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    getPage() {
 | 
			
		||||
      orderMonitor({...this.queryParams}).then(res => {
 | 
			
		||||
        this.list = res.data || []
 | 
			
		||||
        this.getPieChart()
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    // 饼图
 | 
			
		||||
    getPieChart() {
 | 
			
		||||
      var chartDom = document.getElementById('orderPieBar');
 | 
			
		||||
      var myChart = echarts.init(chartDom);
 | 
			
		||||
      var option;
 | 
			
		||||
 | 
			
		||||
      option = {
 | 
			
		||||
        color:['#288AFF','#7164FF','#fff','#63BDFF','#8EF0AB','#FFCE6A'],
 | 
			
		||||
        series: [
 | 
			
		||||
          {
 | 
			
		||||
            name: 'Access From',
 | 
			
		||||
            type: 'pie',
 | 
			
		||||
            radius: ['92%', '100%'],
 | 
			
		||||
            avoidLabelOverlap: false,
 | 
			
		||||
            label: {
 | 
			
		||||
              show: true,
 | 
			
		||||
              position: 'center'
 | 
			
		||||
            },
 | 
			
		||||
            emphasis: {
 | 
			
		||||
              disabled: true,
 | 
			
		||||
              scale:false,
 | 
			
		||||
              scaleSize: 0
 | 
			
		||||
            },
 | 
			
		||||
            labelLine: {
 | 
			
		||||
              show: false
 | 
			
		||||
            },
 | 
			
		||||
            data: [
 | 
			
		||||
              { value: 1000, name: '1' }
 | 
			
		||||
            ]
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            name: 'Access From',
 | 
			
		||||
            type: 'pie',
 | 
			
		||||
            radius: ['84%', '92%'],
 | 
			
		||||
            avoidLabelOverlap: false,
 | 
			
		||||
            label: {
 | 
			
		||||
              show: false,
 | 
			
		||||
              position: 'center'
 | 
			
		||||
            },
 | 
			
		||||
            emphasis: {
 | 
			
		||||
              disabled: true,
 | 
			
		||||
              scale:false,
 | 
			
		||||
              scaleSize: 0
 | 
			
		||||
            },
 | 
			
		||||
            labelLine: {
 | 
			
		||||
              show: false
 | 
			
		||||
            },
 | 
			
		||||
            data: [
 | 
			
		||||
              { value: 50 ,name: '2' },
 | 
			
		||||
              { value: 500, name: 'xxx' }
 | 
			
		||||
            ]
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            name: 'Access From',
 | 
			
		||||
            type: 'pie',
 | 
			
		||||
            radius: ['76%', '84%'],
 | 
			
		||||
            avoidLabelOverlap: false,
 | 
			
		||||
            label: {
 | 
			
		||||
              show: false,
 | 
			
		||||
              position: 'center'
 | 
			
		||||
            },
 | 
			
		||||
            emphasis: {
 | 
			
		||||
              disabled: true,
 | 
			
		||||
              scale:false,
 | 
			
		||||
              scaleSize: 0
 | 
			
		||||
            },
 | 
			
		||||
            labelLine: {
 | 
			
		||||
              show: false
 | 
			
		||||
            },
 | 
			
		||||
            data: [
 | 
			
		||||
              { value: 250, name: '3' },
 | 
			
		||||
              { value: 750, name: 'xxx' }
 | 
			
		||||
            ]
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            name: 'Access From',
 | 
			
		||||
            type: 'pie',
 | 
			
		||||
            radius: ['68%', '76%'],
 | 
			
		||||
            avoidLabelOverlap: false,
 | 
			
		||||
            label: {
 | 
			
		||||
              show: false,
 | 
			
		||||
              position: 'center'
 | 
			
		||||
            },
 | 
			
		||||
            emphasis: {
 | 
			
		||||
              disabled: true,
 | 
			
		||||
              scale:false,
 | 
			
		||||
              scaleSize: 0
 | 
			
		||||
            },
 | 
			
		||||
            labelLine: {
 | 
			
		||||
              show: false
 | 
			
		||||
            },
 | 
			
		||||
            data: [
 | 
			
		||||
              { value: 800, name: '4' },
 | 
			
		||||
              { value: 1048, name: 'xxx' }
 | 
			
		||||
            ]
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            name: 'Access From',
 | 
			
		||||
            type: 'pie',
 | 
			
		||||
            radius: ['60%', '68%'],
 | 
			
		||||
            avoidLabelOverlap: false,
 | 
			
		||||
            label: {
 | 
			
		||||
              show: false,
 | 
			
		||||
              position: 'center'
 | 
			
		||||
            },
 | 
			
		||||
            emphasis: {
 | 
			
		||||
              disabled: true,
 | 
			
		||||
              scale:false,
 | 
			
		||||
              scaleSize: 0
 | 
			
		||||
            },
 | 
			
		||||
            labelLine: {
 | 
			
		||||
              show: false
 | 
			
		||||
            },
 | 
			
		||||
            data: [
 | 
			
		||||
              { value: 1000, name: '5' },
 | 
			
		||||
              { value: 1048, name: 'xxx' }
 | 
			
		||||
            ]
 | 
			
		||||
          }
 | 
			
		||||
        ]
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      option && myChart.setOption(option)
 | 
			
		||||
    },
 | 
			
		||||
    // 查询
 | 
			
		||||
    buttonClick(val) {
 | 
			
		||||
      this.queryParams.name = val.name
 | 
			
		||||
      if (val.timeVal && val.timeVal.length > 0) {
 | 
			
		||||
        this.queryParams.startProduceTime[0] = val.timeVal[0] + ' 00:00:00'
 | 
			
		||||
        this.queryParams.startProduceTime[1] = val.timeVal[1] + ' 23:59:59'
 | 
			
		||||
      } else {
 | 
			
		||||
        this.queryParams.startProduceTime = []
 | 
			
		||||
      }
 | 
			
		||||
      this.getPage()
 | 
			
		||||
    },
 | 
			
		||||
    handleClick() {}
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
<style lang='scss'>
 | 
			
		||||
.orderMonitoring {
 | 
			
		||||
  .el-tabs__nav::after {
 | 
			
		||||
    content: "";
 | 
			
		||||
    position: absolute;
 | 
			
		||||
    left: 0;
 | 
			
		||||
    bottom: 0;
 | 
			
		||||
    width: 100%;
 | 
			
		||||
    height: 2px;
 | 
			
		||||
    background-color: #e4e7ed;
 | 
			
		||||
    /* z-index: 1; */
 | 
			
		||||
  }
 | 
			
		||||
  .el-tabs__nav-wrap::after {
 | 
			
		||||
    width: 0;
 | 
			
		||||
  }
 | 
			
		||||
  .el-tabs__item {
 | 
			
		||||
    padding: 0 10px;
 | 
			
		||||
  }
 | 
			
		||||
  .el-tabs__item:hover {
 | 
			
		||||
    color: rgba(0, 0, 0, 0.85);
 | 
			
		||||
  }
 | 
			
		||||
  .el-tabs__item.is-active {
 | 
			
		||||
    color: rgba(0, 0, 0, 0.85);
 | 
			
		||||
  }
 | 
			
		||||
  .el-tabs__item {
 | 
			
		||||
    color: rgba(0, 0, 0, 0.45);
 | 
			
		||||
  }
 | 
			
		||||
  .boxTitle {
 | 
			
		||||
    display: inline-block;
 | 
			
		||||
    font-size: 16px;
 | 
			
		||||
    font-weight: 400;
 | 
			
		||||
    color: #000000;
 | 
			
		||||
    margin:0 10px 20px 0;
 | 
			
		||||
  }
 | 
			
		||||
  .blueTitle {
 | 
			
		||||
    content: '';
 | 
			
		||||
    display: inline-block;
 | 
			
		||||
    width: 4px;
 | 
			
		||||
    height: 18px;
 | 
			
		||||
    background-color: #0B58FF;
 | 
			
		||||
    border-radius: 1px;
 | 
			
		||||
    margin-right: 8px;
 | 
			
		||||
    vertical-align: bottom;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										196
									
								
								src/views/warehouse/chart/BarChart.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										196
									
								
								src/views/warehouse/chart/BarChart.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
							
								
								
									
										173
									
								
								src/views/warehouse/chart/PieChart.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										173
									
								
								src/views/warehouse/chart/PieChart.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
							
								
								
									
										96
									
								
								src/views/warehouse/end-material/InventoryOverview/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										96
									
								
								src/views/warehouse/end-material/InventoryOverview/index.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
@@ -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>
 | 
			
		||||
							
								
								
									
										183
									
								
								src/views/warehouse/end-material/warehouseGoods/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										183
									
								
								src/views/warehouse/end-material/warehouseGoods/index.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
							
								
								
									
										192
									
								
								src/views/warehouse/end-material/warehouseHis/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										192
									
								
								src/views/warehouse/end-material/warehouseHis/index.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
@@ -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>
 | 
			
		||||
							
								
								
									
										223
									
								
								src/views/warehouse/end-material/warehouseLocationHis/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										223
									
								
								src/views/warehouse/end-material/warehouseLocationHis/index.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
@@ -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>
 | 
			
		||||
@@ -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>
 | 
			
		||||
							
								
								
									
										193
									
								
								src/views/warehouse/end-material/warehouseRealtime/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										193
									
								
								src/views/warehouse/end-material/warehouseRealtime/index.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
@@ -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>
 | 
			
		||||
@@ -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>
 | 
			
		||||
@@ -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>
 | 
			
		||||
@@ -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>
 | 
			
		||||
@@ -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>
 | 
			
		||||
@@ -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>
 | 
			
		||||
							
								
								
									
										121
									
								
								src/views/warehouse/mixins/basic-add.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										121
									
								
								src/views/warehouse/mixins/basic-add.js
									
									
									
									
									
										Normal 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();
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										170
									
								
								src/views/warehouse/mixins/basic-page.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										170
									
								
								src/views/warehouse/mixins/basic-page.js
									
									
									
									
									
										Normal 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(() => { });
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										73
									
								
								src/views/warehouse/mixins/code-filter.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										73
									
								
								src/views/warehouse/mixins/code-filter.js
									
									
									
									
									
										Normal 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]
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										46
									
								
								src/views/warehouse/mixins/inputArea.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										46
									
								
								src/views/warehouse/mixins/inputArea.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
							
								
								
									
										59
									
								
								src/views/warehouse/mixins/selectQuality.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										59
									
								
								src/views/warehouse/mixins/selectQuality.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
							
								
								
									
										96
									
								
								src/views/warehouse/out-material/InventoryOverview/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										96
									
								
								src/views/warehouse/out-material/InventoryOverview/index.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
@@ -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>
 | 
			
		||||
							
								
								
									
										183
									
								
								src/views/warehouse/out-material/warehouseGoods/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										183
									
								
								src/views/warehouse/out-material/warehouseGoods/index.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
							
								
								
									
										192
									
								
								src/views/warehouse/out-material/warehouseHis/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										192
									
								
								src/views/warehouse/out-material/warehouseHis/index.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
@@ -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>
 | 
			
		||||
							
								
								
									
										223
									
								
								src/views/warehouse/out-material/warehouseLocationHis/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										223
									
								
								src/views/warehouse/out-material/warehouseLocationHis/index.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
@@ -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>
 | 
			
		||||
@@ -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>
 | 
			
		||||
							
								
								
									
										193
									
								
								src/views/warehouse/out-material/warehouseRealtime/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										193
									
								
								src/views/warehouse/out-material/warehouseRealtime/index.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
@@ -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>
 | 
			
		||||
@@ -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>
 | 
			
		||||
@@ -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>
 | 
			
		||||
@@ -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>
 | 
			
		||||
@@ -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>
 | 
			
		||||
@@ -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>
 | 
			
		||||
@@ -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>
 | 
			
		||||
@@ -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>
 | 
			
		||||
							
								
								
									
										183
									
								
								src/views/warehouse/package-material/warehouseGoods/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										183
									
								
								src/views/warehouse/package-material/warehouseGoods/index.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
							
								
								
									
										192
									
								
								src/views/warehouse/package-material/warehouseHis/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										192
									
								
								src/views/warehouse/package-material/warehouseHis/index.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
@@ -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>
 | 
			
		||||
@@ -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>
 | 
			
		||||
@@ -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>
 | 
			
		||||
@@ -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>
 | 
			
		||||
							
								
								
									
										193
									
								
								src/views/warehouse/package-material/warehouseRealtime/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										193
									
								
								src/views/warehouse/package-material/warehouseRealtime/index.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
@@ -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>
 | 
			
		||||
@@ -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>
 | 
			
		||||
@@ -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>
 | 
			
		||||
@@ -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>
 | 
			
		||||
@@ -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>
 | 
			
		||||
@@ -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>
 | 
			
		||||
@@ -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>
 | 
			
		||||
@@ -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>
 | 
			
		||||
							
								
								
									
										183
									
								
								src/views/warehouse/part-material/warehouseGoods/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										183
									
								
								src/views/warehouse/part-material/warehouseGoods/index.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
							
								
								
									
										192
									
								
								src/views/warehouse/part-material/warehouseHis/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										192
									
								
								src/views/warehouse/part-material/warehouseHis/index.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
@@ -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>
 | 
			
		||||
							
								
								
									
										223
									
								
								src/views/warehouse/part-material/warehouseLocationHis/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										223
									
								
								src/views/warehouse/part-material/warehouseLocationHis/index.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
@@ -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>
 | 
			
		||||
@@ -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>
 | 
			
		||||
							
								
								
									
										193
									
								
								src/views/warehouse/part-material/warehouseRealtime/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										193
									
								
								src/views/warehouse/part-material/warehouseRealtime/index.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
@@ -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>
 | 
			
		||||
@@ -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>
 | 
			
		||||
@@ -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>
 | 
			
		||||
@@ -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>
 | 
			
		||||
@@ -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>
 | 
			
		||||
@@ -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>
 | 
			
		||||
							
								
								
									
										96
									
								
								src/views/warehouse/raw-material/InventoryOverview/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										96
									
								
								src/views/warehouse/raw-material/InventoryOverview/index.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
@@ -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>
 | 
			
		||||
							
								
								
									
										183
									
								
								src/views/warehouse/raw-material/warehouseGoods/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										183
									
								
								src/views/warehouse/raw-material/warehouseGoods/index.vue
									
									
									
									
									
										Normal 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>
 | 
			
		||||
							
								
								
									
										192
									
								
								src/views/warehouse/raw-material/warehouseHis/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										192
									
								
								src/views/warehouse/raw-material/warehouseHis/index.vue
									
									
									
									
									
										Normal 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: 1,
 | 
			
		||||
			},
 | 
			
		||||
			tableData: [],
 | 
			
		||||
			tableProps,
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
				this.$auth.hasPermi(`raw-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(1).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>
 | 
			
		||||
@@ -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>
 | 
			
		||||
							
								
								
									
										223
									
								
								src/views/warehouse/raw-material/warehouseLocationHis/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										223
									
								
								src/views/warehouse/raw-material/warehouseLocationHis/index.vue
									
									
									
									
									
										Normal 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: 1,
 | 
			
		||||
			},
 | 
			
		||||
			tableData: [],
 | 
			
		||||
			tableProps,
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
				this.$auth.hasPermi(`raw-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(1).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>
 | 
			
		||||
@@ -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>
 | 
			
		||||
@@ -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(1).then((response) => {
 | 
			
		||||
				this.goodsArr = response.data;
 | 
			
		||||
			});
 | 
			
		||||
			getWarehouseList().then((response) => {
 | 
			
		||||
				response.data.forEach((item) => {
 | 
			
		||||
					if (item.storageType === 1) {
 | 
			
		||||
						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>
 | 
			
		||||
							
								
								
									
										193
									
								
								src/views/warehouse/raw-material/warehouseRealtime/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										193
									
								
								src/views/warehouse/raw-material/warehouseRealtime/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,193 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2023-11-03 16:37:06
 | 
			
		||||
 * @LastEditors: zwq
 | 
			
		||||
 * @LastEditTime: 2023-11-04 14:13:47
 | 
			
		||||
 * @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="['raw-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: 1,
 | 
			
		||||
			},
 | 
			
		||||
			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('raw-material:warehouse-realtime:create') ? 'button' : '',
 | 
			
		||||
					btnName: '入库',
 | 
			
		||||
					name: 'add',
 | 
			
		||||
					color: 'success',
 | 
			
		||||
					plain: true,
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	components: {
 | 
			
		||||
		product,
 | 
			
		||||
		AddOrUpdate,
 | 
			
		||||
	},
 | 
			
		||||
	created() {
 | 
			
		||||
		getListByType(1).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>
 | 
			
		||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user