Commit f9f7027d authored by krysent's avatar krysent

出库

parent 36f252db
......@@ -78,6 +78,7 @@ function Outstore(props) {
title: "任务单号",
dataIndex: "taskNo",
key: "taskNo",
search: false,
render: (dom, record) => {
return (
<a
......@@ -118,6 +119,7 @@ function Outstore(props) {
dataIndex: "materieName",
key: "materieName",
valueType: "select",
options: [
{
label: "生产领料出库",
......@@ -141,6 +143,7 @@ function Outstore(props) {
title: "规格型号",
dataIndex: "specificationModel",
key: "specificationModel",
search: false,
fieldProps: {
allowClear: true,
showSearch: true,
......@@ -165,11 +168,13 @@ function Outstore(props) {
title: "来源库位",
dataIndex: "sourceStorePositionName",
key: "sourceStorePositionName",
search: false,
},
{
title: "目标库位",
dataIndex: "targetStorePositionName",
key: "targetStorePositionName",
search: false,
},
{
title: "任务类型",
......@@ -204,12 +209,14 @@ function Outstore(props) {
title: "下发时间",
dataIndex: "distributeTime",
key: "distributeTime",
search: false,
},
{
title: "操作",
dataIndex: "options",
key: "options",
render:(text, record, _, action) => {
search: false,
render: (text, record, _, action) => {
return [
getPrem("equipmentCustomer_deleteById", action, "关单", null, {
title: "确认关单?",
......
......@@ -5,7 +5,7 @@ import EditTable from "@/components/EditTable";
import { useEffect, useState } from 'react'
import { useModel } from 'umi'
const EditUpload = ({ record, fid, storeId }) => {
const EditUpload = ({ record, fid, storeId ,formRef}) => {
const [value, setvalue] = useState({
[record.id]: record.downloadList
});
......@@ -595,7 +595,9 @@ const one = {
"key": "materieId",
"valueType": "select",
"request": async () => {
let res = await doFetch({ url: "/ngic-workmanship/pmMaterie/query/selectbox", params: {} })
let res = await doFetch({
url: "/ngic-workmanship/pmMaterie/selectboxByStoreId", params: {
} })
return res?.data?.dataList
},
"fieldProps": {
......
import React, { useEffect, useMemo, useRef, useState } from "react";
import { Dropdown, Menu, Button, message } from "antd";
import AutoTable from "@/components/AutoTable";
import defaultFields from "./fields";
// import defaultFields from "./fields";
import { doFetch } from "@/utils/doFetch";
import DrawInitForm from "@/components/DrawInitForm";
import getPrem from "@/utils/getPrem"; //权限判断fn
......@@ -41,6 +41,502 @@ const keytoval = {
four: "其他出库",
};
const defaultFields = {
four: {
materieOutstoreNo: {
value: null,
type: "input",
title: "出库单号",
name: ["materieOutstoreNo"],
required: false,
placeholder: "不填写系统自动生成",
},
storeId: {
value: null,
type: "select",
title: "出库仓库",
name: ["storeId"],
required: true,
options: {
database: () =>
doFetch({
url: "/ngic-auth/sysStore/selectionBox",
params: { factoryIdList: [] },
}),
params: {},
},
},
businessNo: {
value: null,
type: "input",
title: "相关单号",
name: ["businessNo"],
required: false,
},
remark: {
value: null,
type: "textarea",
title: "备注",
name: ["remark"],
required: false,
col: {
span: 24,
},
},
materialList: {
value: [],
title: "物料信息",
type: "table",
col: { span: 24 },
name: ["materialList"],
required: true,
linkconfig: {
urlchangeval: {
//根据url接口 改变某个value
database: (params) =>
doFetch({
url: "/ngic-workmanship/wmsMaterieStockStore/queryStoreOne",
params,
}),
params: { materieId: "linked" },
effectresult: {
productionUnit: "productionUnit", //key 为列表更新值 value为response 返回值
productionUnitName: "productionUnitName",
usableNum: "usableNum",
outstroeNum: "outstroeNum",
},
},
},
columns: [
{
title: (
<span>
物料编码-名称 <b style={{ color: "red" }}>*</b>
</span>
),
dataIndex: "materieId",
key: "materieId",
valueType: "select",
request: async () => {
let res = await doFetch({
url: "/ngic-workmanship/pmMaterie/selectboxByStoreId",
params: {storeId:formRef.current},
});
return res?.data?.dataList;
},
fieldProps: {
allowClear: true,
showSearch: true,
},
formItemProps: () => {
return {
rules: [{ required: true, message: "此项为必填项" }],
};
},
},
{
title: (
<span>
出库数量 <b style={{ color: "red" }}>*</b>
</span>
),
dataIndex: "outstroeNum",
key: "outstroeNum",
formItemProps: () => {
return {
rules: [{ required: true, message: "此项为必填项" }],
};
},
valueType: "digit",
fieldProps: {
precision: 3,
},
},
{
title: "可用库存",
dataIndex: "usableNum",
key: "usableNum",
readonly: "usableNum",
},
{
title: "库存单位",
dataIndex: "productionUnitName",
key: "productionUnitName",
readonly: "productionUnitName",
},
{
title: "操作",
valueType: "option",
width: 70,
render: (text, record, _, action) => [
<a key="delete" onClick={() => {}}>
删除
</a>,
],
},
],
rowKey: "id",
},
},
detail: (setselected, dom) => ({
totalCard: [
//物料详情
{
cardTitle: "基本信息",
itemData: [
{
title: "出库单号",
key: "materieOutstoreNo",
},
{
title: "出库类型",
key: "outstoreTypeName",
},
{
title: "出库仓库",
key: "storeName",
},
{
title: "相关单号",
key: "businessNo",
},
{
title: "创建人",
key: "createUserName",
},
{
title: "创建时间",
key: "createTime",
},
{
title: "状态",
key: "statusName",
},
{
title: "完成时间",
key: "finishTime",
},
{
title: "备注",
key: "remark",
noshow: "100%",
},
{
title: "工单条形码",
key: "qrCodeUrl",
type: "img",
noshow: true,
width: 100,
},
],
},
{
cardTitle: "物料信息列表",
extraContent: dom,
itemData: [
{
key: "materialList",
type: "table",
col: { span: 24 },
columns: [
{
title: "物料编码 - 名称",
dataIndex: "materieName",
key: "materieName",
search: false,
render: (dom, row) => {
return (
(row.materieCode ?? "") + " - " + (row.materieName ?? "")
);
},
},
{
title: "出库数量",
dataIndex: "outstroeNum",
key: "outstroeNum",
search: false,
},
{
title: "库存单位",
dataIndex: "productionUnitName",
key: "productionUnitName",
search: false,
},
{
title: "未下架数量",
dataIndex: "remainderNums",
key: "remainderNums",
search: false,
},
],
pagination: "false",
rowKey: "id",
expandable: {
expandedRowRender: (record) => (
<Table
style={{ marginLeft: 48 }}
columns={[
{
title: "库位名称",
dataIndex: "storePositionName",
key: "storePositionName",
search: false,
formItemProps: () => {
return {
rules: [{ required: true, message: "此项为必填项" }],
};
},
},
{
title: "批次号/SN号",
dataIndex: "materieControlNo",
key: "materieControlNo",
search: false,
},
{
title: "供应商编号-名称",
dataIndex: "supplierNo",
key: "supplierNo",
search: false,
render: (dom, row) => {
return (
(row?.supplierNo ?? "") +
" - " +
(row?.supplierName ?? "")
);
},
},
{
title: "下架数量",
dataIndex: "outstroeNum",
key: "outstroeNum",
search: false,
},
]}
dataSource={record.downloadList}
pagination={false}
/>
),
},
rowSelection: {
onChange: (selectedRowKeys, selectedRows) => {
setselected(selectedRows);
},
},
},
],
},
{
cardTitle: "强制关单信息",
itemData: [
{
title: "关单人",
key: "closeUserName",
},
{
title: "关单时间",
key: "closeTime",
},
],
},
{
cardTitle: "下架明细",
noPrint: true,
itemData: [
{
key: "materialDownloadList",
type: "table",
col: { span: 24 },
columns: [
{
title: "物料编码 - 名称",
dataIndex: "materieName",
key: "materieName",
search: false,
render: (dom, row) => {
return (
(row.materieCode ?? "") + " - " + (row.materieName ?? "")
);
},
},
{
title: "出库数量",
dataIndex: "outstroeNum",
key: "outstroeNum",
search: false,
},
{
title: "库存单位",
dataIndex: "productionUnitName",
key: "productionUnitName",
search: false,
},
],
expandable: {
defaultExpandAllRows: true,
expandedRowRender: (record) => (
<Table
style={{ marginLeft: 48 }}
columns={[
{
title: "库位名称",
dataIndex: "storePositionName",
key: "storePositionName",
search: false,
formItemProps: () => {
return {
rules: [{ required: true, message: "此项为必填项" }],
};
},
},
{
title: "批次号/SN号",
dataIndex: "materieControlNo",
key: "materieControlNo",
search: false,
},
{
title: "供应商编号 - 名称",
dataIndex: "supplierNo",
key: "supplierNo",
search: false,
render: (dom, row) => {
return (
(row.supplierNo ?? "") +
" - " +
(row.supplierName ?? "")
);
},
},
{
title: "下架数量",
dataIndex: "outstroeNum",
key: "outstroeNum",
search: false,
},
{
title: "备注",
dataIndex: "remark",
key: "remark",
search: false,
},
{
title: "操作人",
dataIndex: "downloadUserName",
key: "downloadUserName",
search: false,
},
{
title: "操作时间",
dataIndex: "downloadTime",
key: "downloadTime",
search: false,
},
]}
dataSource={record.downloadList}
pagination={false}
/>
),
},
pagination: "false",
},
],
},
],
}),
dooutside: (fid, storeId) => ({
totalCard: [
//物料详情
{
cardTitle: "基本信息",
itemData: [
{
title: "出库单号",
key: "materieOutstoreNo",
},
{
title: "出库类型",
key: "outstoreTypeName",
},
{
title: "出库仓库",
key: "storeName",
},
{
title: "相关单号",
key: "businessNo",
},
{
title: "备注",
key: "remark",
},
{
title: "创建人",
key: "createUserName",
},
{
title: "创建时间",
key: "createTime",
},
{
title: "状态",
key: "statusName",
},
],
},
{
cardTitle: "物料信息列表",
extra: true,
extrapath: "/ngic-workmanship/wmsMaterieOutstore/download",
extrakey: "submits", //redux key
itemData: [
{
key: "materialList",
type: "table",
col: { span: 24 },
columns: [
{
title: "物料编码 - 名称",
dataIndex: "materieName",
key: "materieName",
search: false,
render: (dom, row) => {
return (
(row.materieCode ?? "") + " - " + (row.materieName ?? "")
);
},
},
{
title: "出库数量",
dataIndex: "outstroeNum",
key: "outstroeNum",
search: false,
},
{
title: "库存单位",
dataIndex: "productionUnitName",
key: "productionUnitName",
search: false,
},
{
title: "未下架数量",
dataIndex: "remainderNums",
key: "remainderNums",
search: false,
},
],
expandable: {
expandedRowRender: (record) => (
<EditUpload record={record} fid={fid} storeId={storeId} />
),
},
},
],
},
],
}),
};
function Outstore(props) {
const { initialState, setInitialState } = useModel("@@initialState");
const [activeTabKey, onTabChange] = useState("1");
......@@ -421,27 +917,22 @@ function Outstore(props) {
...props,
pageextra:
activeTabKey == "1" ? (
<Dropdown
placement="bottomRight"
overlay={
<Menu
onClick={(e) => {
setdrawprops((s) => ({
...s,
visible: true,
title: "新增" + itemz[e.key],
fields: defaultFields[e.key],
outstoreType: keytoval[e.key],
val: "add", //类型
extra: null,
}));
}}
items={items}
/>
}
<Button
type="primary"
onClick={() => {
setdrawprops((s) => ({
...s,
visible: true,
title: "新增" + itemz["four"],
fields: defaultFields["four"],
outstoreType: keytoval["four"],
val: "add", //类型
extra: null,
}));
}}
>
<Button type="primary">新增</Button>
</Dropdown>
新增
</Button>
) : (
"none"
),
......@@ -500,7 +991,7 @@ function Outstore(props) {
for (let i in changedValues) {
if (i == "storeId") {
let res = await doFetch({
url: "/ngic-workmanship/wmsMaterieStockStore/selectbox/usableStock",
url: "/ngic-workmanship/pmMaterie/selectboxByStoreId",
params: { storeId: changedValues["storeId"] },
}),
options = res?.data?.dataList;
......@@ -562,6 +1053,9 @@ function Outstore(props) {
};
},
valueType: "digit",
fieldProps: {
precision: 3,
},
editable: true,
},
{
......
......@@ -149,6 +149,7 @@ function Outstore(props) {
dataIndex: "outstoreTypeName",
key: "outstoreType",
valueType: "select",
search: false,
options: [
{
label: "生产领料出库",
......@@ -171,6 +172,7 @@ function Outstore(props) {
{
title: "出库仓库",
dataIndex: "storeName",
search: false,
key: "storeId",
fieldProps: {
allowClear: true,
......@@ -194,18 +196,20 @@ function Outstore(props) {
{
title: "备注",
dataIndex: "remark",
search: false,
key: "remark",
search: false,
},
{
title: "创建人",
dataIndex: "createUserName",
key: "createUserName",
dataIndex: "applyUserName",
key: "applyUserName",
search: false,
},
{
title: "创建时间",
dataIndex: "createTime",
key: "createTime",
dataIndex: "applyTime",
key: "applyTimeList",
valueType: "dateRange",
formItemProps: {
name: "createTimeList",
......@@ -216,6 +220,7 @@ function Outstore(props) {
dataIndex: "statusName",
key: "status",
valueType: "select",
search: false,
options: [
{
label: "待下架",
......@@ -261,6 +266,7 @@ function Outstore(props) {
dataIndex: "outstoreTypeName",
key: "outstoreType",
valueType: "select",
search: false,
options: [
{
label: "生产领料出库",
......@@ -311,13 +317,15 @@ function Outstore(props) {
},
{
title: "创建人",
dataIndex: "createUserName",
key: "createUserName",
dataIndex: "applyUserName",
key: "applyUserName",
search: false,
},
{
title: "创建时间",
dataIndex: "createTime",
key: "createTime",
dataIndex: "applyTime",
key: "applyTimeList",
search: false,
valueType: "dateRange",
formItemProps: {
name: "createTimeList",
......@@ -336,6 +344,7 @@ function Outstore(props) {
title: "状态",
dataIndex: "statusName",
key: "status",
search: false,
valueType: "select",
options: [
{
......@@ -497,6 +506,9 @@ function Outstore(props) {
};
},
valueType: "digit",
fieldProps: {
precision: 3,
},
editable: true,
},
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment