inventoryDetailDialog.vue
4.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<!-- 盘点详情弹窗弹窗 -->
<template>
<GLDialog bigTitle="详细信息"
:visible.sync="inventoryDetailVisible"
class="inventoryDetailDailog"
mode="big"
@onCancel="handleClose"
@onOk="handleClose">
<div>
<div class="header"
slot="header"
style="padding: 10px 20px;">
<!-- <GLCombiForm ref="showSearch"
class="show-search"
:search-form="searchForm"
:search-select-obj="searchSelectObj"
:form-data="showFormData"></GLCombiForm> -->
</div>
<div class="d2-container-content">
<GLTable ref="recordTable"
:getListApi="getListApi"
:searchForm="searchFormSearch"
:tableParams="tableParams"
:beforeSearchFn="beforeSearchFn">
<template slot="profitAndLoss"
slot-scope="scope">
<span v-if="scope.scope.profitAndLoss || scope.scope.profitAndLoss == 0">
<span v-if="parseFloat(scope.scope.profitAndLoss) > 0"
style="color:blue">{{ '+' + parseFloat(scope.scope.profitAndLoss).toFixed(2) + (membraneTypeList.includes(scope.scope.goodsType) ? '米' : '件') }}</span>
<span v-else-if="parseFloat(scope.scope.profitAndLoss) < 0"
style="color:red">{{ parseFloat(scope.scope.profitAndLoss).toFixed(2) + (membraneTypeList.includes(scope.scope.goodsType) ? '米' : '件') }}</span>
<span
v-else>{{ parseFloat(scope.scope.profitAndLoss).toFixed(2) + (membraneTypeList.includes(scope.scope.goodsType) ? '米' : '件') }}</span>
</span>
<span v-else>-</span>
</template>
</GLTable>
</div>
</div>
</GLDialog>
</template>
<script>
import { membraneTypeList } from '@/utils/constants.js'
export default {
name: 'InventoryDetailDialog',
data() {
return {
membraneTypeList: membraneTypeList,
countObj: {},
searchForm: {
id: ''
},
searchFormSearch: {},
searchSelectObj: {},
showFormData: [],
getListApi: this.$apis.stockManage.stockCheckDetailPage,
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
// singleSelectUniqueKey: 'id',
tableOption: false,
tableColumns: [
{
label: '商品名称',
prop: 'goodsName'
// width: '200px'
},
{
label: '系列',
prop: 'sourceMaterialName'
},
{
label: '所属分类',
prop: 'goodsTypeName'
},
{
label: '系统库存',
prop: 'stock',
formatter: cellValue => {
return cellValue.stock || cellValue.stock == 0 ? parseFloat(cellValue.stock).toFixed(2) + (this.membraneTypeList.includes(cellValue.goodsType) ? '米' : '件') : '-'
}
},
{
label: '盘点库存',
prop: 'checkStock',
formatter: cellValue => {
return cellValue.checkStock || cellValue.checkStock == 0 ? parseFloat(cellValue.checkStock).toFixed(2) + (this.membraneTypeList.includes(cellValue.goodsType) ? '米' : '件') : '-'
}
},
{
label: '盘盈盘亏',
prop: 'profitAndLoss',
addHtml: 'profitAndLoss'
// formatter: (cellValue) => {
// return cellValue.checkTime ? Util.dateFormate(cellValue.checkTime, 'YYYY-MM-DD HH:mm:ss') : ''
// }
}
]
},
baseData: {}
}
},
props: {
inventoryDetailVisible: {
type: Boolean,
default: false
},
recordInfo: {
type: Object,
default: () => {}
}
},
computed: {},
mounted() {},
methods: {
beforeSearchFn() {
return new Promise(resolve => {
this.searchForm.id = this.recordInfo.id
this.searchFormSearch = this.$common.utils.deepClone(this.searchForm)
resolve()
})
},
handleClose() {
this.$emit('dialogClose')
}
}
}
</script>
<style scoped>
.count-txt {
font-weight: 700;
color: #2a58ad;
margin: 0 2px;
}
.inventoryDetailDailog .el-dialog {
margin-top: 20vh !important;
min-width: 700px;
}
</style>