Commit 668ec201 authored by 左玲玲's avatar 左玲玲 😬

1140

parent 6a05b2c7
......@@ -319,6 +319,12 @@ export default [
icon: '',
component: './lease/ledger',
},
{
name: '设备供应商',
path: '/lease/supplier',
icon: '',
component: './lease/supplier',
},
],
},
];
......@@ -13,7 +13,7 @@ export default {
dev: {
[defaultSetting.proxypath]: {
// 要代理的地址
target: 'http://192.168.40.64:28000', //jf哥
target: 'http://192.168.40.111:8000', //jf哥
// target: 'http://192.168.40.248:8080', //jf哥
// target: 'http://192.168.40.64:28000', //gc哥
// target: 'http://192.168.40.203:8000', //dj哥
......@@ -22,7 +22,7 @@ export default {
},
'/token': {
// 要代理的地址
target: 'http://192.168.40.64:8000',
target: 'http://192.168.40.111:8000',
changeOrigin: true,
},
'/staticfile/': {
......
<svg width="130" height="80" xmlns="http://www.w3.org/2000/svg"><defs><linearGradient x1="52.348%" y1="74.611%" x2="52.348%" y2="-17.635%" id="a"><stop stop-color="#DEDEDE" stop-opacity="0" offset="0%"/><stop stop-color="#A9A9A9" stop-opacity=".3" offset="100%"/></linearGradient><linearGradient x1="44.79%" y1="100%" x2="44.79%" y2="0%" id="b"><stop stop-color="#FFF" stop-opacity="0" offset="0%"/><stop stop-color="#96A1C5" stop-opacity=".373" offset="100%"/></linearGradient><linearGradient x1="50%" y1="100%" x2="50%" y2="-19.675%" id="c"><stop stop-color="#FFF" stop-opacity="0" offset="0%"/><stop stop-color="#919191" stop-opacity=".15" offset="100%"/></linearGradient><linearGradient x1="50%" y1="0%" x2="50%" y2="44.95%" id="d"><stop stop-color="#5389F5" offset="0%"/><stop stop-color="#416FDC" offset="100%"/></linearGradient><linearGradient x1="63.345%" y1="100%" x2="63.345%" y2="-5.316%" id="e"><stop stop-color="#DCE9FF" offset="0%"/><stop stop-color="#B6CFFF" offset="100%"/></linearGradient><linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="f"><stop stop-color="#7CA5F7" offset="0%"/><stop stop-color="#C4D6FC" offset="100%"/></linearGradient></defs><g transform="translate(-1.866 .364)" fill="none" fill-rule="evenodd"><path d="M27.94 14.864c1.326-4.192 2.56-6.802 3.7-7.831 3.157-2.848 7.522-1.298 8.45-1.076 3.26.782 2.2-4.364 4.997-5.41 1.864-.697 3.397.155 4.6 2.556C50.752.863 52.375-.163 54.556.02c3.272.277 4.417 11.328 8.913 8.909 4.497-2.42 10.01-2.973 12.365.623.509.778.704-.429 4.166-4.55C83.462.88 86.914-.936 93.996 1.464c3.22 1.09 5.868 4.045 7.947 8.864 0 6.878 5.06 10.95 15.178 12.213 15.179 1.895 3.397 18.214-15.178 22.993-18.576 4.78-61.343 7.36-84.551-4.716C1.92 32.769 5.436 24.117 27.939 14.864z" fill="url(#a)" opacity=".8"/><ellipse fill="url(#b)" cx="66" cy="69.166" rx="27.987" ry="6.478"/><path d="M113.25 77.249c-21.043 5.278-92.87-.759-100.515-3.516-3.721-1.343-7.075-3.868-10.061-7.576a2.822 2.822 0 0 1 2.198-4.593h125.514c2.605 6.938-3.107 12.166-17.136 15.685z" fill="url(#c)" opacity=".675"/><g fill-rule="nonzero"><path d="M43.396 12.098L33.825.906a2.434 2.434 0 0 0-1.837-.86h-20.58c-.706 0-1.377.324-1.837.86L0 12.098v6.144h43.396v-6.144z" fill="url(#d)" transform="translate(44.08 39.707)"/><path d="M40.684 18.468L32.307 8.72a2.136 2.136 0 0 0-1.622-.725H12.711c-.617 0-1.22.256-1.622.725l-8.377 9.748v5.354h37.972v-5.354z" fill="url(#e)" transform="translate(44.08 39.707)"/><path d="M43.396 25.283c0 .853-.384 1.62-.99 2.134l-.123.1a2.758 2.758 0 0 1-1.67.56H2.784c-.342 0-.669-.062-.971-.176l-.15-.06A2.802 2.802 0 0 1 0 25.282V12.165h10.529c1.163 0 2.1.957 2.1 2.118v.015c0 1.162.948 2.099 2.111 2.099h13.916a2.113 2.113 0 0 0 2.111-2.107c0-1.166.938-2.125 2.1-2.125h10.53z" fill="url(#f)" transform="translate(44.08 39.707)"/></g></g></svg>
\ No newline at end of file
......@@ -92,10 +92,10 @@ const Mtable = (props) => {
let itemwidth = valueColumns[it.key]?.width
? valueColumns[it.key].width
: it.width
? it.width
: resizeable
? 160
: 'auto';
? it.width
: resizeable
? 160
: 'auto';
let options = {},
faoptopns = it?.searchOptions ?? it?.options;
if (['select', 'treeSelect', 'radio', 'checkbox', 'cascader'].includes(it?.valueType)) {
......@@ -283,83 +283,82 @@ const Mtable = (props) => {
//缩放表格
const handleResize =
(index) =>
(e, { size }) => {
e.stopImmediatePropagation();
setcolumnes((s) => {
const nextColumns = [...s];
nextColumns[index] = {
...nextColumns[index],
width: size.width,
};
return nextColumns;
});
};
(e, { size }) => {
e.stopImmediatePropagation();
setcolumnes((s) => {
const nextColumns = [...s];
nextColumns[index] = {
...nextColumns[index],
width: size.width,
};
return nextColumns;
});
};
//更新表格缩放
const handleResizeStop =
(index) =>
(e, { size }) => {
e.stopImmediatePropagation();
let submitdata = { ...valueColumns } ?? {},
curkey = Object.keys(submitdata)[index];
submitdata[curkey].width = parseInt(size.width);
setvalueColumns(submitdata);
doFetch({
url: '/ngic-base-business/paFieldScene/save',
params: {
sceneMark: activeTabKey ? path + activeTabKey : path,
controList: Object.keys(submitdata).map((it, i) => {
return {
fieldKey: it,
fieldWidth: i == index ? parseInt(size.width) : submitdata[it].width,
fieldOrder: submitdata[it].order,
fieldFixed: submitdata[it].fixed,
fieldShow: submitdata[it].show,
};
}),
},
});
};
(e, { size }) => {
e.stopImmediatePropagation();
let submitdata = { ...valueColumns } ?? {},
curkey = Object.keys(submitdata)[index];
submitdata[curkey].width = parseInt(size.width);
setvalueColumns(submitdata);
doFetch({
url: '/ngic-base-business/paFieldScene/save',
params: {
sceneMark: activeTabKey ? path + activeTabKey : path,
controList: Object.keys(submitdata).map((it, i) => {
return {
fieldKey: it,
fieldWidth: i == index ? parseInt(size.width) : submitdata[it].width,
fieldOrder: submitdata[it].order,
fieldFixed: submitdata[it].fixed,
fieldShow: submitdata[it].show,
};
}),
},
});
};
const components = resizeable
? {
components: {
header: {
cell: Resizecell,
},
components: {
header: {
cell: Resizecell,
},
columnsState: {
value: valueColumns,
onChange: (val, state) => {
setvalueColumns((s) => {
let submitdata = {
...s,
...val,
};
doFetch({
url: '/ngic-base-business/paFieldScene/save',
params: {
sceneMark: activeTabKey ? path + activeTabKey : path,
controList: Object.keys(submitdata).map((it) => {
return {
fieldKey: it,
fieldWidth: submitdata[it].width,
fieldOrder: submitdata[it].order,
fieldFixed: submitdata[it].fixed,
fieldShow: submitdata[it].show,
};
}),
},
});
return submitdata;
},
columnsState: {
value: valueColumns,
onChange: (val, state) => {
setvalueColumns((s) => {
let submitdata = {
...s,
...val,
};
doFetch({
url: '/ngic-base-business/paFieldScene/save',
params: {
sceneMark: activeTabKey ? path + activeTabKey : path,
controList: Object.keys(submitdata).map((it) => {
return {
fieldKey: it,
fieldWidth: submitdata[it].width,
fieldOrder: submitdata[it].order,
fieldFixed: submitdata[it].fixed,
fieldShow: submitdata[it].show,
};
}),
},
});
},
return submitdata;
});
},
}
},
}
: {};
const datas = dataSource ? { dataSource, toolBarRender: false } : { request };
return (
<ProTable
{...props}
......@@ -404,19 +403,19 @@ const Mtable = (props) => {
scroll={
x
? {
x: x,
}
x: x,
}
: {}
}
pagination={
pagination
? {
showTotal: (total, range) => <span>{total}</span>,
showQuickJumper: true,
showSizeChanger: true,
pageSizeOptions: [5, 10, 15, 30, 50, 100, 200],
defaultPageSize: pageSize || 15,
}
showTotal: (total, range) => <span>{total}</span>,
showQuickJumper: true,
showSizeChanger: true,
pageSizeOptions: [5, 10, 15, 30, 50, 100, 200],
defaultPageSize: pageSize || 15,
}
: false
}
search={{
......
......@@ -53,7 +53,8 @@ const {
message,
AutoComplete,
Row,
Button
Button,
Empty
} = Antd;
const AntdCheckBox = Antd.Checkbox;
......@@ -106,75 +107,92 @@ function treeForeach(tree, func) {
});
}
let FormRender = memo(({ fields = [], name, curindex, formRef }) => {
let FormRender = memo(({ fields = [], name, curindex, formRef, action }) => {
const value = action.getCurrentRowData();
return (
<>
{fields
.filter((it) => it.hideInForm !== true)
.map((item, index) => {
let key = item?.valueType ? upperCase(item?.valueType) : 'Input';
let { hideInForm } = item;
let key = item?.valueType ? upperCase(item?.valueType) : "Input";
let { hideInForm, editable } = item;
if (hideInForm && Object.keys(hideInForm)) {
return (
<ProFormDependency name={Object.keys(hideInForm)}>
<ProFormDependency name={Object.keys(hideInForm)} key={index}>
{(params) => {
let ifs = true;
let res = Object.keys(hideInForm).map((its) => {
let val =
JSON.stringify(params[its]) === "[]" ? "[]" : params[its];
if (Array.isArray(hideInForm[its])) {
return !hideInForm[its].includes(params[its]);
return !hideInForm[its].includes(val);
} else {
let vals = hideInForm[its].reverse; //取反 即不存在当前数组中的
return vals.indexOf(params[its]) != -1;
//取反 即不存在当前数组中的
let vals = hideInForm[its].reverse;
return vals.indexOf(val) != -1;
}
});
ifs = res.includes(false);
if (ifs) {
return (
<Col {...item.colProps}>
<Col {...item.colProps} key={index}>
{curindex == 0 ? (
<p>
<label htmlFor="">{item.title}</label>
<p style={{ padding: '6px 0 0 0', margin: 0 }}>
<b style={{ color: 'red' }}>!</b> 需满足条件才可以填写{item.title}
<p style={{ padding: "6px 0 0 0", margin: 0 }}>
<b style={{ color: "red" }}>!</b>{" "}
需满足条件才可以填写{item.title}
</p>
</p>
) : (
<p style={{ padding: '4px 0 0 0', margin: 0 }}>
<b style={{ color: 'red' }}>!</b> 需满足条件才可以填写{item.title}
<p style={{ padding: "4px 0 0 0", margin: 0 }}>
<b style={{ color: "red" }}>!</b>{" "}
需满足条件才可以填写{item.title}
</p>
)}
</Col>
);
} else {
return (
<>
{createElement(FormItems[key], {
item: item,
colProps: item.colProps,
key: item?.dataIndex,
name: name,
formRef,
curindex,
})}
</>
);
return createElement(FormItems[key], {
item: item,
colProps: item.colProps,
key: item.dataIndex,
name: name,
formRef,
curindex,
});
}
}}
</ProFormDependency>
);
} else {
return (
<>
{createElement(FormItems[key], {
item: item,
colProps: item.colProps,
key: item?.dataIndex,
name: name,
formRef,
curindex,
})}
</>
} else if (editable === false) {
return curindex === 0 ? (
<Col {...item.colProps} style={{ height: 68 }} key={index}>
<p>
<label htmlFor="">{item.title}</label>
<p style={{ padding: "6px 0 0 0", margin: 0 }}>
{value[item?.key ?? item?.dataIndex] ?? "-"}
</p>
</p>
</Col>
) : (
<Col {...item.colProps} style={{ height: 68 }} key={index}>
<p>
<p style={{ padding: "6px 0 0 0", margin: 0 }}>
{value[item?.key ?? item?.dataIndex] ?? "-"}
</p>
</p>
</Col>
);
} else {
return createElement(FormItems[key], {
item: item,
colProps: item.colProps,
key: item.dataIndex,
name: name,
formRef,
curindex,
})
}
})}
</>
......@@ -182,7 +200,7 @@ let FormRender = memo(({ fields = [], name, curindex, formRef }) => {
});
// colProps 默认删格
function Input({ item, colProps }) {
function Input({ item, colProps, curindex = 0 }) {
let keys = item?.key ?? item?.dataIndex ?? '';
const defaultrule =
keys.indexOf('phone') != -1
......@@ -196,7 +214,6 @@ function Input({ item, colProps }) {
message: '邮箱格式不正确',
}
: {};
return (
<>
<ProFormText
......@@ -207,7 +224,7 @@ function Input({ item, colProps }) {
}} //手机号邮箱自带验证
name={keys}
colProps={item.colProps ?? colProps}
label={item.title}
label={curindex == 0 ? item.title : ""}
placeholder={`请输入${item.title}`}
/>
</>
......@@ -526,7 +543,7 @@ function TimeRange({ item, colProps }) {
);
}
function LinkSelect({ item, colProps, formRef, name, curindex }) {
function LinkSelect({ item, colProps, formRef, name, curindex = 0 }) {
let curoption = item.options ?? null,
curlinkparams = curoption?.linkParams ?? {}, //获取linkParams下声明的key
extraParams = curoption?.extraParams ?? {};
......@@ -544,7 +561,7 @@ function LinkSelect({ item, colProps, formRef, name, curindex }) {
formItemProps={item.formItemProps}
name={curkey}
colProps={item.colProps ?? colProps}
label={item.title}
label={curindex == 0 ? item.title : ""}
placeholder={`请选择${item.title}`}
params={params}
request={async (parse) => {
......@@ -597,7 +614,7 @@ function LinkSelect({ item, colProps, formRef, name, curindex }) {
);
}
function NolinkSelect({ item, colProps }) {
function NolinkSelect({ item, colProps, curindex = 0 }) {
let options = {
options: [],
},
......@@ -615,7 +632,6 @@ function NolinkSelect({ item, colProps }) {
},
};
}
return (
<>
<ProFormSelect
......@@ -623,7 +639,7 @@ function NolinkSelect({ item, colProps }) {
formItemProps={item.formItemProps}
name={item?.key ?? item?.dataIndex}
colProps={item.colProps ?? colProps}
label={item.title}
label={curindex == 0 ? item.title : ""}
placeholder={`请选择${item.title}`}
showSearch
{...options}
......@@ -1424,14 +1440,14 @@ function Expandable({ item, colProps }) {
);
}
function FormList({ item, colProps, formRef }) {
function FormList(props) {
let { item, colProps, formRef } = props;
let col = item.colProps ?? colProps;
let fields = item.columns;
let fields = item.columns ?? [];
return (
<Col {...col}>
<ProFormList
name={item?.key ?? item?.dataIndex}
name={item.key ?? item.dataIndex}
label={item.title}
min={item.min ?? 0}
max={item.max ?? 100}
......@@ -1439,7 +1455,8 @@ function FormList({ item, colProps, formRef }) {
return <ProForm.Group>{doms}</ProForm.Group>;
}}
alwaysShowItemLabel={false}
copyIconProps={false}
copyIconProps={item?.copyIconProps ?? false}
deleteIconProps={item?.deleteIconProps ?? true}
>
{(f, index, action) => {
return (
......@@ -1448,7 +1465,7 @@ function FormList({ item, colProps, formRef }) {
action={action}
curindex={index}
formRef={formRef}
name={item?.key ?? item?.dataIndex}
name={item.key ?? item.dataIndex}
/>
);
}}
......
......@@ -57,6 +57,10 @@ ol {
justify-content: space-between !important;
}
.ant-pro-table-list-toolbar-left {
display: none;
}
@media (max-width: @screen-xs) {
.ant-table {
width: 100%;
......@@ -256,12 +260,12 @@ ol {
}
}
.ant-pro .ant-layout-header.ant-pro-layout-header {
.ant-layout-header.ant-pro-layout-header {
height: 48px !important;
line-height: 48px !important;
}
.ant-pro .ant-pro-layout .ant-pro-layout-content {
.ant-pro-layout .ant-pro-layout-content {
margin: 0 !important;
padding: 0 !important;
}
......@@ -548,4 +552,18 @@ ol {
display: flex !important;
align-items: center;
}
}
.formList {
>div {
>div {
>div {
>div {
>div:last-child {
padding: 12px;
}
}
}
}
}
}
\ No newline at end of file
......@@ -237,9 +237,7 @@ function getcolumns(setdrawer) {
{ label: '绑定', value: '7' },
{ label: '销售', value: '8' },
],
colProps: {
fixed: 'right'
}
fixed: 'right'
},
],
pathconfig: {
......
......@@ -293,7 +293,7 @@ const Ledger = () => {
];
}}
bordered={false}
x={1200}
x={1500}
/>
</div>
</div>
......
......@@ -33,6 +33,7 @@
.ledgerright {
flex: 1;
border-left: 1px solid #f0f0f0;
overflow: hidden;
}
}
}
\ No newline at end of file
import { doFetch } from '@/utils/doFetch';
import { Switch } from 'antd';
import fieldsDetail from '@/utils/fieldsDetail';
function getcolumns(ifs, actionRef) {
return [
{
title: '供应商编号',
dataIndex: 'supplierNo',
key: 'supplierNo',
width: 120,
},
{
title: '供应商名称',
dataIndex: 'supplierName',
key: 'supplierName',
width: 150,
formItemProps: {
rules: [
{
required: true,
message: '此项为必填项',
},
],
},
},
{
title: '公司官网',
dataIndex: 'officialWebsite',
key: 'officialWebsite',
hideInTable: true,
search: false,
formItemProps: {
rules: [
{
required: false,
message: '此项为必填项',
},
],
},
},
{
title: '联系电话',
dataIndex: 'telephone',
key: 'telephone',
formItemProps: {
rules: [
{
required: false,
message: '此项为必填项',
},
],
},
},
{
title: '邮箱',
dataIndex: 'email',
key: 'email',
formItemProps: {
rules: [
{
required: false,
message: '此项为必填项',
},
],
},
},
{
title: '地址',
dataIndex: 'address',
key: 'address',
search: false,
width: 320,
formItemProps: {
rules: [
{
required: false,
message: '此项为必填项',
},
],
},
},
{
title: '状态',
dataIndex: 'status',
valueType: 'radio',
key: 'status',
options: [
{
label: '启用',
value: 1,
},
{
label: '禁用',
value: 2,
},
],
hideInTable: true,
hideInForm: true,
},
{
title: '状态',
dataIndex: 'status',
key: 'status',
valueType: 'select',
search: false,
formItemProps: {
rules: [
{
required: false,
message: '此项为必填项',
},
],
},
options: [
{
label: '启用',
value: 1,
},
{
label: '禁用',
value: 2,
},
],
fieldProps: {
disabled: ifs,
},
render: (text, row) => {
return (
<Switch
checkedChildren="启用"
unCheckedChildren="禁用"
checked={row?.status == 1}
disabled={row?.statusChangeable == 1 ? false : true}
onChange={(flag) => {
// //console.log(e);
if (flag) {
doFetch({
url: '/asset/equipmentSupplier/update/status',
params: { id: row.id, status: '1' },
}).then(() => {
actionRef.current.reload();
});
} else {
doFetch({
url: '/asset/equipmentSupplier/update/status',
params: { id: row.id, status: '2' },
}).then(() => {
actionRef.current.reload();
});
}
}}
/>
);
},
},
{
title: '评分',
dataIndex: 'score',
key: 'score',
width: 50,
valueType: 'rate',
searchValueType: 'digit',
fieldProps: {
defaultValue: 0,
max: 5,
precision: 1,
},
formItemProps: {
rules: [
{
required: false,
message: '此项为必填项',
},
],
},
},
{
title: '备注',
dataIndex: 'remark',
key: 'remark',
search: false,
valueType: 'textarea',
width: 300,
fieldProps: {
placeholder: '请输入',
showCount: true,
maxLength: 255,
},
formItemProps: {
rules: [
{
required: false,
message: '此项为必填项',
},
],
},
},
{
title: '联系信息',
valueType: 'formList',
dataIndex: 'list',
key: 'supplierUserList',
initialValue: [
{
state: 'all',
title: '标题',
},
],
colProps: {
xs: 24,
sm: 24,
},
columns: [
{
title: '联系人',
dataIndex: 'userName',
key: 'userName',
formItemProps: {
rules: [
{
required: true,
message: '此项为必填项',
},
],
},
colProps: {
sm: 6,
}
},
{
title: '手机号码',
dataIndex: 'telephone',
key: 'telephone',
colProps: {
sm: 6,
},
formItemProps: {
rules: [
{
required: false,
message: '此项为必填项',
},
{ pattern: new RegExp(/^1[3456789]\d{9}$/, 'g'), message: '' },
],
},
},
{
title: '邮箱',
dataIndex: 'email',
key: 'email',
colProps: {
sm: 6,
},
},
{
title: '职务',
dataIndex: 'title',
key: 'title',
fieldProps: {
placeholder: '请输入职务',
},
formItemProps: {
rules: [
{
required: false,
message: '此项为必填项',
},
],
},
colProps: {
sm: 6,
},
},
],
search: false,
hideInTable: true,
},
];
}
export default getcolumns;
This diff is collapsed.
This diff is collapsed.
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