|
|
@ -104,7 +104,13 @@ |
|
|
:min-width="item.columnWidth" |
|
|
:min-width="item.columnWidth" |
|
|
:label="item.columnLabel"> |
|
|
:label="item.columnLabel"> |
|
|
<template slot-scope="scope"> |
|
|
<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]" |
|
|
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" |
|
|
style="width: 100px; height: 80px"/></span> |
|
|
style="width: 100px; height: 80px"/></span> |
|
|
</template> |
|
|
</template> |
|
|
@ -243,10 +249,10 @@ |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="12"> |
|
|
<el-col :span="12"> |
|
|
<el-form-item :label="'预计发货日期'" > |
|
|
|
|
|
|
|
|
<el-form-item :label="'实际发货日期'" > |
|
|
<el-date-picker |
|
|
<el-date-picker |
|
|
style="width: 100%" |
|
|
style="width: 100%" |
|
|
v-model="confirmModel.notifyDate" |
|
|
|
|
|
|
|
|
v-model="confirmModel.actualNotifyDate" |
|
|
type="date" |
|
|
type="date" |
|
|
format="yyyy-MM-dd" |
|
|
format="yyyy-MM-dd" |
|
|
value-format="yyyy-MM-dd" |
|
|
value-format="yyyy-MM-dd" |
|
|
@ -278,10 +284,10 @@ |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="12"> |
|
|
<el-col :span="12"> |
|
|
<el-form-item :label="'预计发货日期'" > |
|
|
|
|
|
|
|
|
<el-form-item :label="'实际发货日期'" > |
|
|
<el-date-picker |
|
|
<el-date-picker |
|
|
style="width: 100%" |
|
|
style="width: 100%" |
|
|
v-model="confirmModel.notifyDate" |
|
|
|
|
|
|
|
|
v-model="confirmModel.actualNotifyDate" |
|
|
type="date" |
|
|
type="date" |
|
|
format="yyyy-MM-dd" |
|
|
format="yyyy-MM-dd" |
|
|
value-format="yyyy-MM-dd" |
|
|
value-format="yyyy-MM-dd" |
|
|
@ -970,6 +976,7 @@ |
|
|
shippingMode:'', |
|
|
shippingMode:'', |
|
|
destination:'', |
|
|
destination:'', |
|
|
notifyDate:'', |
|
|
notifyDate:'', |
|
|
|
|
|
actualNotifyDate:'', |
|
|
remark:'', |
|
|
remark:'', |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
@ -1164,7 +1171,25 @@ |
|
|
columnProp: "notifyDate", |
|
|
columnProp: "notifyDate", |
|
|
headerAlign: "center", |
|
|
headerAlign: "center", |
|
|
align: "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, |
|
|
columnHidden: false, |
|
|
columnImage: false, |
|
|
columnImage: false, |
|
|
columnSortable: false, |
|
|
columnSortable: false, |
|
|
@ -2193,6 +2218,111 @@ |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
methods: { |
|
|
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) { |
|
|
async getTableUserColumn (tableId, columnId) { |
|
|
let queryTableUser = { |
|
|
let queryTableUser = { |
|
|
@ -2207,7 +2337,7 @@ |
|
|
//this.columnList1 = [] |
|
|
//this.columnList1 = [] |
|
|
switch (columnId) { |
|
|
switch (columnId) { |
|
|
case 1: |
|
|
case 1: |
|
|
this.columnList1 = data.rows |
|
|
|
|
|
|
|
|
this.columnList1 = this.ensureActualNotifyDateColumn(data.rows) |
|
|
break; |
|
|
break; |
|
|
// case 2: |
|
|
// case 2: |
|
|
// this.columnDetailList = data.rows |
|
|
// this.columnDetailList = data.rows |
|
|
@ -2235,7 +2365,7 @@ |
|
|
if (!data.rows.length == 0) { |
|
|
if (!data.rows.length == 0) { |
|
|
switch (columnId) { |
|
|
switch (columnId) { |
|
|
case 1: |
|
|
case 1: |
|
|
this.columnList1 = data.rows |
|
|
|
|
|
|
|
|
this.columnList1 = this.ensureActualNotifyDateColumn(data.rows) |
|
|
break; |
|
|
break; |
|
|
// case 2: |
|
|
// case 2: |
|
|
// this.columnDetailList = data.rows |
|
|
// this.columnDetailList = data.rows |
|
|
@ -2363,7 +2493,7 @@ |
|
|
if(this.dataList.length>0){ |
|
|
if(this.dataList.length>0){ |
|
|
this.dataList.forEach(o => { |
|
|
this.dataList.forEach(o => { |
|
|
if (o.notifyStatus==='仓库已确认'&&!o.notifyDate) { |
|
|
if (o.notifyStatus==='仓库已确认'&&!o.notifyDate) { |
|
|
o.notifyDate='发货日期不确定' |
|
|
|
|
|
|
|
|
o.notifyDate='预计发货日期不确定' |
|
|
} |
|
|
} |
|
|
// 显示改单次数,如:改单(1)、改单(2) |
|
|
// 显示改单次数,如:改单(1)、改单(2) |
|
|
o.modifyLabel = !!o.modifyFlag ? (o.modifyCount ? '改单(' + o.modifyCount + ')' : '改单(1)') : ''; |
|
|
o.modifyLabel = !!o.modifyFlag ? (o.modifyCount ? '改单(' + o.modifyCount + ')' : '改单(1)') : ''; |
|
|
@ -2409,7 +2539,10 @@ |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
cellStyle({row, column }) { |
|
|
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' }; |
|
|
return { color: '#ff5d03' }; |
|
|
} |
|
|
} |
|
|
// 改单列显示橙色:只要modifyFlag为true就显示橙色 |
|
|
// 改单列显示橙色:只要modifyFlag为true就显示橙色 |
|
|
@ -2444,7 +2577,7 @@ |
|
|
}, |
|
|
}, |
|
|
changeData(row){ |
|
|
changeData(row){ |
|
|
this.currentRow = JSON.parse(JSON.stringify(row)); |
|
|
this.currentRow = JSON.parse(JSON.stringify(row)); |
|
|
if (this.currentRow&&this.currentRow.notifyDate==='发货日期不确定') { |
|
|
|
|
|
|
|
|
if (this.currentRow&&this.currentRow.notifyDate==='预计发货日期不确定') { |
|
|
this.currentRow.notifyDate='' |
|
|
this.currentRow.notifyDate='' |
|
|
} |
|
|
} |
|
|
this.headerData=row; |
|
|
this.headerData=row; |
|
|
@ -2520,7 +2653,7 @@ |
|
|
}, |
|
|
}, |
|
|
cancerConfirm(row){ |
|
|
cancerConfirm(row){ |
|
|
let indata=JSON.parse(JSON.stringify(row)); |
|
|
let indata=JSON.parse(JSON.stringify(row)); |
|
|
if (row.notifyDate==='发货日期不确定') { |
|
|
|
|
|
|
|
|
if (row.notifyDate==='预计发货日期不确定') { |
|
|
indata.notifyDate='' |
|
|
indata.notifyDate='' |
|
|
} |
|
|
} |
|
|
this.$confirm('取消确认这条发货通知单?', '提示').then(() => { |
|
|
this.$confirm('取消确认这条发货通知单?', '提示').then(() => { |
|
|
@ -2566,7 +2699,7 @@ |
|
|
}, |
|
|
}, |
|
|
updateModelOpen(row){ |
|
|
updateModelOpen(row){ |
|
|
this.confirmModel=JSON.parse(JSON.stringify(row)); |
|
|
this.confirmModel=JSON.parse(JSON.stringify(row)); |
|
|
if (this.confirmModel.notifyDate==='发货日期不确定') { |
|
|
|
|
|
|
|
|
if (this.confirmModel.notifyDate==='预计发货日期不确定') { |
|
|
this.confirmModel.notifyDate='' |
|
|
this.confirmModel.notifyDate='' |
|
|
} |
|
|
} |
|
|
this.updateModelFlag=true |
|
|
this.updateModelFlag=true |
|
|
|