import { Image, Tag } from 'antd';
function getcolumns(setdrawer) {
return [
{
title: '设备编号',
dataIndex: 'equipmentNo',
key: 'equipmentNo',
width: 120,
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '设备名称',
dataIndex: 'equipmentName',
width: 220,
key: 'equipmentName',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '位置号',
width: 120,
dataIndex: 'positionNo',
search: false,
hideInTable: true,
key: 'positionNo',
},
{
width: 120,
title: '设备类型',
dataIndex: 'equipmentTypeName',
key: 'equipmentTypeId',
valueType: 'treeSelect',
options: { path: '/asset/equipmentType/queryTreeList', params: {} },
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '设备型号',
dataIndex: 'equipmentModelName',
width: 120,
key: 'equipmentModelId',
valueType: 'select',
fieldProps: {
placeholder: '请选择',
showSearch: true,
},
options: { path: '/asset/equipmentModel/query/selection', params: {} },
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '公司名称',
dataIndex: 'organizationName',
width: 120,
key: 'organizationId',
fieldProps: {
placeholder: '请选择',
showSearch: true,
},
valueType: 'select',
options: { path: '/auth/sysDepartment/query/organization/selectbox', params: {} },
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '部门名称',
width: 120,
valueType: 'treeSelect',
dataIndex: 'departmentName',
key: 'departmentId',
options: {
path: '/auth/sysDepartment/query/children/tree',
linkParams: {
organizationId: 'parentId',
},
},
},
{
title: '工厂名称',
dataIndex: 'factoryName',
key: 'factoryId',
width: 120,
fieldProps: {
placeholder: '请选择',
showSearch: true,
},
valueType: 'select',
options: { path: '/auth/sysFactory/getAllFactorySelection', params: {} },
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '车间名称',
dataIndex: 'shopName',
width: 120,
valueType: 'select',
fieldProps: {
placeholder: '请选择',
showSearch: true,
},
options: {
path: '/auth/sysShop/getShopSelectionByFactory',
linkParams: {
factoryId: '',
},
},
key: 'shopId',
search: false,
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '车间名称',
dataIndex: 'shopName',
width: 120,
valueType: 'select',
fieldProps: {
placeholder: '请选择',
showSearch: true,
},
options: {
path: '/auth/sysShop/getAllShopSelection',
params: {},
},
key: 'shopId',
hideInForm: true,
hideInTable: true,
},
{
title: '工段名称',
width: 120,
dataIndex: 'sectionName',
key: 'sectionId',
fieldProps: {
placeholder: '请选择',
showSearch: true,
},
valueType: 'select',
options: {
path: '/auth/sysSection/getAllSectionSelectionByShop',
linkParams: {
shopId: '',
},
},
search: false,
},
{
title: '工段名称',
width: 120,
dataIndex: 'sectionName',
key: 'sectionId',
fieldProps: {
placeholder: '请选择',
showSearch: true,
},
valueType: 'select',
options: {
path: '/auth/sysSection/getAllSectionSelection',
params: {},
},
hideInForm: true,
hideInTable: true,
},
{
title: '产线名称',
width: 120,
dataIndex: 'productLineName',
valueType: 'select',
fieldProps: {
placeholder: '请选择',
showSearch: true,
},
key: 'productLineId',
options: {
path: '/auth/sysProductionLine/getAllProductLineSelectionByShop',
linkParams: {
shopId: '',
},
},
search: false,
},
{
title: '产线名称',
width: 120,
dataIndex: 'productLineName',
valueType: 'select',
fieldProps: {
placeholder: '请选择',
showSearch: true,
},
key: 'productLineId',
options: {
path: '/auth/sysProductionLine/getAllProductLineSelection',
params: {},
},
hideInForm: true,
hideInTable: true,
},
{
title: '供应商',
width: 120,
valueType: 'select',
dataIndex: 'supplierName',
hideInTable: true,
search: false,
key: 'supplierId',
options: {
path: '/asset/equipmentSupplier/query/selection',
params: {},
},
},
{
title: '设备原值(万元)',
valueType: 'digit',
search: false,
hideInTable: true,
dataIndex: 'equipmentWorth',
key: 'equipmentWorth',
},
{
title: '安装投产日期',
hideInTable: true,
search: false,
dataIndex: 'productDate',
key: 'productDate',
valueType: 'date',
},
{
title: '图片',
width: 120,
dataIndex: 'pictureUrl',
search: false,
search: false,
key: 'picList',
valueType: 'uploadImage',
fieldProps: {
limit: 1,
},
formItemProps: {
rules: [
{
required: false,
message: '此项为必填项',
},
],
},
render: (text, row) => {
if (row?.pictureUrl == null) {
return '暂无图片';
} else {
return