fix:产品库存数据展示调整
parent
cabdd4c531
commit
4b2e8538b1
|
|
@ -351,11 +351,7 @@
|
||||||
</div>
|
</div>
|
||||||
<el-table class="inventory-inner-table" v-loading="bindOrderLoading" :data="bindOrderList">
|
<el-table class="inventory-inner-table" v-loading="bindOrderLoading" :data="bindOrderList">
|
||||||
<el-table-column label="序号" type="index" width="50" align="center" :index="bindOrderIndex" />
|
<el-table-column label="序号" type="index" width="50" align="center" :index="bindOrderIndex" />
|
||||||
<el-table-column label="项目编号" align="center" prop="projectCode">
|
<el-table-column label="项目编号" align="center" prop="projectCode" />
|
||||||
<template slot-scope="scope">
|
|
||||||
<a @click="handleViewProject(scope.row)" class="link-type">{{ scope.row.projectCode }}</a>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="项目名称" align="center" prop="projectName" show-overflow-tooltip />
|
<el-table-column label="项目名称" align="center" prop="projectName" show-overflow-tooltip />
|
||||||
<el-table-column label="汇智负责人" align="center" prop="userName" />
|
<el-table-column label="汇智负责人" align="center" prop="userName" />
|
||||||
<el-table-column label="锁单量" align="center" prop="bindNum">
|
<el-table-column label="锁单量" align="center" prop="bindNum">
|
||||||
|
|
@ -376,8 +372,6 @@
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<project-detail-drawer :visible.sync="projectDrawerVisible" :project-id="currentProjectId" :z-index="4000" />
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -388,7 +382,6 @@ import InnerLog from './innerLog';
|
||||||
import OuterLog from './outerLog';
|
import OuterLog from './outerLog';
|
||||||
import OrderDetail from "@/views/inventory/inner/components/OrderDetail.vue";
|
import OrderDetail from "@/views/inventory/inner/components/OrderDetail.vue";
|
||||||
import ServiceDetail from "@/views/inventory/inner/components/ServiceDetail.vue";
|
import ServiceDetail from "@/views/inventory/inner/components/ServiceDetail.vue";
|
||||||
import ProjectDetailDrawer from "@/views/project/info/ProjectDetailDrawer.vue";
|
|
||||||
import ApproveLayout from "@/views/approve/ApproveLayout.vue";
|
import ApproveLayout from "@/views/approve/ApproveLayout.vue";
|
||||||
import PurchaseOrderDetailView from "@/views/purchaseorder/components/PurchaseOrderDetailView.vue";
|
import PurchaseOrderDetailView from "@/views/purchaseorder/components/PurchaseOrderDetailView.vue";
|
||||||
import { getPurchaseorder, getPurchaseOrderHistoryDetail } from "@/api/sip/purchaseorder";
|
import { getPurchaseorder, getPurchaseOrderHistoryDetail } from "@/api/sip/purchaseorder";
|
||||||
|
|
@ -400,7 +393,6 @@ export default {
|
||||||
OuterLog,
|
OuterLog,
|
||||||
OrderDetail,
|
OrderDetail,
|
||||||
ServiceDetail,
|
ServiceDetail,
|
||||||
ProjectDetailDrawer,
|
|
||||||
ApproveLayout,
|
ApproveLayout,
|
||||||
PurchaseOrderDetailView
|
PurchaseOrderDetailView
|
||||||
},
|
},
|
||||||
|
|
@ -426,8 +418,6 @@ export default {
|
||||||
open: false,
|
open: false,
|
||||||
// 是否显示详情抽屉
|
// 是否显示详情抽屉
|
||||||
drawerVisible: false,
|
drawerVisible: false,
|
||||||
projectDrawerVisible: false,
|
|
||||||
currentProjectId: null,
|
|
||||||
// 制造商选项
|
// 制造商选项
|
||||||
vendorOptions: [],
|
vendorOptions: [],
|
||||||
// 仓库选项
|
// 仓库选项
|
||||||
|
|
@ -780,10 +770,6 @@ export default {
|
||||||
this.purchaseOrderDetailOpen = false;
|
this.purchaseOrderDetailOpen = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleViewProject(row) {
|
|
||||||
this.currentProjectId = row.projectId;
|
|
||||||
this.projectDrawerVisible = true;
|
|
||||||
},
|
|
||||||
/** 处理锁单量 */
|
/** 处理锁单量 */
|
||||||
handleBindOrder(row) {
|
handleBindOrder(row) {
|
||||||
if (!row.warehouseId) {
|
if (!row.warehouseId) {
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
from oms_purchase_order as tt1
|
from oms_purchase_order as tt1
|
||||||
inner join oms_purchase_order_map as tt2 on tt1.id = tt2.purchase_id
|
inner join oms_purchase_order_map as tt2 on tt1.id = tt2.purchase_id
|
||||||
where tt1.purchase_no = t1.purchase_no and tt2.product_code = t2.product_code
|
where tt1.purchase_no = t1.purchase_no and tt2.product_code = t2.product_code
|
||||||
) as bind_num
|
) - sum(if(t2.inventory_status = 1, 1, 0)) as bind_num
|
||||||
from oms_inventory_inner as t1
|
from oms_inventory_inner as t1
|
||||||
inner join oms_inventory_info as t2 on t1.inner_code = t2.inner_code
|
inner join oms_inventory_info as t2 on t1.inner_code = t2.inner_code
|
||||||
<where>
|
<where>
|
||||||
|
|
@ -108,6 +108,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="warehouseId != null">and t2.warehouse_id = #{warehouseId}</if>
|
<if test="warehouseId != null">and t2.warehouse_id = #{warehouseId}</if>
|
||||||
</where>
|
</where>
|
||||||
group by t1.id
|
group by t1.id
|
||||||
|
having inventory_num > 0
|
||||||
order by t1.create_time desc
|
order by t1.create_time desc
|
||||||
</select>
|
</select>
|
||||||
<select id="selectMaxOrderCode" resultType="java.lang.Integer">
|
<select id="selectMaxOrderCode" resultType="java.lang.Integer">
|
||||||
|
|
|
||||||
|
|
@ -272,19 +272,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
t1.order_code,
|
t1.order_code,
|
||||||
t4.id as project_id,
|
t4.id as project_id,
|
||||||
t4.project_code,
|
t4.project_code,
|
||||||
sum(t2.bind_num) as bind_num,
|
sum(t2.bind_num) - ifnull(outer_num,0) as bind_num,
|
||||||
t4.project_name,
|
t4.project_name,
|
||||||
t5.user_name
|
t5.user_name
|
||||||
from project_order_info as t1
|
from project_order_info as t1
|
||||||
inner join oms_purchase_order_map as t2 on t1.id = t2.order_id
|
inner join oms_purchase_order_map as t2 on t1.id = t2.order_id
|
||||||
inner join oms_purchase_order as t3 on t2.purchase_id = t3.id
|
inner join oms_purchase_order as t3 on t2.purchase_id = t3.id
|
||||||
inner join project_info as t4 on t1.project_id = t4.id
|
inner join project_info as t4 on t1.project_id = t4.id
|
||||||
inner join sys_user as t5 on t4.hz_support_user = t5.user_id
|
left join sys_user as t5 on t4.hz_support_user = t5.user_id
|
||||||
|
left join (
|
||||||
|
select order_code, count(1) as outer_num
|
||||||
|
from oms_inventory_info
|
||||||
|
<where>
|
||||||
|
<if test="productCode != null and productCode != ''">and product_code = #{productCode}</if>
|
||||||
|
<if test="warehouseId != null">and warehouse_id = #{warehouseId}</if>
|
||||||
|
</where>
|
||||||
|
group by order_code
|
||||||
|
) as t6 on t1.order_code = t6.order_code
|
||||||
<where>
|
<where>
|
||||||
<if test="productCode != null and productCode != ''">and t2.product_code = #{productCode}</if>
|
<if test="productCode != null and productCode != ''">and t2.product_code = #{productCode}</if>
|
||||||
<if test="warehouseId != null">and t3.warehouse_id = #{warehouseId}</if>
|
<if test="warehouseId != null">and t3.warehouse_id = #{warehouseId}</if>
|
||||||
</where>
|
</where>
|
||||||
group by t1.id
|
group by t1.id
|
||||||
|
having bind_num != 0
|
||||||
order by t1.create_time desc
|
order by t1.create_time desc
|
||||||
</select>
|
</select>
|
||||||
<select id="listByItemId" resultType="com.ruoyi.sip.domain.OmsPurchaseOrderItem">
|
<select id="listByItemId" resultType="com.ruoyi.sip.domain.OmsPurchaseOrderItem">
|
||||||
|
|
|
||||||
|
|
@ -138,7 +138,7 @@
|
||||||
t2.inventory_num,
|
t2.inventory_num,
|
||||||
t2.outer_num,
|
t2.outer_num,
|
||||||
t2.purchase_num,
|
t2.purchase_num,
|
||||||
t2.bind_num,
|
ifnull(t2.bind_num,0) - ifnull(t2.outer_num,0) as bind_num,
|
||||||
ifnull(t2.inventory_num,0) + ifnull(t2.purchase_num,0) - (ifnull(t2.bind_num,0) - ifnull(t2.outer_num,0)) as usable_num
|
ifnull(t2.inventory_num,0) + ifnull(t2.purchase_num,0) - (ifnull(t2.bind_num,0) - ifnull(t2.outer_num,0)) as usable_num
|
||||||
FROM product_info t1
|
FROM product_info t1
|
||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue