Browse Source

actualNotifyDate

master
han\hanst 3 days ago
parent
commit
9d1e141167
  1. 142
      src/views/modules/ecss/codelnotify.vue
  2. 159
      src/views/modules/ecss/codelnotifyConfirm.vue

142
src/views/modules/ecss/codelnotify.vue

@ -117,7 +117,13 @@
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span>
<el-tooltip
v-if="!item.columnHidden && showDelayWarningTooltip(scope.row, item.columnProp)"
:content="getDelayWarningTooltip(scope.row)"
placement="top">
<span>{{scope.row[item.columnProp]}}</span>
</el-tooltip>
<span v-else-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
style="width: 100px; height: 80px"/></span>
</template>
@ -307,11 +313,10 @@
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="'发货日期'" >
<el-form-item :label="'预计发货日期'" >
<el-date-picker
style="width: 145px"
v-model="updateHeaderModel.notifyDate"
disabled
type="date"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
@ -1198,7 +1203,25 @@
columnProp: "notifyDate",
headerAlign: "center",
align: "center",
columnLabel: "发货日期",
columnLabel: "预计发货日期",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 801001,
serialNumber: '801001Table1ActualNotifyDate',
tableId: "801001Table1",
tableName: "关务系统发货通知单",
columnProp: "actualNotifyDate",
headerAlign: "center",
align: "center",
columnLabel: "实际发货日期",
columnHidden: false,
columnImage: false,
columnSortable: false,
@ -1988,6 +2011,110 @@
})
},
methods: {
ensureActualNotifyDateColumn(columns) {
const sourceColumns = Array.isArray(columns) ? columns : [];
const hasActualNotifyDate = sourceColumns.some(item => item.columnProp === 'actualNotifyDate');
if (hasActualNotifyDate) {
return sourceColumns;
}
const referenceColumn = sourceColumns.find(item => item && item.tableId) || {};
const actualNotifyDateColumn = {
userId: this.$store.state.user.name,
functionId: this.$route.meta.menuId,
serialNumber: this.$route.meta.menuId + 'Table1ActualNotifyDate',
tableId: referenceColumn.tableId || (this.$route.meta.menuId + 'Table1'),
tableName: "关务系统发货通知单",
columnProp: "actualNotifyDate",
headerAlign: "center",
align: "center",
columnLabel: "实际发货日期",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
};
const targetColumns = sourceColumns.slice();
const notifyDateIndex = targetColumns.findIndex(item => item.columnProp === 'notifyDate');
if (notifyDateIndex > -1) {
targetColumns.splice(notifyDateIndex + 1, 0, actualNotifyDateColumn);
} else {
targetColumns.push(actualNotifyDateColumn);
}
return targetColumns;
},
parseDateValue(dateValue) {
if (!dateValue) {
return null;
}
if (dateValue instanceof Date) {
if (isNaN(dateValue.getTime())) {
return null;
}
const date = new Date(dateValue.getTime());
date.setHours(0, 0, 0, 0);
return date;
}
if (typeof dateValue === 'string') {
const value = dateValue.trim();
if (!value) {
return null;
}
const datePart = value.split(' ')[0];
const parts = datePart.split('-');
if (parts.length === 3) {
const year = Number(parts[0]);
const month = Number(parts[1]);
const day = Number(parts[2]);
if (!Number.isNaN(year) && !Number.isNaN(month) && !Number.isNaN(day)) {
const date = new Date(year, month - 1, day);
date.setHours(0, 0, 0, 0);
return date;
}
}
const date = new Date(value);
if (!isNaN(date.getTime())) {
date.setHours(0, 0, 0, 0);
return date;
}
}
return null;
},
isActualNotifyDateEmpty(actualNotifyDate) {
return actualNotifyDate === null || actualNotifyDate === undefined || actualNotifyDate === '';
},
isDelayWarningRow(row) {
if (!row || !this.isActualNotifyDateEmpty(row.actualNotifyDate)) {
return false;
}
const notifyDate = this.parseDateValue(row.notifyDate);
if (!notifyDate) {
return false;
}
const deadline = new Date(notifyDate.getTime());
deadline.setDate(deadline.getDate() + 3);
const today = new Date();
today.setHours(0, 0, 0, 0);
return today.getTime() > deadline.getTime();
},
showDelayWarningTooltip(row, columnProp) {
return this.isDelayWarningRow(row) && (columnProp === 'cmcInvoice' || columnProp === 'notifyDate');
},
getDelayWarningTooltip(row) {
const notifyDate = row && row.notifyDate ? row.notifyDate : '预计发货日期';
return `预计发货日期${notifyDate}已超3天,且实际发货日期未维护,请及时补充。`;
},
isPnDataIncomplete(row) {
const hsCodeDesc = row.hsCodeDesc !== null && row.hsCodeDesc !== undefined && row.hsCodeDesc !== ''&& row.hsCodeDesc !== '*';
return !hsCodeDesc;
@ -2099,7 +2226,7 @@
//this.columnList1 = []
switch (columnId) {
case 1:
this.columnList1 = data.rows
this.columnList1 = this.ensureActualNotifyDateColumn(data.rows)
break;
// case 2:
// this.columnDetailList = data.rows
@ -2127,7 +2254,7 @@
if (!data.rows.length == 0) {
switch (columnId) {
case 1:
this.columnList1 = data.rows
this.columnList1 = this.ensureActualNotifyDateColumn(data.rows)
break;
// case 2:
// this.columnDetailList = data.rows
@ -2489,6 +2616,9 @@
}
},
cellStyle({row, column }) {
if (this.isDelayWarningRow(row) && (column.property === 'notifyDate' || column.property === 'cmcInvoice')) {
return { color: '#fa0303', fontWeight: '700' };
}
// modifyFlagtrue
if (column.property === 'modifyLabel' && row.modifyFlag===true) {
return { color: '#ff5d03' };

159
src/views/modules/ecss/codelnotifyConfirm.vue

@ -104,7 +104,13 @@
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span>
<el-tooltip
v-if="!item.columnHidden && showDelayWarningTooltip(scope.row, item.columnProp)"
:content="getDelayWarningTooltip(scope.row)"
placement="top">
<span>{{scope.row[item.columnProp]}}</span>
</el-tooltip>
<span v-else-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
style="width: 100px; height: 80px"/></span>
</template>
@ -243,10 +249,10 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="'预计发货日期'" >
<el-form-item :label="'实际发货日期'" >
<el-date-picker
style="width: 100%"
v-model="confirmModel.notifyDate"
v-model="confirmModel.actualNotifyDate"
type="date"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
@ -278,10 +284,10 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="'预计发货日期'" >
<el-form-item :label="'实际发货日期'" >
<el-date-picker
style="width: 100%"
v-model="confirmModel.notifyDate"
v-model="confirmModel.actualNotifyDate"
type="date"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
@ -970,6 +976,7 @@
shippingMode:'',
destination:'',
notifyDate:'',
actualNotifyDate:'',
remark:'',
},
@ -1164,7 +1171,25 @@
columnProp: "notifyDate",
headerAlign: "center",
align: "center",
columnLabel: "发货日期",
columnLabel: "预计发货日期",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 801002,
serialNumber: '801002Table1ActualNotifyDate',
tableId: "801002Table1",
tableName: "关务系统发货通知单",
columnProp: "actualNotifyDate",
headerAlign: "center",
align: "center",
columnLabel: "实际发货日期",
columnHidden: false,
columnImage: false,
columnSortable: false,
@ -2193,6 +2218,111 @@
},
methods: {
ensureActualNotifyDateColumn(columns) {
const sourceColumns = Array.isArray(columns) ? columns : [];
const hasActualNotifyDate = sourceColumns.some(item => item.columnProp === 'actualNotifyDate');
if (hasActualNotifyDate) {
return sourceColumns;
}
const referenceColumn = sourceColumns.find(item => item && item.tableId) || {};
const actualNotifyDateColumn = {
userId: this.$store.state.user.name,
functionId: this.$route.meta.menuId,
serialNumber: this.$route.meta.menuId + 'Table1ActualNotifyDate',
tableId: referenceColumn.tableId || (this.$route.meta.menuId + 'Table1'),
tableName: "关务系统发货通知单",
columnProp: "actualNotifyDate",
headerAlign: "center",
align: "center",
columnLabel: "实际发货日期",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
};
const targetColumns = sourceColumns.slice();
const notifyDateIndex = targetColumns.findIndex(item => item.columnProp === 'notifyDate');
if (notifyDateIndex > -1) {
targetColumns.splice(notifyDateIndex + 1, 0, actualNotifyDateColumn);
} else {
targetColumns.push(actualNotifyDateColumn);
}
return targetColumns;
},
parseDateValue(dateValue) {
if (!dateValue) {
return null;
}
if (dateValue instanceof Date) {
if (isNaN(dateValue.getTime())) {
return null;
}
const date = new Date(dateValue.getTime());
date.setHours(0, 0, 0, 0);
return date;
}
if (typeof dateValue === 'string') {
const value = dateValue.trim();
if (!value) {
return null;
}
const datePart = value.split(' ')[0];
const parts = datePart.split('-');
if (parts.length === 3) {
const year = Number(parts[0]);
const month = Number(parts[1]);
const day = Number(parts[2]);
if (!Number.isNaN(year) && !Number.isNaN(month) && !Number.isNaN(day)) {
const date = new Date(year, month - 1, day);
date.setHours(0, 0, 0, 0);
return date;
}
}
const date = new Date(value);
if (!isNaN(date.getTime())) {
date.setHours(0, 0, 0, 0);
return date;
}
}
return null;
},
isActualNotifyDateEmpty(actualNotifyDate) {
return actualNotifyDate === null || actualNotifyDate === undefined || actualNotifyDate === '';
},
isDelayWarningRow(row) {
if (!row || !this.isActualNotifyDateEmpty(row.actualNotifyDate)) {
return false;
}
const notifyDate = this.parseDateValue(row.notifyDate);
if (!notifyDate) {
return false;
}
const deadline = new Date(notifyDate.getTime());
deadline.setDate(deadline.getDate() + 3);
const today = new Date();
today.setHours(0, 0, 0, 0);
return today.getTime() > deadline.getTime();
},
showDelayWarningTooltip(row, columnProp) {
return this.isDelayWarningRow(row) && (columnProp === 'cmcInvoice' || columnProp === 'notifyDate');
},
getDelayWarningTooltip(row) {
const notifyDate = row && row.notifyDate ? row.notifyDate : '预计发货日期';
return `预计发货日期${notifyDate}已超3天,且实际发货日期未维护,请及时补充。`;
},
//
async getTableUserColumn (tableId, columnId) {
let queryTableUser = {
@ -2207,7 +2337,7 @@
//this.columnList1 = []
switch (columnId) {
case 1:
this.columnList1 = data.rows
this.columnList1 = this.ensureActualNotifyDateColumn(data.rows)
break;
// case 2:
// this.columnDetailList = data.rows
@ -2235,7 +2365,7 @@
if (!data.rows.length == 0) {
switch (columnId) {
case 1:
this.columnList1 = data.rows
this.columnList1 = this.ensureActualNotifyDateColumn(data.rows)
break;
// case 2:
// this.columnDetailList = data.rows
@ -2363,7 +2493,7 @@
if(this.dataList.length>0){
this.dataList.forEach(o => {
if (o.notifyStatus==='仓库已确认'&&!o.notifyDate) {
o.notifyDate='发货日期不确定'
o.notifyDate='预计发货日期不确定'
}
// 12
o.modifyLabel = !!o.modifyFlag ? (o.modifyCount ? '改单(' + o.modifyCount + ')' : '改单(1)') : '';
@ -2409,7 +2539,10 @@
}
},
cellStyle({row, column }) {
if (column.property === 'notifyDate' && row.notifyDate==='发货日期不确定') { //
if (this.isDelayWarningRow(row) && (column.property === 'notifyDate' || column.property === 'cmcInvoice')) {
return { color: '#fa0303', fontWeight: '700' };
}
if (column.property === 'notifyDate' && row.notifyDate==='预计发货日期不确定') { //
return { color: '#ff5d03' };
}
// modifyFlagtrue
@ -2444,7 +2577,7 @@
},
changeData(row){
this.currentRow = JSON.parse(JSON.stringify(row));
if (this.currentRow&&this.currentRow.notifyDate==='发货日期不确定') {
if (this.currentRow&&this.currentRow.notifyDate==='预计发货日期不确定') {
this.currentRow.notifyDate=''
}
this.headerData=row;
@ -2520,7 +2653,7 @@
},
cancerConfirm(row){
let indata=JSON.parse(JSON.stringify(row));
if (row.notifyDate==='发货日期不确定') {
if (row.notifyDate==='预计发货日期不确定') {
indata.notifyDate=''
}
this.$confirm('取消确认这条发货通知单?', '提示').then(() => {
@ -2566,7 +2699,7 @@
},
updateModelOpen(row){
this.confirmModel=JSON.parse(JSON.stringify(row));
if (this.confirmModel.notifyDate==='发货日期不确定') {
if (this.confirmModel.notifyDate==='预计发货日期不确定') {
this.confirmModel.notifyDate=''
}
this.updateModelFlag=true

Loading…
Cancel
Save