Browse Source

2025-12-04

刀具申请记录中显示工具明细首条数据的工具编码和工具名称
master
fengyuan_yang 1 month ago
parent
commit
924e6e39ef
  1. 64
      src/views/modules/tooling/searchToolApply.vue

64
src/views/modules/tooling/searchToolApply.vue

@ -1374,6 +1374,42 @@ export default {
fixed: '', fixed: '',
columnWidth: 120 columnWidth: 120
}, },
{
userId: this.$store.state.user.name,
functionId: 106002,
serialNumber: '106002Table1FirstToolId',
tableId: "106002Table1",
tableName: "刀具申请主表",
columnProp: "firstToolId",
headerAlign: "center",
align: "left",
columnLabel: "工具编码",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 106002,
serialNumber: '106002Table1FirstToolDesc',
tableId: "106002Table1",
tableName: "刀具申请主表",
columnProp: "firstToolDesc",
headerAlign: "center",
align: "left",
columnLabel: "工具描述",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 150
},
{ {
userId: this.$store.state.user.name, userId: this.$store.state.user.name,
functionId: 106002, functionId: 106002,
@ -2314,6 +2350,8 @@ export default {
this.dataForm.sp = '' this.dataForm.sp = ''
} }
this.operatorFlag = this.superAdmin || (this.dataForm.sp!=='' && this.dataForm.sp.split(';').includes(this.sp)) this.operatorFlag = this.superAdmin || (this.dataForm.sp!=='' && this.dataForm.sp.split(';').includes(this.sp))
//
this.loadToolDetailInfo()
if (this.dataList1.length > 0) { if (this.dataList1.length > 0) {
this.$refs.mainTable.setCurrentRow(this.dataList1[0]); this.$refs.mainTable.setCurrentRow(this.dataList1[0]);
this.currentRow = JSON.parse(JSON.stringify(this.dataList1[0])); this.currentRow = JSON.parse(JSON.stringify(this.dataList1[0]));
@ -2326,6 +2364,30 @@ export default {
}) })
this.isFilterSearch = false this.isFilterSearch = false
}, },
//
loadToolDetailInfo() {
this.dataList1.forEach(item => {
searchProjectToolApplyDetail({
site: item.site,
applyNo: item.applyNo
}).then(({data}) => {
if (data && data.code === 0 && data.rows && data.rows.length > 0) {
const firstDetail = data.rows[0]
// 使$set
this.$set(item, 'firstToolId', firstDetail.toolId)
this.$set(item, 'firstToolDesc', firstDetail.toolDesc)
} else {
//
this.$set(item, 'firstToolId', '')
this.$set(item, 'firstToolDesc', '')
}
}).catch(() => {
//
this.$set(item, 'firstToolId', '')
this.$set(item, 'firstToolDesc', '')
})
})
},
// //
changeData(row) { changeData(row) {
this.dataForm.status = row.status this.dataForm.status = row.status
@ -2945,6 +3007,8 @@ export default {
if (data && data.code === 0){ if (data && data.code === 0){
this.dataList1 = data.page.list this.dataList1 = data.page.list
this.totalPage = data.page.totalCount this.totalPage = data.page.totalCount
//
this.loadToolDetailInfo()
}else { }else {
this.$message.warning(data.msg) this.$message.warning(data.msg)
} }

Loading…
Cancel
Save