Commit 470b8e5f authored by wuhao's avatar wuhao 🎯

asder

parent 73b5b435
...@@ -4,7 +4,7 @@ import { Resizable } from "react-resizable"; ...@@ -4,7 +4,7 @@ import { Resizable } from "react-resizable";
function Resizecell({ onResize, onResizeStop, width, onClick, ...restProps }) { function Resizecell({ onResize, onResizeStop, width, onClick, ...restProps }) {
return ( return (
<Resizable <Resizable
width={width} width={width??1}
height={0} height={0}
onResize={onResize} onResize={onResize}
onResizeStop={onResizeStop} onResizeStop={onResizeStop}
......
import { Row, Col, Card, Grid } from "antd"; import { Row, Col, Card, Grid, Button } from "antd";
import Mcard from "./mcard"; import Mcard from "./mcard";
import Mtable from "./mtable"; import Mtable from "./mtable";
import getPrem from "@/utils/getPrem"; //权限判断fn
import { ExportOutlined } from "@ant-design/icons";
const { useBreakpoint } = Grid; const { useBreakpoint } = Grid;
function isString(obj) {
return obj.constructor === String ? true : false;
}
// const tableprops = {
// ...props,
// addconfig: {
// premkey: "sysDepartment_save",
// disabled:true,
// btnprops:{},
// onClick: () => {
// alert(0)
// },
// },
// exportconfig:{
// premkey: "sysDepartment_save",
// btnprops:{
// },
// onClick: () => {
// alert(1)
// },
// },
// pageextra: activeTabKey == "1" ? "add" : "none",
// tabList: [
// {
// tab: "未完成",
// key: "1"
// }, {
// tab: "已完成",
// key: "2"
// }
// ],
// activeTabKey,
// onTabChange
// }
export default (props) => { export default (props) => {
const screens = useBreakpoint(); const screens = useBreakpoint();
const actionbtn = {
add: <Button
key={"add"}
disabled={props?.addconfig?.disabled || !getPrem(props?.addconfig?.premkey ?? "", "ifs")}
type="primary"
{...props?.addconfig?.btnprops}
onClick={() => {
props?.addconfig?.onClick?.()
}}
>
新增
</Button>,
export: <Button
key={"add"}
disabled={props?.exportconfig?.disabled || !getPrem(props?.exportconfig?.premkey ?? "", "ifs")}
type="danger"
icon={<ExportOutlined />}
{...props?.exportconfig?.btnprops}
onClick={() => {
props?.exportconfig?.onClick?.()
}}
>
导出
</Button>
}
//右上角 pageextra 类型 1.reactDom 2.string 以逗号隔开 为none时不显示
const renderextra = () => {
if (props.pageextra && !isString(props.pageextra)) {
return props.pageextra
} else if (props.pageextra === "none") {
return <div style={{ height: 32, width: 64 }}></div>
} else {
let strarr = props.pageextra ? props.pageextra.split(",") : ["add"];
console.log(strarr);
return strarr.map((it, i) => {
return <div style={{ marginRight: i == strarr.length - 1 ? 0 : 6 }}>
{actionbtn[it]}
</div>
})
}
}
return ( return (
<div className="diycard"> <div className="diycard">
{screens.xs ? ( {screens.xs ? (
...@@ -34,8 +125,8 @@ export default (props) => { ...@@ -34,8 +125,8 @@ export default (props) => {
<Card <Card
bordered={props.bordered === false ? false : true} bordered={props.bordered === false ? false : true}
style={{ height: "100%" }} style={{ height: "100%" }}
title={props.pagetitle || null} title={props?.route?.name ? props.route.name : props.pagetitle}
extra={props.pageextra || null} extra={<div className="center">{renderextra()}</div>}
activeTabKey={props.activeTabKey} activeTabKey={props.activeTabKey}
tabList={props.tabList} tabList={props.tabList}
onTabChange={props.onTabChange} onTabChange={props.onTabChange}
......
...@@ -240,7 +240,7 @@ const Materiel = (props) => { ...@@ -240,7 +240,7 @@ const Materiel = (props) => {
key: "qualityGuaranteePeriod", key: "qualityGuaranteePeriod",
search: false, search: false,
render: (text, row) => { render: (text, row) => {
return row.qualityGuaranteePeriod + " " + row.qualityGuaranteePeriodUnitName return (row.qualityGuaranteePeriod??"") + " - " + (row.qualityGuaranteePeriodUnitName??"")
} }
}, },
{ {
......
import { factorySelect, shopSelectByFactory } from "@/services/system";
import regValue from "@/utils/regValue";
export default {
processLineCode: {
value: null,
type: "input",
title: "工艺路线编号",
name: ["processLineCode"],
required: true,
},
processLineName: {
value: null,
type: "input",
title: "工艺路线名称",
name: ["processLineName"],
required: true,
},
factoryId: {
value: null,
type: "select",
title: "所属工厂",
name: ["factoryId"],
required: true,
options: {
database: factorySelect,
params: {},
},
linked: true,
},
shopId: {
value: null,
type: "select",
title: "所属车间",
name: ["shopId"],
required: true,
belinked: {
options: {
database: shopSelectByFactory,
params: { factoryId: "linked" },
},
},
linked: true,
},
processLineType: {
value: null,
type: "select",
title: "工艺路线类型",
name: ["processLineType"],
required: false,
options: [
{
label: "常规",
value: 1,
},
{
label: "返工",
value: 2,
},
],
},
capacity: {
value: null,
type: "inputnumber",
title: "能力",
name: ["capacity"],
required: false,
...regValue(null, 6, 3),
},
remark: {
value: null,
type: "textarea",
title: "描述",
name: ["remark"],
required: false,
col: { span: 24 },
},
materieProductUnitList: {
value: [],
title: "转换单位",
type: "table",
col: { span: 24 },
name: ["materieProductUnitList"],
required: true,
columns: [
{
title: "辅助单位",
dataIndex: "productionUnit",
key: "productionUnit",
search: false,
valueType: "select",
request: async () => {
let res = await doFetch({url:"/ngic-base-business/sysDic/queryMaterieUnitSelect",params:{}})
return res?.data?.dataList
},
},
{
title: "转换比",
dataIndex: "conversionRate",
key: "conversionRate",
search: false,
valueType: "digit",
width:200
},
{
title: "操作",
valueType: "option",
width: 70,
render: (text, record, _, action) => [
<a key="delete" onClick={() => { }}>
删除
</a>,
],
},
],
rowKey: "id",
},
};
import React, { useEffect, useRef, useState } from "react";
import { import {
MenuUnfoldOutlined, Button,
MenuFoldOutlined, Tooltip,
HomeOutlined Row,
} from '@ant-design/icons'; Divider,
import { Breadcrumb, Layout, Menu, Input, Tooltip, Tree } from 'antd'; Drawer,
import React, { useState } from 'react'; Table,
import styles from './index.less' Col,
const { Header, Content, Footer, Sider } = Layout, Steps,
{ Search } = Input Card,
} from "antd";
import AutoTable from "@/components/AutoTable";
import { useRequest } from "umi";
import defaultFields from "./fields";
import { doFetch } from "@/utils/doFetch";
import Details from "@/components/Details";
import { gongyiDetail } from "@/utils/detailTotalCard";
import Coltext from "@/components/Coltext";
import DrawInitForm from "@/components/DrawInitForm";
import styles from "./index.less";
import {
PlusSquareOutlined,
MinusSquareOutlined,
MinusCircleOutlined,
ArrowDownOutlined,
ArrowUpOutlined,
} from "@ant-design/icons";
const Storesearch = () => { function Instore(props) {
const [collapsed, setCollapsed] = useState(false); const [activeTabKey, onTabChange] = useState("1");
const [search, setsearch] = useState(); const [drawprops, setdrawprops] = useState({
const [select, setselect] = useState({}); title: "",
visible: false,
onClose: () => {
setdrawprops(s => ({
...s,
visible: false,
}))
},
fields: defaultFields
});
return (
<Layout
style={{
height: '100%',
}}
>
<Sider theme='light' collapsed={collapsed} width={260}>
<div style={{ padding: 12, justifyContent: "space-between", paddingBottom: collapsed ? 12 : 0, alignItems: "center", display: "flex", flexDirection: !collapsed ? "row" : "column" }} >
<p className={styles.title} style={{ marginBottom: !collapsed ? 0 : 12 }}>
<HomeOutlined />
{!collapsed ? <span style={{ marginLeft: 6 }}>仓库库位</span> : ""}
</p>
{collapsed ? ( const tableprops = {
<MenuUnfoldOutlined ...props,
style={{ cursor: "pointer", fontSize: 20 }} addconfig: {
onClick={() => { premkey: "sysDepartment_save",
setCollapsed(!collapsed) btnprops: {},
}} onClick: () => {
/> setdrawprops(s => ({
) : ( ...s,
<MenuFoldOutlined visible: true,
style={{ cursor: "pointer", fontSize: 20 }} title: "新增",
onClick={() => { width:600
setCollapsed(!collapsed) }))
}} },
/> },
)} exportconfig: {
</div> premkey: "sysDepartment_save",
btnprops: {
},
onClick: () => {
alert(1)
},
},
pageextra: activeTabKey == "1" ? "add" : "none",
tabList: [
{ {
!collapsed && <div style={{ padding: 12, paddingBottom: collapsed ? 12 : 0 }}> tab: "未完成",
<Search value={search} onChange={e => setsearch(e.target.value)} style={{ marginRight: 10 }}></Search> key: "1"
</div> }, {
tab: "已完成",
key: "2"
} }
],
activeTabKey,
onTabChange
}
return (
<div>
<AutoTable
{ {
!collapsed ? ...tableprops
<div style={{ padding: collapsed ? 0 : 12 }}> }
<Tree
treeData={[
{ title: '全部仓库', key: '0' }, // 菜单项务必填写 key
{ title: '菜单项二', key: 'item-2' },
{
title: '子菜单',
key: 'submenu',
children: [{ title: '子菜单项', key: 'submenu-item-1' }],
},
]}
onSelect={(selectedKeys, e) => {
setselect(selectedKeys[0] ? {
title: e.node.title,
selectedKeys: selectedKeys[0]
} : {
}) ></AutoTable>
}}
<DrawInitForm
{...drawprops}
/> />
</div> :
<div onDoubleClick={() => {
setCollapsed(false)
}} style={{ writingMode: "vertical-lr", width: "100%", textAlign: "center", height: "80vh", display: "flex", justifyContent: "center", alignItems: "center", userSelect: "none" }}>
双击此处展开
</div>
}
</Sider>
<Layout className={styles.sitelayout}>
<Content
style={{
margin: '0 0 6px 6px',
display: "flex",
flexDirection: "column"
}}
>
<Breadcrumb
style={{
margin: '8px 6px',
}}
>
<Breadcrumb.Item>物料库存</Breadcrumb.Item>
<Breadcrumb.Item>{select.title}</Breadcrumb.Item>
</Breadcrumb>
<div
className={styles.sitelayoutbackground}
style={{
padding: 6,
height: "100%",
flex: 1
}}
>
Bill is a cat.
</div> </div>
</Content>
</Layout>
</Layout>
); );
}; }
export default Storesearch; export default Instore;
\ No newline at end of file \ No newline at end of file
...@@ -97,7 +97,7 @@ const Deviceprovide = (props) => { ...@@ -97,7 +97,7 @@ const Deviceprovide = (props) => {
return <div style={{ padding: '3px 0', overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis' }}> return <div style={{ padding: '3px 0', overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis' }}>
<Tooltip title={row.customerName}> <Tooltip title={row.customerName}>
<a onClick={() => { <a onClick={() => {
deviceprovideDetail({ id: row.id }).then(res => { doFetch({url:"/ngic-auth/sysCustomer/query/detail",params:{id: row.id } }).then(res => {
let data = res?.data?.data || {}; let data = res?.data?.data || {};
dispatch({ type: "cdetails", dataSource: data }) dispatch({ type: "cdetails", dataSource: data })
}) })
...@@ -291,7 +291,7 @@ const Deviceprovide = (props) => { ...@@ -291,7 +291,7 @@ const Deviceprovide = (props) => {
> >
</InitForm> </InitForm>
</Modal> </Modal>
<Drawer <Details
title="客户详情" title="客户详情"
closable={true} closable={true}
visible={visible} visible={visible}
...@@ -302,9 +302,9 @@ const Deviceprovide = (props) => { ...@@ -302,9 +302,9 @@ const Deviceprovide = (props) => {
}} }}
width="100%" width="100%"
className="drawerDetails" className="drawerDetails"
> {...details}
<Details {...details}></Details>
</Drawer> ></Details>
</div> </div>
} }
export default Deviceprovide; export default Deviceprovide;
\ No newline at end of file
...@@ -64,14 +64,14 @@ export default { ...@@ -64,14 +64,14 @@ export default {
allowHalf: true, allowHalf: true,
}, },
"status": { "status": {
"value": null, "value": 1,
"type": "select", "type": "select",
"title": "启停状态", "title": "启停状态",
"name": [ "name": [
"status" "status"
], ],
"required": true, "required": true,
options: [ "options": [
{ {
label: "启用", label: "启用",
value: 1 value: 1
...@@ -128,7 +128,7 @@ export default { ...@@ -128,7 +128,7 @@ export default {
rules: [ rules: [
{ {
required: false, required: false,
pattern: /^\d{11}$/, pattern: /^(((\d{3,4}-)?[0-9]{7,8})|(1(3|4|5|6|7|8|9)\d{9}))$/,
message: '手机号格式不正确' message: '手机号格式不正确'
}, },
], ],
......
...@@ -141,7 +141,7 @@ const Deviceprovide = (props) => { ...@@ -141,7 +141,7 @@ const Deviceprovide = (props) => {
{ {
"title": "状态", "title": "状态",
"dataIndex": "status", "dataIndex": "status",
"key":"status", "key": "status",
valueType: "select", valueType: "select",
options: [ options: [
{ {
...@@ -201,7 +201,7 @@ const Deviceprovide = (props) => { ...@@ -201,7 +201,7 @@ const Deviceprovide = (props) => {
} }
}) })
}), }),
getPrem("equipmentSupplier_deleteById", action, '删除', null,{ getPrem("equipmentSupplier_deleteById", action, '删除', null, {
title: "确认删除该供应商?", title: "确认删除该供应商?",
onConfirm: () => { onConfirm: () => {
run({ url: "/ngic-auth/sysSupplier/deleteById", params: { id: record.id } }) run({ url: "/ngic-auth/sysSupplier/deleteById", params: { id: record.id } })
...@@ -226,9 +226,12 @@ const Deviceprovide = (props) => { ...@@ -226,9 +226,12 @@ const Deviceprovide = (props) => {
let extrarender = ([ let extrarender = ([
<Button disabled={!getPrem("equipmentSupplier_save", "ifs")} type="primary" onClick={() => { <Button disabled={!getPrem("equipmentSupplier_save", "ifs")} type="primary" onClick={() => {
for (let i in defaultFields) { for (let i in defaultFields) {
defaultFields[i].value = null;
if (i == "supplierUserList") { if (i == "supplierUserList") {
defaultFields[i].value = [] defaultFields[i].value = []
} else if (i == "status") {
defaultFields[i].status = 0
} else {
defaultFields[i].value = null;
} }
} }
dispatch({ type: "add", fields: defaultFields }) dispatch({ type: "add", fields: defaultFields })
...@@ -267,7 +270,7 @@ const Deviceprovide = (props) => { ...@@ -267,7 +270,7 @@ const Deviceprovide = (props) => {
> >
</InitForm> </InitForm>
</Modal> </Modal>
<Drawer <Details
title="供应商详情" title="供应商详情"
closable={true} closable={true}
visible={visible} visible={visible}
...@@ -278,9 +281,9 @@ const Deviceprovide = (props) => { ...@@ -278,9 +281,9 @@ const Deviceprovide = (props) => {
}} }}
width="100%" width="100%"
className="drawerDetails" className="drawerDetails"
> {...details}>
<Details {...details}></Details>
</Drawer> </Details>
</div> </div>
} }
export default Deviceprovide; export default Deviceprovide;
\ No newline at end of file
...@@ -259,6 +259,8 @@ const userDetails = [ ...@@ -259,6 +259,8 @@ const userDetails = [
], ],
}, },
]; ];
const deviceprovideDetails = [ //设备供应商详情 const deviceprovideDetails = [ //设备供应商详情
{ {
cardTitle: '基本信息', cardTitle: '基本信息',
...@@ -339,6 +341,8 @@ const deviceprovideDetails = [ //设备供应商详情 ...@@ -339,6 +341,8 @@ const deviceprovideDetails = [ //设备供应商详情
}, },
]; ];
const userCheckDetails = [ const userCheckDetails = [
//个人详情-----待审核 //个人详情-----待审核
{ {
......
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