Commit 1c49e391 authored by krysent's avatar krysent

new

parent 9d98a45c
......@@ -63,6 +63,11 @@ export default [
name: "出入库记录",
component: "./historystore/Histore",
},
{
path: "/wms/task",
name: "任务单管理",
component: "./Task",
},
{
component: "./404",
},
......
import { factorySelect, shopSelectByFactory } from "@/services/system";
import { doFetch } from "@/utils/doFetch";
import { Button, Table } from "antd";
import EditTable from "@/components/EditTable";
import { useEffect, useState } from 'react'
import { useModel } from 'umi'
const EditUpload = ({ record, fid, storeId }) => {
const [value, setvalue] = useState({
[record.id]: record.downloadList
});
const { initialState, setInitialState } = useModel("@@initialState");
useEffect(() => {
if (!value) {
return
}
let newlist = Object.keys(value)?.map?.(it => {
let id = it;
let newArr = value[id]?.filter(it => typeof (it.id) == "number") ?? [];
return {
id,
downloadList: newArr.map(its => {
return {
storePositionId: its?.storePositionId,
outstroeNum: its?.outstroeNum,
stockNum: its?.stockNum,
remark: its?.remark,
materieControlNo: its?.materieControlNo
}
})
}
}) ?? [];
setInitialState(s => {
return ({
...s,
submits: {
id: fid,
materialList: (s.submits && s?.submits?.materialList) ? s?.submits?.materialList?.filter(it => newlist.map(item => item.id).indexOf(it.id) == -1)?.concat(newlist)?.filter(it => it.downloadList?.length > 0) : []
}
})
})
}, [value])
return <EditTable
rowKey="id"
maxLength={1000}
linkconfig={{
urlchangeval: {
database: (params) => doFetch({ url: "/ngic-workmanship/wmsMaterieStore/queryStoreOne", params }),
params: { "storePositionId": "linked", materieControlNo: "linked" },
effectresult: {
"supplierNo": "supplierNo",
"supplierName": "supplierName",
"stockNum": "stroeNum",
"materieControlNo": "materieControlNo"
}
}
}}
style={{ marginLeft: 48 }}
columns={[
{
title: "库位名称",
dataIndex: "storePositionName",
key: "storePositionId",
search: false,
valueType: "select",
request: async (params) => {
let res = await doFetch({ url: "/ngic-auth/sysStorePosition/queryByStoreId/selection", params: { storeId: params.storeId } });
return res?.data?.dataList
},
editable: (text, record, index) => {
return !record.materieOutstoreDetailId
},
params: { storeId: storeId },
"formItemProps": () => {
return {
rules: [{ required: true, message: '此项为必填项' }],
};
},
},
{
title: "批次号/SN号",
dataIndex: "materieControlNo",
key: "materieControlNo",
search: false,
valueType: "select",
request: async (params) => {
let res = await doFetch({ url: "/ngic-workmanship/wmsMaterieStore/queryPCList", params: { materieId: params.materieId, storePositionId: params.storePositionId } });
return res?.data?.dataList
},
editable: (text, record, index) => {
return !record.materieOutstoreDetailId
},
params: (row) => {
return { materieId: record.materieId, storePositionId: row.storePositionId }
},
width: 200
},
{
title: "下架数量",
dataIndex: "outstroeNum",
key: "outstroeNum",
search: false,
editable: (text, record, index) => {
return !record.materieOutstoreDetailId
},
valueType: "digit"
},
{
title: "供应商编号",
dataIndex: "supplierNo",
key: "supplierNo",
search: false,
readonly: true
},
{
title: "供应商名称",
dataIndex: "supplierName",
key: "supplierName",
search: false,
readonly: true
},
{
title: "库存数量",
dataIndex: "stockNum",
key: "stockNum",
search: false,
"readonly": true,
},
{
title: "备注",
dataIndex: "remark",
key: "remark",
search: false,
editable: (text, record, index) => {
return !record.materieOutstoreDetailId
}
},
{
title: "操作",
valueType: "option",
width: 70,
render: (text, record, _, action) => [
<a key="delete" onClick={() => { }}>
删除
</a>,
],
}
]}
value={value[record.id]}
onChange={(vals) => {
setvalue(s => ({
...s,
[record.id]: vals
}));
}}
pagination={false}
/>
}
const one = {
"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: {}
},
"linked": true
},
"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/query/selectbox", params: {} })
return res?.data?.dataList
},
"fieldProps": {
allowClear: true,
showSearch: true
},
"formItemProps": () => {
return {
rules: [{ required: true, message: '此项为必填项' }],
};
},
editable: true
},
{
"title": <span>出库数量 <b style={{ color: "red" }}>*</b></span>,
"dataIndex": "outstroeNum",
"key": "outstroeNum",
"formItemProps": () => {
return {
rules: [{ required: true, message: '此项为必填项' }],
};
},
valueType: "digit",
editable: true
},
{
"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",
}
},
two = {
"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/query/selectbox", params: {} })
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"
},
{
"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",
}
},
three = {
"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/query/selectbox", params: {} })
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"
},
{
"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",
}
},
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/query/selectbox", params: {} })
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"
},
{
"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} />,
}
},
],
},
]
});
export default {
one,
two,
three,
four,
detail,
dooutside
};
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 { doFetch } from "@/utils/doFetch";
import DrawInitForm from "@/components/DrawInitForm";
import getPrem from "@/utils/getPrem"; //权限判断fn
import { useReactToPrint } from "react-to-print";
import { useModel } from "umi";
import PrintDom from "./printdom";
import { PrintQrCode } from "@/components/PrintCode";
function Outstore(props) {
const { initialState, setInitialState } = useModel("@@initialState");
const [activeTabKey, onTabChange] = useState("1");
const [selectKeys, setSelectKeys] = useState([]);
let [drawprops, setdrawprops] = useState({
title: "",
visible: false,
onClose: () => {
setdrawprops((s) => ({
...s,
visible: false,
fields: {},
}));
},
fields: {},
width: 1200,
}),
actionRef = useRef(),
ChildRef = null,
printRef = useRef(),
mutiPrintRef = useRef();
//操作完成后刷新
function reload() {
actionRef.current.reload();
ChildRef?.onRefresh();
message.success("操作成功");
setdrawprops((s) => ({
...s,
visible: false,
fields: {},
}));
}
const handlePrint = useReactToPrint({
content: () => printRef.current.dom.current,
});
const mutiPrint = useReactToPrint({
content: () => mutiPrintRef.current.dom.current,
});
const PrintButton = (
<Button
disabled={!selectKeys.length}
onClick={() => {
mutiPrint();
}}
>
打印
</Button>
);
useEffect(() => {
const detail = defaultFields.detail(setSelectKeys, PrintButton);
setdrawprops((s) => ({
...s,
...detail,
}));
}, [selectKeys]);
const columns = useMemo(() => {
if (activeTabKey == "1") {
return [
{
title: "任务单号",
dataIndex: "taskNo",
key: "taskNo",
render: (dom, record) => {
return (
<a
onClick={() => {
const detail = defaultFields.detail(
setSelectKeys,
PrintButton
);
setdrawprops((s) => ({
...s,
visible: true,
//查看详情 props
val: "detail",
title: `查看详情`,
...detail,
totalPath:
"/ngic-workmanship/wmsMaterieOutstore/getOutStoreInfoById",
totalParams: { id: record.id },
extra: (
<Button
onClick={async () => {
handlePrint();
}}
>
打印
</Button>
),
}));
}}
>
{dom}
</a>
);
},
},
{
title: "物料名称",
dataIndex: "materieName",
key: "materieName",
valueType: "select",
options: [
{
label: "生产领料出库",
value: "1",
},
{
label: "销售出库",
value: "2",
},
{
label: "报废出库",
value: "3",
},
{
label: "其他出库",
value: "4",
},
],
},
{
title: "规格型号",
dataIndex: "specificationModel",
key: "specificationModel",
fieldProps: {
allowClear: true,
showSearch: true,
},
options: {
database: () =>
doFetch({
url: "/ngic-auth/sysStore/selectionBox",
params: { factoryIdList: [] },
}),
params: {},
},
valueType: "select",
},
{
title: "批次号",
dataIndex: "materieControlNo",
key: "materieControlNo",
search: false,
},
{
title: "来源库位",
dataIndex: "sourceStorePositionName",
key: "sourceStorePositionName",
},
{
title: "目标库位",
dataIndex: "targetStorePositionName",
key: "targetStorePositionName",
},
{
title: "任务类型",
dataIndex: "taskTypeName",
key: "taskTypeName",
},
{
title: "单据状态",
dataIndex: "statusName",
key: "statusName",
valueType: "select",
options: [
{
label: "待执行",
value: "0",
},
{
label: "执行中",
value: "1",
},
{
label: "已执行",
value: "2",
},
{
label: "待分配",
value: "3",
},
],
},
{
title: "下发时间",
dataIndex: "distributeTime",
key: "distributeTime",
},
{
title: "操作",
dataIndex: "options",
key: "options",
render:(text, record, _, action) => {
return [
getPrem("equipmentCustomer_deleteById", action, "关单", null, {
title: "确认关单?",
onConfirm: () => {
doFetch({
url: "/ngic-workmanship/wmsTaskManagement/close",
params: { id: record.id },
}).then((res) => {
if (res.code == "0000") {
reload();
}
});
},
}),
];
},
},
];
} else {
return [
{
title: "任务单号",
dataIndex: "taskNo",
key: "taskNo",
// render: (dom, record) => {
// return (
// <a
// onClick={() => {
// const detail = defaultFields.detail(
// setSelectKeys,
// PrintButton
// );
// setdrawprops((s) => ({
// ...s,
// visible: true,
// //查看详情 props
// val: "detail",
// title: `查看详情`,
// ...detail,
// totalPath:
// "/ngic-workmanship/wmsMaterieOutstore/getOutStoreInfoById",
// totalParams: { id: record.id },
// extra: (
// <Button
// onClick={async () => {
// handlePrint();
// }}
// >
// 打印
// </Button>
// ),
// }));
// }}
// >
// {dom}
// </a>
// );
// },
},
{
title: "物料名称",
dataIndex: "materieName",
key: "materieName",
valueType: "select",
options: [
{
label: "生产领料出库",
value: "1",
},
{
label: "销售出库",
value: "2",
},
{
label: "报废出库",
value: "3",
},
{
label: "其他出库",
value: "4",
},
],
},
{
title: "规格型号",
dataIndex: "specificationModel",
key: "specificationModel",
fieldProps: {
allowClear: true,
showSearch: true,
},
options: {
database: () =>
doFetch({
url: "/ngic-auth/sysStore/selectionBox",
params: { factoryIdList: [] },
}),
params: {},
},
valueType: "select",
},
{
title: "批次号",
dataIndex: "materieControlNo",
key: "materieControlNo",
search: false,
},
{
title: "来源库位",
dataIndex: "sourceStorePositionName",
key: "sourceStorePositionName",
},
{
title: "目标库位",
dataIndex: "targetStorePositionName",
key: "targetStorePositionName",
},
{
title: "任务类型",
dataIndex: "taskTypeName",
key: "taskTypeName",
},
{
title: "单据状态",
dataIndex: "statusName",
key: "statusName",
valueType: "select",
options: [
{
label: "待执行",
value: "0",
},
{
label: "执行中",
value: "1",
},
{
label: "已执行",
value: "2",
},
{
label: "待分配",
value: "3",
},
],
},
{
title: "下发时间",
dataIndex: "distributeTime",
key: "distributeTime",
},
];
}
}, [activeTabKey]);
const tableprops = {
...props,
tabList: [
{
tab: "未完成",
key: "1",
},
{
tab: "已完成",
key: "2",
},
],
activeTabKey,
onTabChange,
columns,
path:
activeTabKey == "1"
? "/ngic-workmanship/wmsTaskManagement/queryList"
: "/ngic-workmanship/wmsTaskManagementHis/queryList",
};
return (
<div>
<div style={{ position: "fixed", bottom: -100000 }}>
<PrintDom ref={printRef} {...drawprops} />
</div>
<div style={{ display: "none" }}>
<PrintQrCode ref={mutiPrintRef} selectedItems={selectKeys} />
</div>
<AutoTable
{...tableprops}
actionRef={actionRef}
onRef={(node) => (ChildRef = node)}
></AutoTable>
<DrawInitForm
{...drawprops}
submitData={async (value) => {
if (drawprops.val == "add") {
let newfileds = JSON.parse(JSON.stringify(value));
newfileds.materialList = newfileds?.materialList?.map((it) => {
delete it.usableNum;
delete it.id;
return it;
});
let res = await doFetch({
url: "/ngic-workmanship/wmsMaterieOutstore/saveOutStore",
params: { ...newfileds, outstoreType: drawprops.outstoreType },
});
if (res.code == "0000") {
reload();
}
}
}}
onChange={async (changedValues, allValues) => {
for (let i in changedValues) {
if (i == "storeId") {
let res = await doFetch({
url: "/ngic-workmanship/wmsMaterieStockStore/selectbox/usableStock",
params: { storeId: changedValues["storeId"] },
}),
options = res?.data?.dataList;
setdrawprops((s) => {
let fields = JSON.parse(JSON.stringify(s.fields));
for (let i in fields) {
fields[i].value = allValues[i];
}
fields["materialList"].linkconfig = {
urlchangeval: {
//根据url接口 改变某个value
database: (params) =>
doFetch({
url: "/ngic-workmanship/wmsMaterieStockStore/queryStoreOne",
params,
}),
params: { materieId: "linked", storeId: changedValues[i] },
effectresult: {
productionUnit: "productionUnit", //key 为列表更新值 value为response 返回值
productionUnitName: "productionUnitName",
usableNum: "usableNum",
outstroeNum: "outstroeNum",
},
},
};
fields["materialList"].columns = [
{
title: (
<span>
物料编码-名称 <b style={{ color: "red" }}>*</b>
</span>
),
dataIndex: "materieId",
key: "materieId",
valueType: "select",
fieldProps: {
allowClear: true,
showSearch: true,
options,
},
formItemProps: () => {
return {
rules: [{ required: true, message: "此项为必填项" }],
};
},
editable: true,
},
{
title: (
<span>
出库数量 <b style={{ color: "red" }}>*</b>
</span>
),
dataIndex: "outstroeNum",
key: "outstroeNum",
formItemProps: () => {
return {
rules: [{ required: true, message: "此项为必填项" }],
};
},
valueType: "digit",
editable: true,
},
{
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>,
],
},
];
fields["materialList"].value = undefined;
let newfields = {
...fields,
};
return {
...s,
fields: newfields,
};
});
}
}
}}
reload={reload}
/>
</div>
);
}
export default Outstore;
.sitelayout {
min-height: calc(100vh - 98px) !important;
.sitelayoutbackground {
background: #fff;
}
}
.title{
margin: 0px;
}
\ No newline at end of file
import { doFetch } from "@/utils/doFetch";
import React, {
useState,
useImperativeHandle,
forwardRef,
useRef,
} from "react";
import { useEffect } from "react";
import { ScrollBoard } from "@jiaminghi/data-view-react";
import { useWindowSize } from "@/utils/windowsize";
const pageStyle = `
@media all {
.page-break {
display: none;
}
}
@media print {
html, body {
height: initial !important;
overflow: initial !important;
position:relative;
-webkit-print-color-adjust: exact;
word-break: break-all;
}
}
@media print {
.page-break {
margin-top:0;
display: block;
page-break-before: auto;
}
}
@media print {
.page-noprint {
display: none !important;
}
}
@page {
size: auto;
margin: 0px;
}
`;
let 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,
width: 60,
},
];
function PrintDom({ totalPath, val, totalParams, totalCard }, ref) {
console.log(totalCard);
let printRef = useRef();
const [data, setdata] = useState({});
useImperativeHandle(ref, () => ({
dom: printRef,
}));
useEffect(() => {
if (val == "detail") {
doFetch({ url: totalPath, params: totalParams }).then((res) => {
if (res.code == "0000") {
setdata(res?.data?.data);
}
});
} else {
}
}, [val]);
let datas = data?.materialList
? data?.materialList.map((it) => {
return columns.map((item) => {
if (item.render) {
return item.render(it, it);
} else {
return it[item.dataIndex];
}
});
})
: [];
return (
<>
<style type="text/css" media="print">
{pageStyle}
</style>
{val == "detail" && (
<div
ref={printRef}
style={{
width: "100%",
minHeight: "100%",
overflow: "inherit",
position: "relative",
}}
>
<div
style={{
display: "flex",
justifyContent: "space-between",
alignItems: "center",
padding: "0 2%",
paddingBottom: 12,
}}
>
<h1
style={{
width: "100%",
fontSize: 40,
marginTop: "-6px",
}}
>
出库工单
</h1>
<img
style={{
width: 300,
height: "auto",
}}
src={data?.qrCodeUrl}
alt=""
/>
</div>
<div
style={{
display: "flex",
flexWrap: "wrap",
paddingLeft: "2%",
marginTop: 24,
}}
>
{totalCard &&
totalCard[0].itemData
.filter((it) => !(it.noshow === true))
.map((it) => {
return (
<div
style={{
width: it.noshow ?? "32%",
backgroundColor: "#f9f9f9",
marginRight: "1%",
marginBottom: 10,
padding: "4px",
fontSize: 20,
overflow: "hidden",
}}
>
<b>{it.title}: </b>
<span>{data[it.key] || "-"}</span>
</div>
);
})}
</div>
<div
style={{
padding: "4px 2%",
position: "relative",
width: "100%",
overflow: "hidden",
}}
id="large"
>
<div
style={{
marginBottom: 18,
}}
>
<b>{totalCard && totalCard[1].cardTitle}</b>
</div>
<ScrollBoard
config={{
header: columns.map((it) => it.title),
data: datas,
rowNum: datas.length,
hoverPause: false,
}}
/>
</div>
</div>
)}
</>
);
}
export default forwardRef(PrintDom);
......@@ -354,7 +354,42 @@ function Outstore(props) {
const tableprops = {
...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">新增</Button>
// </Dropdown>
// ) : (
// "none"
// ),
tabList: [
{
tab: "未完成",
key: "1",
},
{
tab: "已完成",
key: "2",
},
],
activeTabKey,
onTabChange,
columns,
......
......@@ -260,170 +260,168 @@ const userDetails = [
},
];
const deviceprovideDetails = [ //设备供应商详情
const deviceprovideDetails = [
//设备供应商详情
{
cardTitle: '基本信息',
cardTitle: "基本信息",
itemData: [
{
"title": "供应商编号",
"key": "supplierNo",
title: "供应商编号",
key: "supplierNo",
},
{
"title": "供应商名称",
"key": "supplierName"
title: "供应商名称",
key: "supplierName",
},
{
"title": "公司官网",
"key": "officialWebsite"
title: "公司官网",
key: "officialWebsite",
},
{
"title": "联系电话",
"key": "telephone"
title: "联系电话",
key: "telephone",
},
{
"title": "邮箱",
"key": "email"
title: "邮箱",
key: "email",
},
{
"title": "地址",
"key": "address"
title: "地址",
key: "address",
},
{
"title": "评分",
"key": "score",
title: "评分",
key: "score",
type: "rate",
allowHalf: true,
disabled: true
disabled: true,
},
{
"title": "备注",
"key": "remark",
col: { span: 24 }
}
]
title: "备注",
key: "remark",
col: { span: 24 },
},
],
},
{
cardTitle: '联系人',
cardTitle: "联系人",
itemData: [
{
"key": "supplierUserList",
key: "supplierUserList",
type: "table",
col: { span: 24 },
columns: [
{
"title": "联系人姓名",
"dataIndex": "userName",
"key": "userName",
"search": false
title: "联系人姓名",
dataIndex: "userName",
key: "userName",
search: false,
},
{
"title": "联系电话",
"dataIndex": "telephone",
"key": "telephone",
"search": false
title: "联系电话",
dataIndex: "telephone",
key: "telephone",
search: false,
},
{
"title": "邮箱",
"dataIndex": "email",
"key": "email",
"search": false
title: "邮箱",
dataIndex: "email",
key: "email",
search: false,
},
{
"title": "职位",
"dataIndex": "title",
"key": "title",
"search": false
title: "职位",
dataIndex: "title",
key: "title",
search: false,
},
]
}
]
],
},
],
},
];
const usercusDetails = [ //设备客户详情
const usercusDetails = [
//设备客户详情
{
cardTitle: '基本信息',
cardTitle: "基本信息",
itemData: [
{
"title": "客户编号",
"key": "customerNo",
title: "客户编号",
key: "customerNo",
},
{
"title": "客户名称",
"key": "customerName"
title: "客户名称",
key: "customerName",
},
{
"title": "公司官网",
"key": "officialWebsite"
title: "公司官网",
key: "officialWebsite",
},
{
"title": "联系电话",
"key": "telephone"
title: "联系电话",
key: "telephone",
},
{
"title": "邮箱",
"key": "email"
title: "邮箱",
key: "email",
},
{
"title": "地址",
"key": "address"
title: "地址",
key: "address",
},
{
"title": "评分",
"key": "score",
title: "评分",
key: "score",
type: "rate",
allowHalf: true,
disabled: true
disabled: true,
},
{
"title": "备注",
"key": "remark",
col: { span: 24 }
}
]
title: "备注",
key: "remark",
col: { span: 24 },
},
],
},
{
cardTitle: '联系人',
cardTitle: "联系人",
itemData: [
{
"key": "customerUserList",
key: "customerUserList",
type: "table",
col: { span: 24 },
columns: [
{
"title": "联系人姓名",
"dataIndex": "userName",
"key": "userName",
"search": false
title: "联系人姓名",
dataIndex: "userName",
key: "userName",
search: false,
},
{
"title": "联系电话",
"dataIndex": "telephone",
"key": "telephone",
"search": false
title: "联系电话",
dataIndex: "telephone",
key: "telephone",
search: false,
},
{
"title": "邮箱",
"dataIndex": "email",
"key": "email",
"search": false
title: "邮箱",
dataIndex: "email",
key: "email",
search: false,
},
{
"title": "职位",
"dataIndex": "title",
"key": "title",
"search": false
title: "职位",
dataIndex: "title",
key: "title",
search: false,
},
]
}
]
],
},
],
},
];
const userCheckDetails = [
//个人详情-----待审核
{
......@@ -706,28 +704,24 @@ const materielDetail = [
key: "materieName",
},
{
title: "物料管控",
key: "materieControlName",
},
{
title: "库存下限",
key: "inventoryMin",
title: "物料类型",
key: "materieTypeName",
},
{
title: "库存上限",
key: "inventoryMax",
title: "管控方式",
key: "materieControlName",
},
{
title: "库存单位",
key: "productionUnitName",
title: "铁损",
key: "ironLoss",
},
{
title: "保质期",
key: "newqualityGuaranteePeriod",
title: "片厚",
key: "sheetThickness",
},
{
title: "发料类型",
key: "issueTypeName",
title: "默认库区",
key: "storeAreaName",
},
],
},
......@@ -1230,5 +1224,5 @@ export {
dispatchorderDetail,
labeltemplateDetail,
deviceprovideDetails,
usercusDetails
usercusDetails,
};
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