工具台账
This commit is contained in:
parent
adc575011b
commit
db071d2c2d
|
|
@ -143,3 +143,20 @@ export const updateByIdApi = (data = {}) => {
|
|||
data: data,
|
||||
})
|
||||
}
|
||||
|
||||
// 工具详情-弹框
|
||||
export const getToolByTypeIdApi = (data = {}) => {
|
||||
return request({
|
||||
url: '/material-mall/toolLedger/getToolByTypeId',
|
||||
method: 'GET',
|
||||
params: data,
|
||||
})
|
||||
}
|
||||
|
||||
export const getToolByProApi = (data = {}) => {
|
||||
return request({
|
||||
url: '/material-mall/toolLedger/getToolByPro',
|
||||
method: 'GET',
|
||||
params: data,
|
||||
})
|
||||
}
|
||||
|
|
@ -191,7 +191,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { getToolLedgerListApi, getToolSelectApi } from '@/api/toolsManage'
|
||||
import { getToolLedgerListApi, getToolSelectApi, getToolByTypeIdApi, getToolByProApi } from '@/api/toolsManage'
|
||||
import { formatTime } from '@/utils/bonus'
|
||||
|
||||
export default {
|
||||
|
|
@ -253,7 +253,7 @@ export default {
|
|||
'span',
|
||||
{
|
||||
style: { color: '#409EFF', cursor: 'pointer' },
|
||||
on: { click: () => this.handleDialog(row, '1') },
|
||||
on: { click: () => this.handleDialog(row, '3') },
|
||||
},
|
||||
row.inNum,
|
||||
)
|
||||
|
|
@ -285,7 +285,7 @@ export default {
|
|||
'span',
|
||||
{
|
||||
style: { color: '#409EFF', cursor: 'pointer' },
|
||||
on: { click: () => this.handleDialog(row, '0') },
|
||||
on: { click: () => this.handleDialog(row, '2') },
|
||||
},
|
||||
row.repairNum,
|
||||
)
|
||||
|
|
@ -315,8 +315,20 @@ export default {
|
|||
dialogColumns: [
|
||||
{ label: '工具名称', prop: 'parentTypeName' },
|
||||
{ label: '规格型号', prop: 'typeName' },
|
||||
{ label: '设备编码', prop: 'maCode' },
|
||||
{ label: '数量', prop: 'num' },
|
||||
{
|
||||
label: '设备编码',
|
||||
prop: 'toolCode',
|
||||
render: (h, { row }) => {
|
||||
return row.toolCode ? h('span', {}, row.toolCode) : h('span', {}, '-')
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '数量',
|
||||
prop: 'totalNum',
|
||||
render: (h, { row }) => {
|
||||
return row.totalNum ? h('span', {}, row.totalNum) : h('span', {}, '1')
|
||||
},
|
||||
},
|
||||
{ label: '所在工程', prop: 'proName' },
|
||||
],
|
||||
dialogList: [],
|
||||
|
|
@ -401,13 +413,12 @@ export default {
|
|||
this.getSelectList()
|
||||
},
|
||||
handleDialog(row, type) {
|
||||
console.log('🚀 ~ type:', type == 0)
|
||||
this.dialogTitle = '工具详情'
|
||||
if (type == 0) {
|
||||
this.dialogColumns = this.dialogColumns.filter(item => item.prop != 'proName')
|
||||
this.dialogTitle = '工具详情'
|
||||
if (type == 0 || type == 2) {
|
||||
this.dialogColumns = this.dialogColumns.filter((item) => item.prop != 'proName')
|
||||
console.log('🚀 ~ this.dialogColumns:', this.dialogColumns)
|
||||
} else {
|
||||
if (!this.dialogColumns.some(item => item.prop == 'proName')) {
|
||||
if (!this.dialogColumns.some((item) => item.prop == 'proName')) {
|
||||
this.dialogColumns.push({ label: '所在工程', prop: 'proName' })
|
||||
}
|
||||
}
|
||||
|
|
@ -416,8 +427,7 @@ export default {
|
|||
setTimeout(() => {
|
||||
this.$refs.dialogForm.resetFields()
|
||||
this.dialogForm.typeId = row.typeId
|
||||
this.dialogForm.startTime = this.queryParams.timeRange ? this.queryParams.timeRange[0] : ''
|
||||
this.dialogForm.endTime = this.queryParams.timeRange ? this.queryParams.timeRange[1] : ''
|
||||
this.dialogForm.type = type
|
||||
this.getDialogList()
|
||||
}, 100)
|
||||
},
|
||||
|
|
@ -438,9 +448,16 @@ export default {
|
|||
try {
|
||||
this.isLoading = true
|
||||
const params = { ...this.dialogForm }
|
||||
const res = await getInventoryLogDetailsApi(params)
|
||||
this.dialogList = res.data.rows || []
|
||||
this.dlgTotal = res.data.total || 0
|
||||
let res = null
|
||||
if (this.dialogForm.type == '0' || this.dialogForm.type == '2') {
|
||||
params.status = this.dialogForm.type
|
||||
res = await getToolByTypeIdApi(params)
|
||||
} else {
|
||||
params.status = this.dialogForm.type == '3' ? '0' : '1'
|
||||
res = await getToolByProApi(params)
|
||||
}
|
||||
this.dialogList = res.rows || []
|
||||
this.dlgTotal = res.total || 0
|
||||
} catch (error) {
|
||||
} finally {
|
||||
this.isLoading = false
|
||||
|
|
|
|||
Loading…
Reference in New Issue