|
|
|
@ -63,7 +63,7 @@ |
|
|
|
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span> |
|
|
|
</div> |
|
|
|
<div v-else> |
|
|
|
<span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span> |
|
|
|
<span v-if="!item.columnHidden"> {{ item.columnProp === 'drawingNo' ? formatDrawingNoForDisplay(scope.row[item.columnProp]) : scope.row[item.columnProp] }}</span> |
|
|
|
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
@ -108,7 +108,12 @@ |
|
|
|
<el-input v-model="modalData.partDesc" clearable style="width: 300px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item v-if="modalData.flag === '2' && modalData.status === 'Y'" label="编码"> |
|
|
|
<el-input v-model="modalData.drawingNo" style="width: 150px" placeholder="可手填或获取编码"></el-input> |
|
|
|
<el-input |
|
|
|
:value="formatDrawingNoForDisplay(modalData.drawingNo)" |
|
|
|
style="width: 150px" |
|
|
|
placeholder="可手填或获取编码" |
|
|
|
@input="handleModalDrawingNoInput"> |
|
|
|
</el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item v-if="modalData.flag === '2' && modalData.status === 'Y'" :label="' '"> |
|
|
|
<el-button type="primary" :loading="drawingNoSaving" @click="openDrawingNoDialog">获取编码</el-button> |
|
|
|
@ -1923,6 +1928,39 @@ import CodeGeneration from "../../code/generation.vue"; |
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
formatDrawingNoForDisplay (drawingNo) { |
|
|
|
if (drawingNo === null || drawingNo === undefined) { |
|
|
|
return '' |
|
|
|
} |
|
|
|
const drawingNoText = String(drawingNo) |
|
|
|
if (/^[FR]/i.test(drawingNoText)) { |
|
|
|
return drawingNoText.substring(1) |
|
|
|
} |
|
|
|
return drawingNoText |
|
|
|
}, |
|
|
|
|
|
|
|
normalizeDrawingNoDisplayInput (displayValue, currentDrawingNo) { |
|
|
|
if (displayValue === null || displayValue === undefined) { |
|
|
|
return '' |
|
|
|
} |
|
|
|
const drawingNoDisplayText = String(displayValue) |
|
|
|
if (drawingNoDisplayText === '') { |
|
|
|
return '' |
|
|
|
} |
|
|
|
const currentDrawingNoText = currentDrawingNo === null || currentDrawingNo === undefined |
|
|
|
? '' |
|
|
|
: String(currentDrawingNo) |
|
|
|
const currentPrefix = currentDrawingNoText.charAt(0) |
|
|
|
if (/^[FR]$/i.test(currentPrefix) && !/^[FR]/i.test(drawingNoDisplayText)) { |
|
|
|
return currentPrefix + drawingNoDisplayText |
|
|
|
} |
|
|
|
return drawingNoDisplayText |
|
|
|
}, |
|
|
|
|
|
|
|
handleModalDrawingNoInput (value) { |
|
|
|
this.modalData.drawingNo = this.normalizeDrawingNoDisplayInput(value, this.modalData.drawingNo) |
|
|
|
}, |
|
|
|
|
|
|
|
// 重置标识 |
|
|
|
resetFlags () { |
|
|
|
this.mainInfoFlag = false |
|
|
|
@ -3062,7 +3100,10 @@ import CodeGeneration from "../../code/generation.vue"; |
|
|
|
|
|
|
|
//导出excel |
|
|
|
createExportData() { |
|
|
|
return this.dataList |
|
|
|
return (this.dataList || []).map(item => ({ |
|
|
|
...item, |
|
|
|
drawingNo: this.formatDrawingNoForDisplay(item.drawingNo) |
|
|
|
})) |
|
|
|
}, |
|
|
|
|
|
|
|
startDownload() { |
|
|
|
|