Commit 029f1993 authored by wuhao's avatar wuhao 🎯

asder

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