Commit ffcebc27 authored by wuhao's avatar wuhao 🎯

asder

parent 6974ed40
......@@ -63,20 +63,20 @@ export default [
component: "./system/Parts",
},
{
path: "/system/shop",
name: "车间管理",
path: "/system/store",
name: "仓库管理",
component: "./system/Shop",
},
{
path: "/system/productionline",
name: "产线管理",
component: "./system/Productionline",
},
{
path: "/system/section",
name: "工段管理",
component: "./system/Section",
},
// {
// path: "/system/productionline",
// name: "产线管理",
// component: "./system/Productionline",
// },
// {
// path: "/system/section",
// name: "工段管理",
// component: "./system/Section",
// },
{
path: "/system/station",
name: "工位管理",
......
import React, { useEffect, useRef, useReducer } from "react";
import { Button, Tooltip, Row, Divider } from "antd";
import { Button, Tooltip, Row, Divider, Drawer } from "antd";
import AutoTable from "@/components/AutoTable";
import getPrem from "@/utils/getPrem"; //权限判断fn
import { useRequest } from "umi";
import defaultFields from "./fields";
import { doFetch } from "@/utils/doFetch";
import DrawInitForm from "@/components/DrawInitForm";
import Details from "@/components/Details";
import { shopDetail } from "@/utils/detailTotalCard";
import Coltext from "@/components/Coltext";
import StoreApp from './store'
const initState = {
vs: false,
fields: {},
iftype: {},
curitem: {},
detail: {
dataSource: {},
totalCard: [],
},
visible: false,
vs: false,
fields: {},
iftype: {},
curitem: {},
detail: {
dataSource: {},
totalCard: [],
},
visible: false,
},
otherBasic = {
productionLineName: "产线(加工中心)",
sectionName: "工段",
......@@ -36,7 +34,7 @@ function reducer(state, action) {
...state,
vs: true,
iftype: {
title: "新增车间",
title: "新增仓库",
val: type,
},
fields: { ...action.fields },
......@@ -47,7 +45,7 @@ function reducer(state, action) {
...state,
vs: true,
iftype: {
title: "编辑车间",
title: "编辑仓库",
val: type,
},
fields: { ...action.fields },
......@@ -57,23 +55,15 @@ function reducer(state, action) {
case "see":
newState = {
...state,
detail: {
dataSource: action.dataSource,
totalCard: [...shopDetail],
},
curitem: action.curitem,
visible: true,
};
break;
case "close":
newState = {
vs: false,
fields: {},
iftype: {},
...state,
curitem: {},
detail: {
dataSource: {},
totalCard: [],
},
vs: false,
visible: false,
};
break;
......@@ -82,7 +72,7 @@ function reducer(state, action) {
return newState;
}
const Shop = (props) => {
const Store = (props) => {
let actionRef = useRef(),
ChildRef = null;
function reload() {
......@@ -90,60 +80,52 @@ const Shop = (props) => {
ChildRef?.onRefresh();
}
const { run, loading } = useRequest(doFetch, {
manual: true,
formatResult: (res) => res,
onSuccess: (result, params) => {
if (result.code == "0000") {
reload();
dispatch({ type: "close" });
}
},
}),
manual: true,
formatResult: (res) => res,
onSuccess: (result, params) => {
if (result.code == "0000") {
reload();
dispatch({ type: "close" });
}
},
}),
[state, dispatch] = useReducer(reducer, initState),
{ vs, fields, iftype, curitem, detail, visible } = state,
columns = [
{
title: "车间编号",
dataIndex: "shopCode",
key: "shopCode",
"title": "仓库编号",
"dataIndex": "storeCode",
"key": "storeCode"
},
{
title: "车间名称",
dataIndex: "shopName",
key: "shopName",
render: (_, row) => {
return (
<Tooltip title={row.shopName}>
<a
className="table-cell"
onClick={() => {
doFetch({
url: "/ngic-auth/sysShop/queryDetailById",
params: { id: row.id },
}).then((res) => {
if (res.code == "0000") {
let dataSource = res?.data?.data ?? {};
dispatch({ type: "see", dataSource });
}
});
}}
>
{row.shopName}
</a>
</Tooltip>
);
},
"title": "仓库名称",
"dataIndex": "storeName",
"key": "storeName"
},
{
title: "所属工厂",
dataIndex: "factoryName",
key: "factoryName",
"title": "仓库类型",
"dataIndex": "storeTypeName",
"key": "storeTypeName",
"valueType": "select",
"options": [
{
"label": "半成品库",
"value": "0"
},
{
"label": "成品库",
"value": "1"
},
{
"label": "原材料库",
"value": "2"
}
]
},
{
title: "描述",
dataIndex: "remark",
key: "remark",
search: false,
"title": "工厂名",
"dataIndex": "factoryName",
"key": "factoryName"
},
{
title: "操作",
......@@ -154,37 +136,20 @@ const Shop = (props) => {
render: (text, row, _, action) => extraAction(text, row, _, action),
},
];
function extraAction(text, record, _, action) {
return [
getPrem("sysDepartment_save", action, "库位管理", () => {
dispatch({ type: "see", curitem: record });
}),
getPrem("sysDepartment_save", action, "修改", () => {
doFetch({
url: "/ngic-auth/sysShop/queryDetailById",
params: { id: record.id },
}).then((res) => {
if (res.code == "0000") {
let data = res?.data?.data ?? {};
for (let i in defaultFields) {
defaultFields[i].value = record[i];
if (i == "factoryId") {
if (
data?.productionLineName ||
data?.sectionName ||
data?.processLineName ||
data?.groupName ||
data?.shiftName
) {
defaultFields[i].disabled = true;
} else {
defaultFields[i].disabled = false;
}
}
}
dispatch({ type: "edit", fields: defaultFields, curitem: data });
}
});
for (let i in defaultFields) {
defaultFields[i].value = record[i];
}
dispatch({ type: "edit", fields: defaultFields, curitem: record });
}),
getPrem("sysDepartment_deleteById", action, "删除", null, {
title: "确认删除该车间?",
title: "确认删除该仓库?",
onConfirm: () => {
run({
url: "/ngic-auth/sysShop/deleteById",
......@@ -194,15 +159,17 @@ const Shop = (props) => {
}),
];
}
let saveData = (values, fn) => {
let newfields = JSON.parse(JSON.stringify(values));
//新增&修改
let difrid = iftype.val == "edit" ? { id: curitem.id } : {};
run({
url: "/ngic-auth/sysShop/save",
url: "/ngic-auth/sysStore/save",
params: { ...newfields, ...difrid },
});
};
let extrarender = [
<Button
disabled={!getPrem("sysDepartment_save", "ifs")}
......@@ -218,13 +185,14 @@ const Shop = (props) => {
新增
</Button>,
];
return (
<div>
<AutoTable
pagetitle={props.route.name} //页面标题
pageextra={extrarender} //页面操作 新增or批量删除
columns={columns}
path="/ngic-auth/sysShop/queryList"
path="/ngic-auth/sysStore/queryList"
actionRef={actionRef}
onRef={(node) => (ChildRef = node)}
></AutoTable>
......@@ -245,33 +213,23 @@ const Shop = (props) => {
submitting={loading || !vs}
width={"60%"}
>
{iftype.val == "edit" && (
<>
<Row gutter={[16, 10]}>
{Object.keys(otherBasic).map((it) => {
return (
<Coltext
label={otherBasic[it]}
value={curitem[it]}
key={it}
/>
);
})}
</Row>
<Divider />
</>
)}
</DrawInitForm>
<Details
title="车间详情"
<Drawer
visible={visible}
onClose={() => dispatch({ type: "close" })}
title="库位列表"
footer={false}
destroyOnClose={true}
width={"100%"}
{...detail}
></Details>
getContainer={false}
style={{ position: "absolute" }}
>
<StoreApp curitem={curitem}></StoreApp>
</Drawer>
</div>
);
};
export default Shop;
export default Store;
import { factorySelect } from "@/services/system";
export default {
shopCode: {
value: null,
type: "input",
title: "车间编号",
name: ["shopCode"],
required: true,
"storeCode": {
"value": null,
"type": "input",
"title": "仓库编号",
"name": [
"storeCode"
],
"required": true
},
shopName: {
value: null,
type: "input",
title: "车间名称",
name: ["shopName"],
required: true,
"storeName": {
"value": null,
"type": "input",
"title": "仓库名称",
"name": [
"storeName"
],
"required": true
},
factoryId: {
value: null,
type: "select",
title: "所属工厂",
name: ["factoryId"],
required: true,
options: {
database: factorySelect,
params: {},
},
},
remark: {
value: null,
type: "textarea",
title: "描述",
name: ["remark"],
required: false,
col: { span: 24 },
"storeType": {
"value": null,
"type": "select",
"title": "仓库类型",
"name": [
"storeType"
],
"required": true,
"options": [
{
"label":"半成品库",
"value":0
},
{
"label":"成品库",
"value":1
},
{
"label":"原材料库",
"value":2
}
]
},
"factoryId": {
"value": null,
"type": "select",
"title": "所属工厂",
"name": ["factoryId"],
"required": true,
"options": {
"database": factorySelect,
"params": {},
},
}
};
import { doFetch } from "@/utils/doFetch";
export default {
"storePositionName": {
"value": null,
"type": "input",
"title": "库位名称",
"name": [
"storePositionName"
],
"required": true
},
"storeAreaName": {
"value": null,
"type": "select",
"title": "所属库区",
"name": [
"storeAreaName"
],
"required": true,
"options": {
"database":()=> doFetch({url:"/ngic-base-business/sysDic/queryStorePositionSelect"}),
"params": {}
}
},
"description": {
"value": null,
"type": "input",
"title": "描述",
"name": [
"description"
],
"required": true
}
};
import React, { useEffect, useRef, useReducer } from "react";
import { Button, Tooltip, Row, Divider } from "antd";
import AutoTable from "@/components/AutoTable";
import getPrem from "@/utils/getPrem"; //权限判断fn
import { useRequest } from "umi";
import defaultFields from "./fieldstore";
import { doFetch } from "@/utils/doFetch";
import DrawInitForm from "@/components/DrawInitForm";
const initState = {
vs: false,
fields: {},
iftype: {},
curitem: {},
detail: {
dataSource: {},
totalCard: [],
},
visible: false,
};
function reducer(state, action) {
let { type } = action,
newState = {};
switch (type) {
case "add":
newState = {
...state,
vs: true,
iftype: {
title: "新增库位",
val: type,
},
fields: { ...action.fields },
};
break;
case "edit":
newState = {
...state,
vs: true,
iftype: {
title: "编辑库位",
val: type,
},
fields: { ...action.fields },
curitem: action.curitem,
};
break;
case "see":
newState = {
...state,
curitem: action.curitem,
visible: true,
};
break;
case "close":
newState = {
...state,
curitem: {},
visible: false,
};
break;
}
return newState;
}
const StoreApp = (props) => {
console.log(props);
let actionRef = useRef(),
ChildRef = null;
function reload() {
actionRef?.current?.reload();
ChildRef?.onRefresh();
}
const { run, loading } = useRequest(doFetch, {
manual: true,
formatResult: (res) => res,
onSuccess: (result, params) => {
if (result.code == "0000") {
reload();
dispatch({ type: "close" });
}
},
}),
[state, dispatch] = useReducer(reducer, initState),
{ vs, fields, iftype, curitem, detail, visible } = state,
columns = [
{
"title": "库位名称",
"dataIndex": "storePositionName",
"key": "storePositionName"
},
{
"title": "所属库区",
"dataIndex": "storeAreaName",
"key": "storeAreaName",
"valueType": "select",
"options": {
database:()=>doFetch("/ngic-base-business/sysDic/queryStorePositionSelect"),
params:{}
}
},
{
"title": "描述",
"dataIndex": "description",
"key": "description"
},
{
title: "操作",
dataIndex: "option_dataindex",
key: "option_dataindex",
valueType: "option",
width: 135,
render: (text, row, _, action) => extraAction(text, row, _, action),
},
];
function extraAction(text, record, _, action) {
return [
getPrem("sysDepartment_save", action, "修改", () => {
for (let i in defaultFields) {
defaultFields[i].value = record[i];
}
dispatch({ type: "edit", fields: defaultFields, curitem: record });
}),
getPrem("sysDepartment_deleteById", action, "删除", null, {
title: "确认删除该库位?",
onConfirm: () => {
run({
url: "/ngic-auth/sysShop/deleteById",
params: { id: record.id },
});
},
}),
];
}
let saveData = (values, fn) => {
let newfields = JSON.parse(JSON.stringify(values));
//新增&修改
let difrid = iftype.val == "edit" ? { id: curitem.id } : {};
run({
url: "/ngic-auth/sysStore/save",
params: { ...newfields, ...difrid },
});
};
let extrarender = [
<Button
disabled={!getPrem("sysDepartment_save", "ifs")}
type="primary"
onClick={() => {
for (let i in defaultFields) {
defaultFields[i].value = null;
defaultFields[i].disabled = false;
}
dispatch({ type: "add", fields: defaultFields });
}}
>
新增
</Button>,
];
return (
<div>
<AutoTable
pagetitle={"库位管理"} //页面标题
pageextra={extrarender} //页面操作 新增or批量删除
columns={columns}
path="/ngic-auth/sysStorePosition/queryList"
actionRef={actionRef}
onRef={(node) => (ChildRef = node)}
extraparams={{storeId:props?.curitem?.id??"0"}}
></AutoTable>
<DrawInitForm
title={iftype.title}
visible={vs}
onClose={() => dispatch({ type: "close" })}
footer={false}
destroyOnClose={true}
fields={fields}
submitData={(values) => {
saveData(values);
}}
onChange={(changedValues, allValues) => {
//联动操作
}}
submitting={loading || !vs}
width={"60%"}
>
</DrawInitForm>
</div>
);
};
export default StoreApp;
import {
factorySelect,
shopSelectByFactory,
productionLineSelectByShops,
storeselectionBox,
sectionSelectByShops,
userSelect,
departmentTree,
......@@ -27,41 +27,44 @@ export default {
type: "input",
title: "联系电话",
name: ["telephone"],
required: true,
required: false,
},
factoryId: {
departmentId: {
value: null,
type: "select",
title: "工厂",
name: ["factoryId"],
type: "treeselect",
title: "部门",
name: ["departmentId"],
required: true,
options: {
database: factorySelect,
database: departmentTree,
params: {},
},
linked: true,
},
departmentId: {
factoryIdList: {
value: null,
type: "treeselect",
title: "部门",
name: ["departmentId"],
type: "select",
title: "工厂",
name: ["factoryIdList"],
required: true,
options: {
database: departmentTree,
database: factorySelect,
params: {},
},
linked: true,
multiple: true,
},
storeIdList: {
value: null,
type: "select",
title: "负责车间",
title: "负责仓库",
name: ["storeIdList"],
required: false,
belinked: {
options: {
database: shopSelectByFactory,
params: { factoryId: "linked" },
database: storeselectionBox,
params: {
},
},
},
linked: true,
......
This diff is collapsed.
......@@ -50,7 +50,7 @@ const Login = () => {
const formRef = useRef();
const { initialState, setInitialState } = useModel("@@initialState");
const [tabkey, settabkey] = useState("1");
const [visible, setvisible] = useState(true);
const [visible, setvisible] = useState(false);
const [data, setdata] = useState();
const fetchUserInfo = async () => {
const userInfo = await initialState?.fetchUserInfo(),
......@@ -152,7 +152,7 @@ const Login = () => {
onSearch={(value) => {
if (value) {
doFetch({
url: "/ngic-auth/sysAccountApply/queryByPhone",
url: "/ngic-auth/sysAccountApply/queryByAccount",
params: { accountName: value.replace(/^\s+|\s+$/g, "") },
}).then((res) => {
if (res.code == "0000") {
......@@ -262,7 +262,10 @@ const Login = () => {
</div>
</Col>
<Col {...cols}>
<Col {...cols} onClick={() => {
setvisible(false)
}}>
<div className="logincontent" style={{ width: "100%", height: "100%", display: "flex", flexDirection: "column" }}>
<div className={styles.content}>
<LoginForm
......@@ -303,7 +306,10 @@ const Login = () => {
activeKey={tabkey}
onChange={settabkey}
tabBarStyle={{ color: "#fff" }}
tabBarExtraContent={<a style={{ color: "rgba(255,255,255,0.6)" }}>查询注册进度</a>}
tabBarExtraContent={<a style={{ color: "rgba(255,255,255,0.6)" }} onClick={(e) => {
e.stopPropagation();
setvisible(true)
}}>查询注册进度</a>}
>
<TabPane tab="登录" key="1">
{tabkey == "1" && (
......
......@@ -36,6 +36,14 @@ export async function storeselectionBoxAll(params) {
data: params,
});
}
//根据工厂id查询车间下拉
export async function storeselectionBox(params) {
return request(`/wms/ngic-auth/sysStore/selectionBox`, {
method: "POST",
data: params,
});
}
//根据工厂id查询车间下拉
export async function shopSelectByFactory(params) {
return request(`/wms/ngic-auth/sysShop/query/selectbox/factory`, {
......
......@@ -223,10 +223,6 @@ const userDetails = [
title: "姓名",
key: "userName",
},
{
title: "性别",
key: "genderName",
},
{
title: "联系电话",
key: "telephone",
......@@ -240,16 +236,8 @@ const userDetails = [
key: "departmentName",
},
{
title: "负责车间",
key: "shopNames",
},
{
title: "负责工段",
key: "sectionNames",
},
{
title: "负责产线",
key: "productionLines",
title: "负责仓库",
key: "chargeStoreName",
},
{
title: "角色",
......@@ -263,23 +251,6 @@ const userDetails = [
title: "邮箱",
key: "mailNo",
},
{
title: "学历",
key: "academicCareer",
},
{
title: "毕业院校",
key: "university",
},
{
title: "专业",
key: "major",
},
{
title: "个人图片",
key: "userImgList",
type: "img",
},
{
title: "备注",
key: "remarks",
......@@ -306,10 +277,6 @@ const userCheckDetails = [
title: "姓名",
key: "userName",
},
{
title: "性别",
key: "genderName",
},
{
title: "联系电话",
key: "telephone",
......@@ -323,16 +290,8 @@ const userCheckDetails = [
key: "departmentName",
},
{
title: "负责车间",
key: "shopName",
},
{
title: "负责工段",
key: "sectionName",
},
{
title: "负责产线",
key: "productionLineName",
title: "负责仓库",
key: "chargeStoreName",
},
{
title: "角色",
......@@ -346,23 +305,6 @@ const userCheckDetails = [
title: "邮箱",
key: "mailNo",
},
{
title: "学历",
key: "academicCareer",
},
{
title: "毕业院校",
key: "university",
},
{
title: "专业",
key: "major",
},
{
title: "个人图片",
key: "userImgList",
type: "img",
},
{
title: "备注",
key: "remark",
......
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