Commit 029f1993 authored by wuhao's avatar wuhao 🎯

asder

parent d03a2a65
...@@ -95,16 +95,17 @@ const Mtable = (props) => { ...@@ -95,16 +95,17 @@ const Mtable = (props) => {
: resizeable : resizeable
? 160 ? 160
: 'auto'; : 'auto';
let options = {}; let options = {},
faoptopns = it?.searchOptions ?? it?.options;
if (['select', 'treeSelect', 'radio', 'checkbox', 'cascader'].includes(it?.valueType)) { if (['select', 'treeSelect', 'radio', 'checkbox', 'cascader'].includes(it?.valueType)) {
if (Array.isArray(it.options)) { if (Array.isArray(faoptopns)) {
options = { options = {
fieldProps: { fieldProps: {
...it?.fieldProps, ...it?.fieldProps,
options: [...it.options], options: [...faoptopns],
}, },
}; };
} else if (it.options) { } else if (faoptopns) {
options = { options = {
request: async (params) => { request: async (params) => {
let list = await doFetch({ url: it?.options?.path, params: it?.options?.params }); let list = await doFetch({ url: it?.options?.path, params: it?.options?.params });
...@@ -157,16 +158,17 @@ const Mtable = (props) => { ...@@ -157,16 +158,17 @@ const Mtable = (props) => {
return columns.map((item, index) => { return columns.map((item, index) => {
let it = { ...item }; let it = { ...item };
let itemwidth = it.width ? it.width : resizeable ? 160 : 'auto'; let itemwidth = it.width ? it.width : resizeable ? 160 : 'auto';
let options = {}; let options = {},
faoptopns = it?.searchOptions ?? it?.options;
if (['select', 'treeSelect', 'radio', 'checkbox', 'cascader'].includes(it?.valueType)) { if (['select', 'treeSelect', 'radio', 'checkbox', 'cascader'].includes(it?.valueType)) {
if (Array.isArray(it.options)) { if (Array.isArray(faoptopns)) {
options = { options = {
fieldProps: { fieldProps: {
...it?.fieldProps, ...it?.fieldProps,
options: [...it.options], options: [...faoptopns],
}, },
}; };
} else if (it.options) { } else if (faoptopns) {
options = { options = {
params: newparames, params: newparames,
request: async (params) => { request: async (params) => {
......
...@@ -24,6 +24,7 @@ function getcolumns(setdrawer) { ...@@ -24,6 +24,7 @@ function getcolumns(setdrawer) {
path: '/sparepart/sparePart/queryAllSelect', path: '/sparepart/sparePart/queryAllSelect',
params: {}, params: {},
}, },
render: (text, row) => row?.sparePartNo + '/' + row?.sparePartName,
}, },
{ {
title: '供应商编号/名称', title: '供应商编号/名称',
...@@ -47,6 +48,7 @@ function getcolumns(setdrawer) { ...@@ -47,6 +48,7 @@ function getcolumns(setdrawer) {
path: '/sparepart/sparePartSupplier/queryOnSelect', path: '/sparepart/sparePartSupplier/queryOnSelect',
params: {}, params: {},
}, },
render: (text, row) => row?.supplierNo + '/' + row?.supplierName,
}, },
{ {
title: '入库数量', title: '入库数量',
...@@ -120,6 +122,27 @@ function getcolumns(setdrawer) { ...@@ -120,6 +122,27 @@ function getcolumns(setdrawer) {
value: '3', value: '3',
}, },
], ],
searchOptions: [
{
label: '采购入库',
value: '1',
},
{
label: '生产入库',
value: '2',
},
{
label: '其他入库',
value: '3',
},
{
label: '备件回冲入库',
value: '4',
},
],
fieldProps: {
dropdownMatchSelectWidth: 120,
},
formItemProps: { formItemProps: {
rules: [ rules: [
{ {
...@@ -263,6 +286,27 @@ function getcolumns(setdrawer) { ...@@ -263,6 +286,27 @@ function getcolumns(setdrawer) {
value: '3', value: '3',
}, },
], ],
searchOptions: [
{
label: '采购入库',
value: '1',
},
{
label: '生产入库',
value: '2',
},
{
label: '其他入库',
value: '3',
},
{
label: '备件回冲入库',
value: '4',
},
],
fieldProps: {
dropdownMatchSelectWidth: 120,
},
formItemProps: { formItemProps: {
rules: [ rules: [
{ {
......
...@@ -103,11 +103,28 @@ function getcolumns(setdrawer) { ...@@ -103,11 +103,28 @@ function getcolumns(setdrawer) {
label: '其它出库', label: '其它出库',
value: '3', value: '3',
}, },
],
searchOptions: [
{
label: '销售出库',
value: '1',
},
{
label: '报废出库',
value: '2',
},
{
label: '其它出库',
value: '3',
},
{ {
label: '备件申领出库', label: '备件申领出库',
value: '4', value: '4',
}, },
], ],
fieldProps: {
dropdownMatchSelectWidth: 120,
},
}, },
{ {
title: '入库仓库', title: '入库仓库',
...@@ -199,10 +216,12 @@ function getcolumns(setdrawer) { ...@@ -199,10 +216,12 @@ function getcolumns(setdrawer) {
render: (text, row) => { render: (text, row) => {
return ( return (
<AutoTable <AutoTable
columns={columns?.map((it) => ({ columns={columns
...it, ?.filter((it) => it.key != 'usedStock')
hideInSearch: true, ?.map((it) => ({
}))} ...it,
hideInSearch: true,
}))}
dataSource={row?.taskSpareList} dataSource={row?.taskSpareList}
resizeable={false} resizeable={false}
expandable={{ expandable={{
...@@ -262,11 +281,28 @@ function getcolumns(setdrawer) { ...@@ -262,11 +281,28 @@ function getcolumns(setdrawer) {
label: '其它出库', label: '其它出库',
value: '3', value: '3',
}, },
],
searchOptions: [
{
label: '销售出库',
value: '1',
},
{
label: '报废出库',
value: '2',
},
{
label: '其它出库',
value: '3',
},
{ {
label: '备件申领出库', label: '备件申领出库',
value: '4', value: '4',
}, },
], ],
fieldProps: {
dropdownMatchSelectWidth: 120,
},
}, },
{ {
title: '入库仓库', title: '入库仓库',
...@@ -369,10 +405,12 @@ function getcolumns(setdrawer) { ...@@ -369,10 +405,12 @@ function getcolumns(setdrawer) {
render: (text, row) => { render: (text, row) => {
return ( return (
<AutoTable <AutoTable
columns={columns?.map((it) => ({ columns={columns
...it, ?.filter((it) => it.key != 'usedStock')
hideInSearch: true, ?.map((it) => ({
}))} ...it,
hideInSearch: true,
}))}
resizeable={false} resizeable={false}
dataSource={row?.taskSpareList} dataSource={row?.taskSpareList}
expandable={{ expandable={{
......
...@@ -45,6 +45,7 @@ function getcolumns(setdrawer) { ...@@ -45,6 +45,7 @@ function getcolumns(setdrawer) {
title: '库存单位', title: '库存单位',
dataIndex: 'unit', dataIndex: 'unit',
key: 'unit', key: 'unit',
hideInSearch: true,
}, },
{ {
title: '入库仓库', title: '入库仓库',
...@@ -65,11 +66,13 @@ function getcolumns(setdrawer) { ...@@ -65,11 +66,13 @@ function getcolumns(setdrawer) {
title: '操作后的备件库存', title: '操作后的备件库存',
dataIndex: 'actualStock', dataIndex: 'actualStock',
key: 'actualStock', key: 'actualStock',
hideInSearch: true,
}, },
{ {
title: '操作数量', title: '操作数量',
dataIndex: 'operateNum', dataIndex: 'operateNum',
key: 'operateNum', key: 'operateNum',
hideInSearch: true,
}, },
{ {
title: '相关单号', title: '相关单号',
......
...@@ -61,6 +61,8 @@ function getcolumns(type) { ...@@ -61,6 +61,8 @@ function getcolumns(type) {
dataIndex: 'applyReasonName', dataIndex: 'applyReasonName',
key: 'applyReason', key: 'applyReason',
valueType: 'select', valueType: 'select',
searchValueType: 'input',
searchKey: 'applyReasonName',
options: [ options: [
{ {
label: '备库领用', label: '备库领用',
...@@ -85,6 +87,8 @@ function getcolumns(type) { ...@@ -85,6 +87,8 @@ function getcolumns(type) {
dataIndex: 'inWarehouseName', dataIndex: 'inWarehouseName',
key: 'inWarehouseId', key: 'inWarehouseId',
valueType: 'select', valueType: 'select',
searchValueType: 'input',
searchKey: 'inWarehouseName',
options: { options: {
path: '/auth/sysShop/getUserShopSelection', path: '/auth/sysShop/getUserShopSelection',
params: {}, params: {},
...@@ -177,10 +181,12 @@ function getcolumns(type) { ...@@ -177,10 +181,12 @@ function getcolumns(type) {
render: (text, row) => { render: (text, row) => {
return ( return (
<AutoTable <AutoTable
columns={columns?.map((it) => ({ columns={columns
...it, ?.filter((it) => it.key != 'usedStock')
hideInSearch: true, .map((it) => ({
}))} ...it,
hideInSearch: true,
}))}
dataSource={row?.detailsList} dataSource={row?.detailsList}
/> />
); );
...@@ -252,6 +258,8 @@ function getcolumns(type) { ...@@ -252,6 +258,8 @@ function getcolumns(type) {
dataIndex: 'applyReasonName', dataIndex: 'applyReasonName',
key: 'applyReason', key: 'applyReason',
valueType: 'select', valueType: 'select',
searchValueType: 'input',
searchKey: 'applyReasonName',
options: [ options: [
{ {
label: '备库领用', label: '备库领用',
...@@ -276,6 +284,8 @@ function getcolumns(type) { ...@@ -276,6 +284,8 @@ function getcolumns(type) {
dataIndex: 'inWarehouseName', dataIndex: 'inWarehouseName',
key: 'inWarehouseId', key: 'inWarehouseId',
valueType: 'select', valueType: 'select',
searchValueType: 'input',
searchKey: 'inWarehouseName',
options: { options: {
path: '/auth/sysShop/getUserShopSelection', path: '/auth/sysShop/getUserShopSelection',
params: {}, params: {},
...@@ -384,10 +394,12 @@ function getcolumns(type) { ...@@ -384,10 +394,12 @@ function getcolumns(type) {
render: (text, row) => { render: (text, row) => {
return ( return (
<AutoTable <AutoTable
columns={columns?.map((it) => ({ columns={columns
...it, ?.filter((it) => it.key != 'usedStock')
hideInSearch: true, .map((it) => ({
}))} ...it,
hideInSearch: true,
}))}
dataSource={row?.detailsList} dataSource={row?.detailsList}
/> />
); );
......
/* eslint-disable react-hooks/exhaustive-deps */
import * as React from 'react'; import * as React from 'react';
import { useState, useMemo, useRef } from 'react'; import { useState, useMemo, useRef } from 'react';
import DrawerPro from '@/components/DrawerPro'; import DrawerPro from '@/components/DrawerPro';
...@@ -116,6 +117,7 @@ function Requisition(props) { ...@@ -116,6 +117,7 @@ function Requisition(props) {
title: '是否删除?', title: '是否删除?',
okText: '确认', okText: '确认',
cancelText: '取消', cancelText: '取消',
disabled: row.status !== 1,
onConfirm: () => { onConfirm: () => {
run({ url: pathconfig?.delete || '/delete', params: { id: row?.id } }); run({ url: pathconfig?.delete || '/delete', params: { id: row?.id } });
}, },
...@@ -123,6 +125,7 @@ function Requisition(props) { ...@@ -123,6 +125,7 @@ function Requisition(props) {
btn={{ btn={{
size: 'small', size: 'small',
type: 'danger', type: 'danger',
disabled: row.status !== 1,
}} }}
> >
删除 删除
...@@ -189,7 +192,21 @@ function Requisition(props) { ...@@ -189,7 +192,21 @@ function Requisition(props) {
/> />
<DrawerPro <DrawerPro
fields={columns} fields={columns?.filter((it) => {
if (drawer?.item?.status == 1) {
return (
[
'cdetails',
'approvalUserName',
'approvalTime',
'approvalResultName',
'approvalRemark',
].indexOf(it?.dataIndex) == -1
);
} else {
return true;
}
})}
detailpath={pathconfig?.detail || null} detailpath={pathconfig?.detail || null}
defaultFormValue={drawer?.item} defaultFormValue={drawer?.item}
params={{ id: drawer?.item?.id }} params={{ id: drawer?.item?.id }}
......
...@@ -73,6 +73,8 @@ function getcolumns(type) { ...@@ -73,6 +73,8 @@ function getcolumns(type) {
dataIndex: 'backReasonName', dataIndex: 'backReasonName',
key: 'backReason', key: 'backReason',
valueType: 'select', valueType: 'select',
searchValueType: 'input',
searchKey: 'backReasonName',
options: [ options: [
{ {
label: '回冲入库', label: '回冲入库',
...@@ -91,7 +93,7 @@ function getcolumns(type) { ...@@ -91,7 +93,7 @@ function getcolumns(type) {
{ {
title: '入库仓库', title: '入库仓库',
dataIndex: 'inWarehouseName', dataIndex: 'inWarehouseName',
key: 'inWarehouseId', key: 'inWarehouseName',
hideInForm: true, hideInForm: true,
}, },
{ {
...@@ -99,6 +101,8 @@ function getcolumns(type) { ...@@ -99,6 +101,8 @@ function getcolumns(type) {
dataIndex: 'outWarehouseName', dataIndex: 'outWarehouseName',
key: 'outWarehouseId', key: 'outWarehouseId',
valueType: 'select', valueType: 'select',
searchValueType: 'input',
searchKey: 'outWarehouseName',
options: { options: {
path: '/auth/sysShop/getUserShopSelection', path: '/auth/sysShop/getUserShopSelection',
params: {}, params: {},
...@@ -204,10 +208,12 @@ function getcolumns(type) { ...@@ -204,10 +208,12 @@ function getcolumns(type) {
render: (text, row) => { render: (text, row) => {
return ( return (
<AutoTable <AutoTable
columns={columns?.map((it) => ({ columns={columns
...it, ?.filter((it) => it.key != 'usedStock')
hideInSearch: true, ?.map((it) => ({
}))} ...it,
hideInSearch: true,
}))}
dataSource={row?.detailsList} dataSource={row?.detailsList}
/> />
); );
...@@ -279,6 +285,8 @@ function getcolumns(type) { ...@@ -279,6 +285,8 @@ function getcolumns(type) {
dataIndex: 'backReasonName', dataIndex: 'backReasonName',
key: 'backReason', key: 'backReason',
valueType: 'select', valueType: 'select',
searchValueType: 'input',
searchKey: 'backReasonName',
options: [ options: [
{ {
label: '回冲入库', label: '回冲入库',
...@@ -297,13 +305,15 @@ function getcolumns(type) { ...@@ -297,13 +305,15 @@ function getcolumns(type) {
{ {
title: '入库仓库', title: '入库仓库',
dataIndex: 'inWarehouseName', dataIndex: 'inWarehouseName',
key: 'inWarehouseId', key: 'inWarehouseName',
hideInForm: true, hideInForm: true,
}, },
{ {
title: '出库仓库', title: '出库仓库',
dataIndex: 'outWarehouseName', dataIndex: 'outWarehouseName',
key: 'outWarehouseId', key: 'outWarehouseId',
searchValueType: 'input',
searchKey: 'outWarehouseName',
valueType: 'select', valueType: 'select',
options: { options: {
path: '/auth/sysShop/getUserShopSelection', path: '/auth/sysShop/getUserShopSelection',
...@@ -426,10 +436,12 @@ function getcolumns(type) { ...@@ -426,10 +436,12 @@ function getcolumns(type) {
render: (text, row) => { render: (text, row) => {
return ( return (
<AutoTable <AutoTable
columns={columns?.map((it) => ({ columns={columns
...it, ?.filter((it) => it.key != 'usedStock')
hideInSearch: true, ?.map((it) => ({
}))} ...it,
hideInSearch: true,
}))}
dataSource={row?.detailsList} dataSource={row?.detailsList}
/> />
); );
......
...@@ -59,7 +59,7 @@ function Spareback(props) { ...@@ -59,7 +59,7 @@ function Spareback(props) {
<PremButton <PremButton
btn={{ btn={{
size: 'small', size: 'small',
disabled: row.status == 2, disabled: row.status !== 1,
onClick: () => { onClick: () => {
setdrawer((s) => ({ setdrawer((s) => ({
...s, ...s,
...@@ -116,6 +116,7 @@ function Spareback(props) { ...@@ -116,6 +116,7 @@ function Spareback(props) {
title: '是否删除?', title: '是否删除?',
okText: '确认', okText: '确认',
cancelText: '取消', cancelText: '取消',
disabled: row.status !== 1,
onConfirm: () => { onConfirm: () => {
run({ url: pathconfig?.delete || '/delete', params: { id: row?.id } }); run({ url: pathconfig?.delete || '/delete', params: { id: row?.id } });
}, },
...@@ -123,6 +124,7 @@ function Spareback(props) { ...@@ -123,6 +124,7 @@ function Spareback(props) {
btn={{ btn={{
size: 'small', size: 'small',
type: 'danger', type: 'danger',
disabled: row.status !== 1,
}} }}
> >
删除 删除
...@@ -189,7 +191,21 @@ function Spareback(props) { ...@@ -189,7 +191,21 @@ function Spareback(props) {
/> />
<DrawerPro <DrawerPro
fields={columns} fields={columns?.filter((it) => {
if (drawer?.item?.status == 1) {
return (
[
'cdetails',
'approvalUserName',
'approvalTime',
'approvalResultName',
'approvalRemark',
].indexOf(it?.dataIndex) == -1
);
} else {
return true;
}
})}
detailpath={pathconfig?.detail || null} detailpath={pathconfig?.detail || null}
defaultFormValue={drawer?.item} defaultFormValue={drawer?.item}
params={{ id: drawer?.item?.id }} params={{ id: drawer?.item?.id }}
......
import { Switch } from 'antd'; import { Switch } from 'antd';
import AutoTable from '@/components/AutoTable/mtable';
function getcolumns(changeState) { function getcolumns(changeState) {
let columns = [
{
title: '联系人名称',
dataIndex: 'userName',
key: 'userName',
formItemProps: {
rules: [
{
required: true,
message: '此项为必填项',
},
],
},
colProps: {
sm: 6,
},
},
{
title: '联系电话',
dataIndex: 'telephone',
key: 'telephone',
colProps: {
sm: 6,
},
},
{
title: '邮箱',
dataIndex: 'email',
key: 'email',
colProps: {
sm: 6,
},
},
{
title: '职务',
dataIndex: 'title',
key: 'title',
colProps: {
sm: 6,
},
},
];
return { return {
columns: [ columns: [
{ {
...@@ -98,57 +141,28 @@ function getcolumns(changeState) { ...@@ -98,57 +141,28 @@ function getcolumns(changeState) {
}, },
}, },
{ {
title: '列表', title: '联系信息',
valueType: 'formList', valueType: 'formList',
dataIndex: 'userList', dataIndex: 'userList',
colProps: { colProps: {
xs: 24, xs: 24,
sm: 24, sm: 24,
}, },
columns: [ columns,
{
title: '联系人名称',
dataIndex: 'userName',
key: 'userName',
formItemProps: {
rules: [
{
required: true,
message: '此项为必填项',
},
],
},
colProps: {
sm: 6,
},
},
{
title: '联系电话',
dataIndex: 'telephone',
key: 'telephone',
colProps: {
sm: 6,
},
},
{
title: '邮箱',
dataIndex: 'email',
key: 'email',
colProps: {
sm: 6,
},
},
{
title: '职务',
dataIndex: 'title',
key: 'title',
colProps: {
sm: 6,
},
},
],
hideInSearch: true, hideInSearch: true,
hideInTable: true, hideInTable: true,
render: (text, row) => {
return (
<AutoTable
columns={columns?.map((it) => ({
...it,
hideInSearch: true,
}))}
dataSource={row?.userList}
resizeable={false}
/>
);
},
}, },
], ],
pathconfig: { pathconfig: {
......
...@@ -120,7 +120,11 @@ function Supplier(props) { ...@@ -120,7 +120,11 @@ function Supplier(props) {
url: '/base/paFormField/queryList', url: '/base/paFormField/queryList',
params: { formId: 4 }, params: { formId: 4 },
}); });
let defcolumn = getcolumns(changeState)?.columns; extracolumns = extracolumns?.map((it) => ({
...it,
hideInSearch: true,
}));
let defcolumn = getcolumns(changeState)?.columns ?? [];
setcolumns([ setcolumns([
...defcolumn, ...defcolumn,
...extracolumns, ...extracolumns,
...@@ -170,7 +174,6 @@ function Supplier(props) { ...@@ -170,7 +174,6 @@ function Supplier(props) {
formRef={formRef} formRef={formRef}
placement="right" placement="right"
detailpath={pathconfig?.detail || null} detailpath={pathconfig?.detail || null}
detailData={drawer?.item}
defaultFormValue={drawer?.item} defaultFormValue={drawer?.item}
onClose={() => { onClose={() => {
setdrawer((s) => ({ setdrawer((s) => ({
......
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