Commit f9f7027d authored by krysent's avatar krysent

出库

parent 36f252db
...@@ -78,6 +78,7 @@ function Outstore(props) { ...@@ -78,6 +78,7 @@ function Outstore(props) {
title: "任务单号", title: "任务单号",
dataIndex: "taskNo", dataIndex: "taskNo",
key: "taskNo", key: "taskNo",
search: false,
render: (dom, record) => { render: (dom, record) => {
return ( return (
<a <a
...@@ -118,6 +119,7 @@ function Outstore(props) { ...@@ -118,6 +119,7 @@ function Outstore(props) {
dataIndex: "materieName", dataIndex: "materieName",
key: "materieName", key: "materieName",
valueType: "select", valueType: "select",
options: [ options: [
{ {
label: "生产领料出库", label: "生产领料出库",
...@@ -141,6 +143,7 @@ function Outstore(props) { ...@@ -141,6 +143,7 @@ function Outstore(props) {
title: "规格型号", title: "规格型号",
dataIndex: "specificationModel", dataIndex: "specificationModel",
key: "specificationModel", key: "specificationModel",
search: false,
fieldProps: { fieldProps: {
allowClear: true, allowClear: true,
showSearch: true, showSearch: true,
...@@ -165,11 +168,13 @@ function Outstore(props) { ...@@ -165,11 +168,13 @@ function Outstore(props) {
title: "来源库位", title: "来源库位",
dataIndex: "sourceStorePositionName", dataIndex: "sourceStorePositionName",
key: "sourceStorePositionName", key: "sourceStorePositionName",
search: false,
}, },
{ {
title: "目标库位", title: "目标库位",
dataIndex: "targetStorePositionName", dataIndex: "targetStorePositionName",
key: "targetStorePositionName", key: "targetStorePositionName",
search: false,
}, },
{ {
title: "任务类型", title: "任务类型",
...@@ -204,12 +209,14 @@ function Outstore(props) { ...@@ -204,12 +209,14 @@ function Outstore(props) {
title: "下发时间", title: "下发时间",
dataIndex: "distributeTime", dataIndex: "distributeTime",
key: "distributeTime", key: "distributeTime",
search: false,
}, },
{ {
title: "操作", title: "操作",
dataIndex: "options", dataIndex: "options",
key: "options", key: "options",
render:(text, record, _, action) => { search: false,
render: (text, record, _, action) => {
return [ return [
getPrem("equipmentCustomer_deleteById", action, "关单", null, { getPrem("equipmentCustomer_deleteById", action, "关单", null, {
title: "确认关单?", title: "确认关单?",
......
...@@ -5,7 +5,7 @@ import EditTable from "@/components/EditTable"; ...@@ -5,7 +5,7 @@ import EditTable from "@/components/EditTable";
import { useEffect, useState } from 'react' import { useEffect, useState } from 'react'
import { useModel } from 'umi' import { useModel } from 'umi'
const EditUpload = ({ record, fid, storeId }) => { const EditUpload = ({ record, fid, storeId ,formRef}) => {
const [value, setvalue] = useState({ const [value, setvalue] = useState({
[record.id]: record.downloadList [record.id]: record.downloadList
}); });
...@@ -595,7 +595,9 @@ const one = { ...@@ -595,7 +595,9 @@ const one = {
"key": "materieId", "key": "materieId",
"valueType": "select", "valueType": "select",
"request": async () => { "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 return res?.data?.dataList
}, },
"fieldProps": { "fieldProps": {
......
import React, { useEffect, useMemo, useRef, useState } from "react"; import React, { useEffect, useMemo, useRef, useState } from "react";
import { Dropdown, Menu, Button, message } from "antd"; import { Dropdown, Menu, Button, message } from "antd";
import AutoTable from "@/components/AutoTable"; import AutoTable from "@/components/AutoTable";
import defaultFields from "./fields"; // import defaultFields from "./fields";
import { doFetch } from "@/utils/doFetch"; import { doFetch } from "@/utils/doFetch";
import DrawInitForm from "@/components/DrawInitForm"; import DrawInitForm from "@/components/DrawInitForm";
import getPrem from "@/utils/getPrem"; //权限判断fn import getPrem from "@/utils/getPrem"; //权限判断fn
...@@ -41,6 +41,502 @@ const keytoval = { ...@@ -41,6 +41,502 @@ const keytoval = {
four: "其他出库", 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) { function Outstore(props) {
const { initialState, setInitialState } = useModel("@@initialState"); const { initialState, setInitialState } = useModel("@@initialState");
const [activeTabKey, onTabChange] = useState("1"); const [activeTabKey, onTabChange] = useState("1");
...@@ -421,27 +917,22 @@ function Outstore(props) { ...@@ -421,27 +917,22 @@ function Outstore(props) {
...props, ...props,
pageextra: pageextra:
activeTabKey == "1" ? ( activeTabKey == "1" ? (
<Dropdown <Button
placement="bottomRight" type="primary"
overlay={ onClick={() => {
<Menu setdrawprops((s) => ({
onClick={(e) => { ...s,
setdrawprops((s) => ({ visible: true,
...s, title: "新增" + itemz["four"],
visible: true, fields: defaultFields["four"],
title: "新增" + itemz[e.key], outstoreType: keytoval["four"],
fields: defaultFields[e.key], val: "add", //类型
outstoreType: keytoval[e.key], extra: null,
val: "add", //类型 }));
extra: null, }}
}));
}}
items={items}
/>
}
> >
<Button type="primary">新增</Button> 新增
</Dropdown> </Button>
) : ( ) : (
"none" "none"
), ),
...@@ -500,7 +991,7 @@ function Outstore(props) { ...@@ -500,7 +991,7 @@ function Outstore(props) {
for (let i in changedValues) { for (let i in changedValues) {
if (i == "storeId") { if (i == "storeId") {
let res = await doFetch({ let res = await doFetch({
url: "/ngic-workmanship/wmsMaterieStockStore/selectbox/usableStock", url: "/ngic-workmanship/pmMaterie/selectboxByStoreId",
params: { storeId: changedValues["storeId"] }, params: { storeId: changedValues["storeId"] },
}), }),
options = res?.data?.dataList; options = res?.data?.dataList;
...@@ -562,6 +1053,9 @@ function Outstore(props) { ...@@ -562,6 +1053,9 @@ function Outstore(props) {
}; };
}, },
valueType: "digit", valueType: "digit",
fieldProps: {
precision: 3,
},
editable: true, editable: true,
}, },
{ {
......
...@@ -149,6 +149,7 @@ function Outstore(props) { ...@@ -149,6 +149,7 @@ function Outstore(props) {
dataIndex: "outstoreTypeName", dataIndex: "outstoreTypeName",
key: "outstoreType", key: "outstoreType",
valueType: "select", valueType: "select",
search: false,
options: [ options: [
{ {
label: "生产领料出库", label: "生产领料出库",
...@@ -171,6 +172,7 @@ function Outstore(props) { ...@@ -171,6 +172,7 @@ function Outstore(props) {
{ {
title: "出库仓库", title: "出库仓库",
dataIndex: "storeName", dataIndex: "storeName",
search: false,
key: "storeId", key: "storeId",
fieldProps: { fieldProps: {
allowClear: true, allowClear: true,
...@@ -194,18 +196,20 @@ function Outstore(props) { ...@@ -194,18 +196,20 @@ function Outstore(props) {
{ {
title: "备注", title: "备注",
dataIndex: "remark", dataIndex: "remark",
search: false,
key: "remark", key: "remark",
search: false, search: false,
}, },
{ {
title: "创建人", title: "创建人",
dataIndex: "createUserName", dataIndex: "applyUserName",
key: "createUserName", key: "applyUserName",
search: false,
}, },
{ {
title: "创建时间", title: "创建时间",
dataIndex: "createTime", dataIndex: "applyTime",
key: "createTime", key: "applyTimeList",
valueType: "dateRange", valueType: "dateRange",
formItemProps: { formItemProps: {
name: "createTimeList", name: "createTimeList",
...@@ -216,6 +220,7 @@ function Outstore(props) { ...@@ -216,6 +220,7 @@ function Outstore(props) {
dataIndex: "statusName", dataIndex: "statusName",
key: "status", key: "status",
valueType: "select", valueType: "select",
search: false,
options: [ options: [
{ {
label: "待下架", label: "待下架",
...@@ -261,6 +266,7 @@ function Outstore(props) { ...@@ -261,6 +266,7 @@ function Outstore(props) {
dataIndex: "outstoreTypeName", dataIndex: "outstoreTypeName",
key: "outstoreType", key: "outstoreType",
valueType: "select", valueType: "select",
search: false,
options: [ options: [
{ {
label: "生产领料出库", label: "生产领料出库",
...@@ -311,13 +317,15 @@ function Outstore(props) { ...@@ -311,13 +317,15 @@ function Outstore(props) {
}, },
{ {
title: "创建人", title: "创建人",
dataIndex: "createUserName", dataIndex: "applyUserName",
key: "createUserName", key: "applyUserName",
search: false,
}, },
{ {
title: "创建时间", title: "创建时间",
dataIndex: "createTime", dataIndex: "applyTime",
key: "createTime", key: "applyTimeList",
search: false,
valueType: "dateRange", valueType: "dateRange",
formItemProps: { formItemProps: {
name: "createTimeList", name: "createTimeList",
...@@ -336,6 +344,7 @@ function Outstore(props) { ...@@ -336,6 +344,7 @@ function Outstore(props) {
title: "状态", title: "状态",
dataIndex: "statusName", dataIndex: "statusName",
key: "status", key: "status",
search: false,
valueType: "select", valueType: "select",
options: [ options: [
{ {
...@@ -497,6 +506,9 @@ function Outstore(props) { ...@@ -497,6 +506,9 @@ function Outstore(props) {
}; };
}, },
valueType: "digit", valueType: "digit",
fieldProps: {
precision: 3,
},
editable: true, 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