Commit 4d535a31 by 齐伟伦

Merge remote-tracking branch 'origin/weiqiao-vue3' into weiqiao-vue3

parents 1f0b6cff bea303af
......@@ -17,6 +17,12 @@ export interface MesWarehouseProductNumberPageParams extends BasicPageParams {
kxs: string;
erpid: string;
dqsj: string;
tqyjts: string;
bz: string;
}
/**
......@@ -46,6 +52,12 @@ export interface MesWarehouseProductNumberPageModel {
erpid: string;
bz: string;
cpbh: string;
dqsj: string;
tqyjts: string;
}
/**
......@@ -112,6 +124,10 @@ export interface MesWarehouseProductNumberModel {
modifyUserId: string;
dqsj: string;
tqyjts: string;
mesWarehouseProductNumInfoList?: MesWarehouseProductNumInfoModel;
}
......
......@@ -730,6 +730,72 @@ export const formProps: FormProps = {
],
},
{
span: 8,
list: [
{
key: '749c23841dd84b2c994bf00fcb546dd4',
field: 'dqsj',
label: '到期时间',
type: 'date',
component: 'DatePicker',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
span: 7,
defaultValue: '',
width: '100%',
placeholder: '请选择到期时间',
format: 'YYYY-MM-DD HH:mm:ss',
showLabel: true,
allowClear: true,
disabled: false,
required: false,
isShow: true,
rules: [],
events: {},
isGetCurrent: false,
tooltipConfig: { visible: false, title: '提示文本' },
searchType: 'time',
style: { width: '100%' },
},
},
],
},
{
span: 8,
list: [
{
key: '25477fb57417425195a30e82c266c670',
field: 'tqyjts',
label: '提前预警天数',
type: 'number',
component: 'InputNumber',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: 7,
defaultValue: '',
min: 0,
max: 100,
step: 1,
maxlength: null,
disabled: false,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
placeholder: '请输入提前预警天数',
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
],
},
{
span: 24,
list: [
{
......@@ -774,7 +840,7 @@ export const formProps: FormProps = {
colProps: { span: 24 },
componentProps: {
api: uploadApi,
span: 2,
span: 3,
defaultValue: '',
accept: '',
maxNumber: 5,
......
......@@ -173,6 +173,40 @@ export const permissionList = [
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '到期时间',
fieldId: 'dqsj',
isSubTable: false,
showChildren: true,
type: 'date',
key: '749c23841dd84b2c994bf00fcb546dd4',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '提前预警天数',
fieldId: 'tqyjts',
isSubTable: false,
showChildren: true,
type: 'number',
key: '25477fb57417425195a30e82c266c670',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '备注',
fieldId: 'bz',
isSubTable: false,
......
......@@ -202,6 +202,7 @@
title: '操作',
dataIndex: 'action',
slots: { customRender: 'action' },
className: 'action-column-cell',
},
tableSetting: {
size: false,
......@@ -287,8 +288,11 @@
function customRow(record: Recordable) {
//判断行数据是否需要变红
const isRedRow = isNeedWarn(record);
return {
// 核心修改:添加类名,而非行内style
class: isRedRow ? 'red-row' : '',
ondblclick: () => {
if (record.isCanEdit && hasPermission("kczb:edit")) {
handleEdit(record);
......@@ -297,6 +301,37 @@
};
}
/**
* 计算是否需要预警(变红)的函数
* @param record
*/
function isNeedWarn(record: Recordable): boolean {
// 1. 校验字段是否存在,避免报错
if (!record.dqsj || !record.tqyjts) return false;
// 2. 解析到期时间(兼容字符串/时间戳)
const dqsjDate = new Date(record.dqsj);
// 校验时间格式是否合法
if (isNaN(dqsjDate.getTime())) return false;
// 3. 当前时间(取当天0点,避免时分秒干扰)
const now = new Date();
// 4. 计算到期时间 - 当前时间的毫秒差 → 转换为天数
const timeDiff = dqsjDate.getTime() - now.getTime();
const dayDiff = Math.ceil(timeDiff / (1000 * 60 * 60 * 24)); // 向上取整(比如剩余1.2天算2天)
// 5. 判断:天数差 < 提前预警天数且数量>0 需要预警(变红)
// 补充:如果到期时间已过(dayDiff < 0),也强制变红
let isNeedWarn = false;
if (record.sl && record.sl > 0) {
if (dayDiff < record.tqyjts || dayDiff < 0) {
isNeedWarn = true;
}
}
return isNeedWarn;
}
function handleSuccess() {
......@@ -379,7 +414,23 @@
display: none !important;
}
// 其他样式不变,修改预警行样式
:deep(.ant-table-tbody > tr.red-row) {
td {
background-color: #ff4d4f !important;
color: black !important;
}
// 覆盖操作列样式
td.action-column-cell {
background-color: white !important;
color: black !important;
}
/*&:hover td {
background-color: #ff1f1f !important;
}
&:hover td.action-column-cell {
background-color: white !important;
}*/
}
</style>
......@@ -496,354 +496,354 @@ export const formProps: FormProps = {
margin: '10px',
},
},
{
key: '03c19c5ac95b4d139d8380ede64f14ff',
field: '',
label: '',
type: 'grid',
colProps: { span: 24 },
component: 'Grid',
children: [
{
span: 24,
list: [
{
key: '24f0714c9f3a4242b1bcefff04bb7314',
field: '',
label: '',
type: 'tab',
colProps: { span: 24 },
component: 'Tab',
children: [
{
span: 24,
name: '产品/物料',
prefix: '',
suffix: '',
activeColor: '#1c8dff',
folderId: '',
imageUrl: '',
conFolderId: '',
conImageUrl: '',
list: [
{
key: '7cb7c6cdf3ec417280dc49e19dd39ffa',
label: '',
field: 'mesProcessProductList',
type: 'form',
component: 'SubForm',
required: true,
colProps: { span: 24 },
componentProps: {
mainKey: 'mesProcessProductList',
columns: [
{
key: '00c0e93b675841f48265b896515a5241',
title: '编号',
dataIndex: 'code',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: 'cpbh',
},
},
{
key: '91863c5a0ec24d76ade8735cd401059b',
title: '名称',
dataIndex: 'name',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: 'cpmc',
},
},
{
key: '6c749d8f7bde474da082c659146f473c',
title: '数量',
dataIndex: 'number',
componentType: 'InputNumber',
defaultValue: 0,
componentProps: {
width: '100%',
span: '',
defaultValue: 0,
min: 0,
step: 1,
disabled: false,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
listStyle: "return 'width:100%'",
},
},
{
key: 'cb38672445b24eedb2b10addf520de2e',
title: '是否投料',
dataIndex: 'isFeeding',
componentType: 'Switch',
defaultValue: 1,
componentProps: {
span: '',
defaultValue: 1,
checkedChildren: '',
unCheckedChildren: '',
checkedColor: '#545454',
unCheckedColor: '#bbbdbf',
showLabel: true,
disabled: false,
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
},
},
{
key: '607b81d8885746409998c64f0a55a56e',
title: '备注',
dataIndex: 'bz',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '',
maxlength: null,
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: 'bz',
},
},
{
key: '6e053d43971d4157b0f9118f9cbbb4bb',
title: '产品物料id',
dataIndex: 'productId',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: false,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: 'id',
},
},
{ title: '操作', key: 'action', fixed: 'right', width: '50px' },
],
span: '24',
preloadType: 'api',
apiConfig: {
path: '/jcxx/getProduct',
method: 'GET',
apiId: 'copy1767517099244d66500',
apiParams: [
{ key: '1', title: 'Query Params', tableInfo: [] },
{ key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' },
],
script:
'var sql="select *,id as value,name as label from roke_product where delete_mark = 0";\r\nreturn db.select(sql);',
outputParams: [
{ name: 'cpbh', tableTitle: '编号' },
{ name: 'cpmc', tableTitle: '名称' },
{ name: 'bz', tableTitle: '备注' },
{ name: 'id', tableTitle: 'ID' },
],
},
itemId: '',
dicOptions: [],
useSelectButton: true,
buttonName: '新增',
showLabel: true,
showComponentBorder: true,
showBorder: false,
bordercolor: '#f0f0f0',
bordershowtype: [true, true, true, true],
borderwidth: 1,
showIndex: true,
isShow: true,
multipleHeads: [],
buttonList: [],
topButtonList: [],
isExport: false,
isImport: false,
isDeleteSelected: true,
isListView: false,
viewList: [],
isShowAdd: false,
isShowDelete: true,
hasCheckedCol: true,
events: {},
showPagenation: true,
widths: [
{
key: '00c0e93b675841f48265b896515a5241',
name: '编号',
bindField: 'code',
width: null,
minWidth: null,
maxWidth: null,
resizable: false,
unit: null,
isEdit: true,
},
{
key: '91863c5a0ec24d76ade8735cd401059b',
name: '名称',
bindField: 'name',
width: null,
minWidth: null,
maxWidth: null,
resizable: false,
unit: null,
isEdit: true,
},
{
key: '6c749d8f7bde474da082c659146f473c',
name: '数量',
bindField: 'number',
width: null,
minWidth: null,
maxWidth: null,
resizable: false,
unit: null,
isEdit: false,
},
{
key: 'cb38672445b24eedb2b10addf520de2e',
name: '是否投料',
bindField: 'is_feeding',
width: null,
minWidth: null,
maxWidth: null,
resizable: false,
unit: null,
isEdit: false,
},
{
key: '607b81d8885746409998c64f0a55a56e',
name: '备注',
bindField: 'bz',
width: null,
minWidth: null,
maxWidth: null,
resizable: false,
unit: null,
isEdit: false,
},
{
key: '6e053d43971d4157b0f9118f9cbbb4bb',
name: '产品物料id',
bindField: 'product_id',
width: null,
minWidth: null,
maxWidth: null,
resizable: false,
unit: null,
isEdit: false,
},
],
},
},
],
},
],
componentProps: { tabPosition: 'top', size: 'default', type: 'line', isShow: true },
},
],
},
],
componentProps: {
gutter: 1,
justify: 'start',
align: 'top',
isShow: true,
showBorder: false,
bordercolor: '#d9d9d9',
bordershowtype: [true, true, true, true],
borderwidth: 1,
padding: '10px',
margin: '10px',
},
},
// {
// key: '03c19c5ac95b4d139d8380ede64f14ff',
// field: '',
// label: '',
// type: 'grid',
// colProps: { span: 24 },
// component: 'Grid',
// children: [
// {
// span: 24,
// list: [
// {
// key: '24f0714c9f3a4242b1bcefff04bb7314',
// field: '',
// label: '',
// type: 'tab',
// colProps: { span: 24 },
// component: 'Tab',
// children: [
// {
// span: 24,
// name: '产品/物料',
// prefix: '',
// suffix: '',
// activeColor: '#1c8dff',
// folderId: '',
// imageUrl: '',
// conFolderId: '',
// conImageUrl: '',
// list: [
// {
// key: '7cb7c6cdf3ec417280dc49e19dd39ffa',
// label: '',
// field: 'mesProcessProductList',
// type: 'form',
// component: 'SubForm',
// required: true,
// colProps: { span: 24 },
// componentProps: {
// mainKey: 'mesProcessProductList',
// columns: [
// {
// key: '00c0e93b675841f48265b896515a5241',
// title: '编号',
// dataIndex: 'code',
// componentType: 'Input',
// defaultValue: '',
// componentProps: {
// width: '100%',
// span: '',
// defaultValue: '',
// placeholder: '',
// prefix: '',
// suffix: '',
// addonBefore: '',
// addonAfter: '',
// disabled: false,
// allowClear: false,
// showLabel: true,
// required: false,
// rules: [],
// events: {},
// listStyle: '',
// isSave: false,
// isShow: true,
// scan: false,
// bordered: true,
// isShowAi: false,
// tooltipConfig: { visible: false, title: '提示文本' },
// prestrainField: 'cpbh',
// },
// },
// {
// key: '91863c5a0ec24d76ade8735cd401059b',
// title: '名称',
// dataIndex: 'name',
// componentType: 'Input',
// defaultValue: '',
// componentProps: {
// width: '100%',
// span: '',
// defaultValue: '',
// placeholder: '',
// prefix: '',
// suffix: '',
// addonBefore: '',
// addonAfter: '',
// disabled: false,
// allowClear: false,
// showLabel: true,
// required: false,
// rules: [],
// events: {},
// listStyle: '',
// isSave: false,
// isShow: true,
// scan: false,
// bordered: true,
// isShowAi: false,
// tooltipConfig: { visible: false, title: '提示文本' },
// prestrainField: 'cpmc',
// },
// },
// {
// key: '6c749d8f7bde474da082c659146f473c',
// title: '数量',
// dataIndex: 'number',
// componentType: 'InputNumber',
// defaultValue: 0,
// componentProps: {
// width: '100%',
// span: '',
// defaultValue: 0,
// min: 0,
// step: 1,
// disabled: false,
// showLabel: true,
// controls: true,
// required: false,
// subTotal: false,
// isShow: true,
// rules: [],
// events: {},
// tooltipConfig: { visible: false, title: '提示文本' },
// listStyle: "return 'width:100%'",
// },
// },
// {
// key: 'cb38672445b24eedb2b10addf520de2e',
// title: '是否投料',
// dataIndex: 'isFeeding',
// componentType: 'Switch',
// defaultValue: 1,
// componentProps: {
// span: '',
// defaultValue: 1,
// checkedChildren: '',
// unCheckedChildren: '',
// checkedColor: '#545454',
// unCheckedColor: '#bbbdbf',
// showLabel: true,
// disabled: false,
// events: {},
// isShow: true,
// tooltipConfig: { visible: false, title: '提示文本' },
// },
// },
// {
// key: '607b81d8885746409998c64f0a55a56e',
// title: '备注',
// dataIndex: 'bz',
// componentType: 'Input',
// defaultValue: '',
// componentProps: {
// width: '100%',
// span: '',
// defaultValue: '',
// placeholder: '',
// maxlength: null,
// prefix: '',
// suffix: '',
// addonBefore: '',
// addonAfter: '',
// disabled: false,
// allowClear: false,
// showLabel: true,
// required: false,
// rules: [],
// events: {},
// listStyle: '',
// isSave: false,
// isShow: true,
// scan: false,
// bordered: true,
// isShowAi: false,
// tooltipConfig: { visible: false, title: '提示文本' },
// prestrainField: 'bz',
// },
// },
// {
// key: '6e053d43971d4157b0f9118f9cbbb4bb',
// title: '产品物料id',
// dataIndex: 'productId',
// componentType: 'Input',
// defaultValue: '',
// componentProps: {
// width: '100%',
// span: '',
// defaultValue: '',
// placeholder: '',
// prefix: '',
// suffix: '',
// addonBefore: '',
// addonAfter: '',
// disabled: false,
// allowClear: false,
// showLabel: true,
// required: false,
// rules: [],
// events: {},
// listStyle: '',
// isSave: false,
// isShow: false,
// scan: false,
// bordered: true,
// isShowAi: false,
// tooltipConfig: { visible: false, title: '提示文本' },
// prestrainField: 'id',
// },
// },
// { title: '操作', key: 'action', fixed: 'right', width: '50px' },
// ],
// span: '24',
// preloadType: 'api',
// apiConfig: {
// path: '/jcxx/getProduct',
// method: 'GET',
// apiId: 'copy1767517099244d66500',
// apiParams: [
// { key: '1', title: 'Query Params', tableInfo: [] },
// { key: '2', title: 'Header', tableInfo: [] },
// { key: '3', title: 'Body' },
// ],
// script:
// 'var sql="select *,id as value,name as label from roke_product where delete_mark = 0";\r\nreturn db.select(sql);',
// outputParams: [
// { name: 'cpbh', tableTitle: '编号' },
// { name: 'cpmc', tableTitle: '名称' },
// { name: 'bz', tableTitle: '备注' },
// { name: 'id', tableTitle: 'ID' },
// ],
// },
// itemId: '',
// dicOptions: [],
// useSelectButton: true,
// buttonName: '新增',
// showLabel: true,
// showComponentBorder: true,
// showBorder: false,
// bordercolor: '#f0f0f0',
// bordershowtype: [true, true, true, true],
// borderwidth: 1,
// showIndex: true,
// isShow: true,
// multipleHeads: [],
// buttonList: [],
// topButtonList: [],
// isExport: false,
// isImport: false,
// isDeleteSelected: true,
// isListView: false,
// viewList: [],
// isShowAdd: false,
// isShowDelete: true,
// hasCheckedCol: true,
// events: {},
// showPagenation: true,
// widths: [
// {
// key: '00c0e93b675841f48265b896515a5241',
// name: '编号',
// bindField: 'code',
// width: null,
// minWidth: null,
// maxWidth: null,
// resizable: false,
// unit: null,
// isEdit: true,
// },
// {
// key: '91863c5a0ec24d76ade8735cd401059b',
// name: '名称',
// bindField: 'name',
// width: null,
// minWidth: null,
// maxWidth: null,
// resizable: false,
// unit: null,
// isEdit: true,
// },
// {
// key: '6c749d8f7bde474da082c659146f473c',
// name: '数量',
// bindField: 'number',
// width: null,
// minWidth: null,
// maxWidth: null,
// resizable: false,
// unit: null,
// isEdit: false,
// },
// {
// key: 'cb38672445b24eedb2b10addf520de2e',
// name: '是否投料',
// bindField: 'is_feeding',
// width: null,
// minWidth: null,
// maxWidth: null,
// resizable: false,
// unit: null,
// isEdit: false,
// },
// {
// key: '607b81d8885746409998c64f0a55a56e',
// name: '备注',
// bindField: 'bz',
// width: null,
// minWidth: null,
// maxWidth: null,
// resizable: false,
// unit: null,
// isEdit: false,
// },
// {
// key: '6e053d43971d4157b0f9118f9cbbb4bb',
// name: '产品物料id',
// bindField: 'product_id',
// width: null,
// minWidth: null,
// maxWidth: null,
// resizable: false,
// unit: null,
// isEdit: false,
// },
// ],
// },
// },
// ],
// },
// ],
// componentProps: { tabPosition: 'top', size: 'default', type: 'line', isShow: true },
// },
// ],
// },
// ],
// componentProps: {
// gutter: 1,
// justify: 'start',
// align: 'top',
// isShow: true,
// showBorder: false,
// bordercolor: '#d9d9d9',
// bordershowtype: [true, true, true, true],
// borderwidth: 1,
// padding: '10px',
// margin: '10px',
// },
// },
],
showActionButtonGroup: false,
buttonLocation: 'center',
......
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