Browse Source

2026-06-04

RoHs优化
master
fengyuan_yang 1 week ago
parent
commit
474b569362
  1. 42
      src/views/modules/rohs/rohsRecord.vue

42
src/views/modules/rohs/rohsRecord.vue

@ -54,7 +54,11 @@
<el-table-column prop="pm" header-align="center" align="center" label="PM编码" width="130"></el-table-column>
<el-table-column prop="pmName" header-align="center" align="center" label="PM名称" width="150"></el-table-column>
<el-table-column prop="applicationDate" header-align="center" align="center" label="申请日期" width="165"></el-table-column>
<el-table-column prop="plannedMassProductionDate" header-align="center" align="center" label="计划转量产时间" width="210"></el-table-column>
<el-table-column header-align="center" align="center" label="计划转量产时间" width="165">
<template slot-scope="scope">
<span>{{ normalizeDateOnly(scope.row.plannedMassProductionDate) }}</span>
</template>
</el-table-column>
<el-table-column prop="process" header-align="center" align="center" label="工艺" width="120"></el-table-column>
<el-table-column prop="color" header-align="center" align="center" label="颜色" width="120"></el-table-column>
<el-table-column prop="vendorCode" header-align="center" align="center" label="供应商代码" width="160"></el-table-column>
@ -189,7 +193,7 @@
<el-input v-model="modalData.color" :disabled="isRohsFieldDisabled('color')" style="width: 150px"></el-input>
</el-form-item>
<el-form-item label="计划转量产时间/Planned Mass Production">
<el-date-picker v-model="modalData.plannedMassProductionDate" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" :disabled="isRohsFieldDisabled('plannedMassProductionDate')" style="width: 230px" :editable=false></el-date-picker>
<el-date-picker v-model="modalData.plannedMassProductionDate" type="date" value-format="yyyy-MM-dd" :disabled="isRohsFieldDisabled('plannedMassProductionDate')" style="width: 190px" :editable=false></el-date-picker>
</el-form-item>
</el-form>
@ -705,7 +709,7 @@
<el-input :value="currentRow.color || ''" disabled style="width: 150px"></el-input>
</el-form-item>
<el-form-item label="计划转量产时间/Planned Mass Production">
<el-date-picker :value="currentRow.plannedMassProductionDate" disabled type="datetime" value-format="yyyy-MM-dd HH:mm:ss" style="width: 230px"></el-date-picker>
<el-date-picker :value="normalizeDateOnly(currentRow.plannedMassProductionDate)" disabled type="date" value-format="yyyy-MM-dd" style="width: 190px"></el-date-picker>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" :model="currentRow">
@ -1307,6 +1311,28 @@ export default {
canEditRohsMaterial () {
return !this.showModalFlag
},
normalizeDateOnly (value) {
if (value === null || value === undefined || value === '') {
return ''
}
if (value instanceof Date && !Number.isNaN(value.getTime())) {
const year = value.getFullYear()
const month = String(value.getMonth() + 1).padStart(2, '0')
const day = String(value.getDate()).padStart(2, '0')
return year + '-' + month + '-' + day
}
const text = String(value).trim()
if (!text) {
return ''
}
if (text.includes('T')) {
return text.split('T')[0]
}
return text.length >= 10 ? text.substring(0, 10) : text
},
getCurrentDateString () {
return this.normalizeDateOnly(new Date())
},
normalizeValidUntilValue (value) {
if (value === null || value === undefined || value === '') {
return null
@ -1819,6 +1845,10 @@ export default {
? target.validUntilValue
: fallbackData.validUntilValue
this.$set(target, 'validUntilValue', this.normalizeValidUntilValue(validUntilValue))
const applicationDate = target.applicationDate || fallbackData.applicationDate || ''
const plannedMassProductionDate = target.plannedMassProductionDate || fallbackData.plannedMassProductionDate || ''
this.$set(target, 'applicationDate', this.normalizeDateOnly(applicationDate))
this.$set(target, 'plannedMassProductionDate', this.normalizeDateOnly(plannedMassProductionDate))
},
refreshCurrentTabTable () {
if (this.activeTable === 'approvalInformation') {
@ -2021,11 +2051,11 @@ export default {
this.modalData = {
site: this.$store.state.user.site,
referenceNo: tempReferenceNo,
applicant: '',
applicantName: '',
applicant: this.$store.state.user.name || '',
applicantName: this.$store.state.user.userDisplay || this.$store.state.user.user_display || '',
pm: '',
pmName: '',
applicationDate: '',
applicationDate: this.getCurrentDateString(),
process: '',
plannedMassProductionDate: '',
color: '',

Loading…
Cancel
Save