|
|
@@ -12,10 +12,12 @@
|
|
12
|
12
|
<text class="asset-value">{{ wareHouseCard.totalCost }}</text>
|
|
13
|
13
|
</view>
|
|
14
|
14
|
<view class="btn-group">
|
|
15
|
|
- <u-button type="primary" shape="circle" plain size="mini" @click="navigateToFieldPermissions">字段权限</u-button>
|
|
|
15
|
+ <u-button v-if="isAdmin" type="primary" shape="circle" plain size="mini"
|
|
|
16
|
+ @click="navigateToFieldPermissions">字段权限</u-button>
|
|
16
|
17
|
<u-button type="success" shape="circle" plain size="mini" @click="openOrderList">开单记录</u-button>
|
|
17
|
18
|
<order-list ref="orderListRef"></order-list>
|
|
18
|
|
- <u-button type="primary" shape="circle" plain size="mini" @click="navigateToFakeRegistration">假货登记</u-button>
|
|
|
19
|
+ <u-button type="primary" shape="circle" plain size="mini"
|
|
|
20
|
+ @click="navigateToFakeRegistration">假货登记</u-button>
|
|
19
|
21
|
</view>
|
|
20
|
22
|
</view>
|
|
21
|
23
|
<view class="data-cards">
|
|
|
@@ -39,8 +41,9 @@
|
|
39
|
41
|
</view>
|
|
40
|
42
|
|
|
41
|
43
|
<view class="category-tabs-wrap">
|
|
42
|
|
- <u-tabs :list="tabList" :is-scroll="true" active-color="#007aff" inactive-color="#666666" font-size="28rpx"
|
|
43
|
|
- keyName="dictLabel" border-bottom="none" @change="switchTab" class="u-tabs-custom"></u-tabs>
|
|
|
44
|
+ <u-tabs :list="tabList" :is-scroll="true" active-color="#007aff" inactive-color="#666666"
|
|
|
45
|
+ font-size="28rpx" keyName="dictLabel" border-bottom="none" @change="switchTab"
|
|
|
46
|
+ class="u-tabs-custom"></u-tabs>
|
|
44
|
47
|
</view>
|
|
45
|
48
|
|
|
46
|
49
|
<view class="filter-bar">
|
|
|
@@ -52,7 +55,8 @@
|
|
52
|
55
|
</view>
|
|
53
|
56
|
<view class="price-layout-btn">
|
|
54
|
57
|
<view class="price-btn" type="text" @click="priceVisibleChange">
|
|
55
|
|
- <u-icon :name="priceVisible ? 'eye' : 'eye-off'" size="18" color="#1890ff" class="price-icon"></u-icon>
|
|
|
58
|
+ <u-icon :name="priceVisible ? 'eye' : 'eye-off'" size="18" color="#1890ff"
|
|
|
59
|
+ class="price-icon"></u-icon>
|
|
56
|
60
|
<text class="price-text">价格可见</text>
|
|
57
|
61
|
</view>
|
|
58
|
62
|
<view class="dept-btn" @click="recycleDeptClick">
|
|
|
@@ -61,9 +65,9 @@
|
|
61
|
65
|
</view>
|
|
62
|
66
|
<image src="/static/icons/dept.png" mode="aspectFill"></image>
|
|
63
|
67
|
</view>
|
|
64
|
|
- <ba-tree-picker :selectParent="true" ref="recycleDeptRef" :multiple='false' @select-change="deptSeletchang"
|
|
65
|
|
- border title="机构部门" :localdata="deptList" valueKey="deptId" textKey="deptName" childrenKey="children"
|
|
66
|
|
- :selectedValues="deptId" :personNames="deptName" />
|
|
|
68
|
+ <ba-tree-picker :selectParent="true" ref="recycleDeptRef" :multiple='false'
|
|
|
69
|
+ @select-change="deptSeletchang" border title="机构部门" :localdata="deptList" valueKey="deptId"
|
|
|
70
|
+ textKey="deptName" childrenKey="children" :selectedValues="deptId" :personNames="deptName" />
|
|
67
|
71
|
<view class="layout-btn" type="text" size="mini" @click="openSearchFilter">
|
|
68
|
72
|
<image class="filter-icon" src="/static/icons/select.png" mode="aspectFill"></image>
|
|
69
|
73
|
筛选
|
|
|
@@ -73,24 +77,28 @@
|
|
73
|
77
|
<searchFilter ref="searchFilter" @confirm="handleSearch"></searchFilter>
|
|
74
|
78
|
</view>
|
|
75
|
79
|
</view>
|
|
76
|
|
- <u-notice-bar class="custom-notice-bar" icon="" :text="selectText" mode="closable" speed="40"></u-notice-bar>
|
|
77
|
|
- <scroll-view ref="scrollView" class="goods-list" scroll-y @scrolltolower="handleLoadMore" @scroll="handleScroll"
|
|
78
|
|
- enable-back-to-top>
|
|
|
80
|
+ <u-notice-bar class="custom-notice-bar" icon="" :text="selectText" mode="closable"
|
|
|
81
|
+ speed="40"></u-notice-bar>
|
|
|
82
|
+ <scroll-view ref="scrollView" class="goods-list" scroll-y @scrolltolower="handleLoadMore"
|
|
|
83
|
+ @scroll="handleScroll" enable-back-to-top>
|
|
79
|
84
|
<view @click.stop="clickItem(goods)" class="goods-item" v-for="(goods, goodsIndex) in goodsList"
|
|
80
|
85
|
:key="`goods-${goodsIndex}`">
|
|
81
|
86
|
<u-swipe-action ref="swipeRef">
|
|
82
|
|
- <u-swipe-action-item :options="swipeOptions" @click="(e) => handleSwipeClick(e, goods, goodsIndex)">
|
|
|
87
|
+ <u-swipe-action-item :options="swipeOptions"
|
|
|
88
|
+ @click="(e) => handleSwipeClick(e, goods, goodsIndex)">
|
|
83
|
89
|
<view class="goods-info">
|
|
84
|
|
- <view class="goods-img-container" v-if="getWarehouseFieldPermissions('goodPicFileList','read')">
|
|
85
|
|
- <image class="goods-img" :src="goods.imgUrl ? goods.imgUrl : '/static/no-img.png'" mode="aspectFill"
|
|
86
|
|
- lazy-load></image>
|
|
|
90
|
+ <view class="goods-img-container"
|
|
|
91
|
+ v-if="getWarehouseFieldPermissions('goodPicFileList', 'read')">
|
|
|
92
|
+ <image class="goods-img" :src="goods.imgUrl ? goods.imgUrl : '/static/no-img.png'"
|
|
|
93
|
+ mode="aspectFill" lazy-load></image>
|
|
87
|
94
|
<!-- <image class="goods-img" src="/static/no-img.png" mode="aspectFill" lazy-load></image> -->
|
|
88
|
|
- <view :class="['stock-indicator', goods.downStatus == '1' ? 'up-indicator' : 'down-indicator']">
|
|
|
95
|
+ <view
|
|
|
96
|
+ :class="['stock-indicator', goods.downStatus == '1' ? 'up-indicator' : 'down-indicator']">
|
|
89
|
97
|
</view>
|
|
90
|
98
|
</view>
|
|
91
|
99
|
<view class="info-content">
|
|
92
|
100
|
<view class="goods-brand">
|
|
93
|
|
- <view v-if="getWarehouseFieldPermissions('dictLabel','read')">
|
|
|
101
|
+ <view v-if="getWarehouseFieldPermissions('dictLabel', 'read')">
|
|
94
|
102
|
{{ goods.dictLabel || '-' }}
|
|
95
|
103
|
</view>
|
|
96
|
104
|
<!-- <image v-if="goods.indentifyCode" src="../../static/icons/code.png"
|
|
|
@@ -99,35 +107,43 @@
|
|
99
|
107
|
{{ goods.indentifyCode || '' }}
|
|
100
|
108
|
</view> -->
|
|
101
|
109
|
</view>
|
|
102
|
|
- <text class="goods-name" v-if="getWarehouseFieldPermissions('model','read')">型号:{{ goods.model || '-' }}</text>
|
|
103
|
|
- <text class="goods-name" v-if="getWarehouseFieldPermissions('indentifyCode','read')">编码:{{ goods.indentifyCode || '-' }}</text>
|
|
|
110
|
+ <text class="goods-name" v-if="getWarehouseFieldPermissions('model', 'read')">型号:{{
|
|
|
111
|
+ goods.model || '-' }}</text>
|
|
|
112
|
+ <text class="goods-name"
|
|
|
113
|
+ v-if="getWarehouseFieldPermissions('indentifyCode', 'read')">编码:{{
|
|
|
114
|
+ goods.indentifyCode || '-' }}</text>
|
|
104
|
115
|
<view class="price-group">
|
|
105
|
|
- <view class="price-item" v-if="getWarehouseFieldPermissions('costPrice','read')">
|
|
|
116
|
+ <view class="price-item"
|
|
|
117
|
+ v-if="getWarehouseFieldPermissions('costPrice', 'read')">
|
|
106
|
118
|
<text class="price-type">成本价</text>
|
|
107
|
119
|
<text class="price">¥{{ priceVisible ? goods.costPrice || '-' : '****'
|
|
108
|
120
|
}}</text>
|
|
109
|
121
|
</view>
|
|
110
|
|
- <view class="price-item" v-if="getWarehouseFieldPermissions('salePrice','read')">
|
|
|
122
|
+ <view class="price-item"
|
|
|
123
|
+ v-if="getWarehouseFieldPermissions('salePrice', 'read')">
|
|
111
|
124
|
<text class="price-type">销售价</text>
|
|
112
|
125
|
<text class="price sales">¥{{ priceVisible ? goods.salePrice || '-' : '****'
|
|
113
|
126
|
}}</text>
|
|
114
|
127
|
</view>
|
|
115
|
|
- <view class="price-item" v-if="getWarehouseFieldPermissions('peerPrice','read')">
|
|
|
128
|
+ <view class="price-item"
|
|
|
129
|
+ v-if="getWarehouseFieldPermissions('peerPrice', 'read')">
|
|
116
|
130
|
<text class="price-type">同行价</text>
|
|
117
|
131
|
<text class="price">¥{{ priceVisible ? goods.peerPrice || '-' : '****'
|
|
118
|
132
|
}}</text>
|
|
119
|
133
|
</view>
|
|
120
|
|
- <view class="price-item" v-if="getWarehouseFieldPermissions('agentPrice','read')">
|
|
|
134
|
+ <view class="price-item"
|
|
|
135
|
+ v-if="getWarehouseFieldPermissions('agentPrice', 'read')">
|
|
121
|
136
|
<text class="price-type">代理价</text>
|
|
122
|
137
|
<text class="price">¥{{ priceVisible ? goods.agentPrice || '-' : '****'
|
|
123
|
138
|
}}</text>
|
|
124
|
139
|
</view>
|
|
125
|
|
- <view class="price-item" v-if="getWarehouseFieldPermissions('actualPrice','read')">
|
|
|
140
|
+ <view class="price-item"
|
|
|
141
|
+ v-if="getWarehouseFieldPermissions('actualPrice', 'read')">
|
|
126
|
142
|
<text class="price-type">实价</text>
|
|
127
|
143
|
<text class="price">¥{{ priceVisible ? goods.actualPrice || '-' : '****'
|
|
128
|
144
|
}}</text>
|
|
129
|
145
|
</view>
|
|
130
|
|
- <view class="price-item" v-if="getWarehouseFieldPermissions('price','read')">
|
|
|
146
|
+ <view class="price-item" v-if="getWarehouseFieldPermissions('price', 'read')">
|
|
131
|
147
|
<text class="price-type">指导价</text>
|
|
132
|
148
|
<text class="price">¥{{ priceVisible ? goods.price || '-' : '****' }}</text>
|
|
133
|
149
|
</view>
|
|
|
@@ -146,7 +162,8 @@
|
|
146
|
162
|
<view @click.stop="showMoreOptions(goods)">
|
|
147
|
163
|
<u-icon name="more-dot-fill" size="16" color="#666666"></u-icon>
|
|
148
|
164
|
</view>
|
|
149
|
|
- <text class="goods-stock" v-if="getWarehouseFieldPermissions('stock','read')">数量:{{ goods.stock || 0 }}</text>
|
|
|
165
|
+ <text class="goods-stock" v-if="getWarehouseFieldPermissions('stock', 'read')">数量:{{
|
|
|
166
|
+ goods.stock || 0 }}</text>
|
|
150
|
167
|
</view>
|
|
151
|
168
|
|
|
152
|
169
|
</view>
|
|
|
@@ -154,35 +171,43 @@
|
|
154
|
171
|
<view class="more-info-container">
|
|
155
|
172
|
<view class="more-info-header" @click.stop="toggleMoreInfo(goods)">
|
|
156
|
173
|
<text class="more-info-title">更多信息</text>
|
|
157
|
|
- <u-icon :name="goods.showMoreInfo ? 'arrow-up' : 'arrow-down'" size="14" color="#666666"></u-icon>
|
|
|
174
|
+ <u-icon :name="goods.showMoreInfo ? 'arrow-up' : 'arrow-down'" size="14"
|
|
|
175
|
+ color="#666666"></u-icon>
|
|
158
|
176
|
</view>
|
|
159
|
177
|
<transition name="more-info">
|
|
160
|
178
|
<view class="more-info-content" v-if="goods.showMoreInfo">
|
|
161
|
|
- <view class="info-row" v-if="getWarehouseFieldPermissions('recycleTime','read')">
|
|
|
179
|
+ <view class="info-row"
|
|
|
180
|
+ v-if="getWarehouseFieldPermissions('recycleTime', 'read')">
|
|
162
|
181
|
<text class="info-label">回收时间:</text>
|
|
163
|
182
|
<text class="info-value">{{ formatterTime(goods.recycleTime) }}</text>
|
|
164
|
183
|
</view>
|
|
165
|
|
- <view class="info-row" v-if="getWarehouseFieldPermissions('warehouseDate','read')">
|
|
|
184
|
+ <view class="info-row"
|
|
|
185
|
+ v-if="getWarehouseFieldPermissions('warehouseDate', 'read')">
|
|
166
|
186
|
<text class="info-label">入库时间:</text>
|
|
167
|
187
|
<text class="info-value">{{ formatterTime(goods.warehouseDate) }}</text>
|
|
168
|
188
|
</view>
|
|
169
|
|
- <view class="info-row" v-if="getWarehouseFieldPermissions('productPosition','read')">
|
|
|
189
|
+ <view class="info-row"
|
|
|
190
|
+ v-if="getWarehouseFieldPermissions('productPosition', 'read')">
|
|
170
|
191
|
<text class="info-label">商品位置:</text>
|
|
171
|
192
|
<text class="info-value">{{ goods.productPosition || '-' }}</text>
|
|
172
|
193
|
</view>
|
|
173
|
|
- <view class="info-row" v-if="getWarehouseFieldPermissions('identifyingPerson','read')">
|
|
|
194
|
+ <view class="info-row"
|
|
|
195
|
+ v-if="getWarehouseFieldPermissions('identifyingPerson', 'read')">
|
|
174
|
196
|
<text class="info-label">鉴定人员:</text>
|
|
175
|
197
|
<text class="info-value">{{ goods.identifyingPerson || '-' }}</text>
|
|
176
|
198
|
</view>
|
|
177
|
|
- <view class="info-row" v-if="getWarehouseFieldPermissions('recyclePerson','read')">
|
|
|
199
|
+ <view class="info-row"
|
|
|
200
|
+ v-if="getWarehouseFieldPermissions('recyclePerson', 'read')">
|
|
178
|
201
|
<text class="info-label">回收人员:</text>
|
|
179
|
202
|
<text class="info-value">{{ goods.recyclePerson || '-' }}</text>
|
|
180
|
203
|
</view>
|
|
181
|
|
- <view class="info-row" v-if="getWarehouseFieldPermissions('stockStatus','read')">
|
|
|
204
|
+ <view class="info-row"
|
|
|
205
|
+ v-if="getWarehouseFieldPermissions('stockStatus', 'read')">
|
|
182
|
206
|
<text class="info-label">是否入库:</text>
|
|
183
|
|
- <text class="info-value">{{ goods.stockStatus == '1' ? '已入库' : '未入库' }}</text>
|
|
|
207
|
+ <text class="info-value">{{ goods.stockStatus == '1' ? '已入库' : '未入库'
|
|
|
208
|
+ }}</text>
|
|
184
|
209
|
</view>
|
|
185
|
|
- <view class="info-row" v-if="getWarehouseFieldPermissions('payType','read')">
|
|
|
210
|
+ <view class="info-row" v-if="getWarehouseFieldPermissions('payType', 'read')">
|
|
186
|
211
|
<text class="info-label">付款方式:</text>
|
|
187
|
212
|
<text class="info-value">{{ payFormatter(goods.payType) }}</text>
|
|
188
|
213
|
</view>
|
|
|
@@ -204,7 +229,7 @@
|
|
204
|
229
|
<script>
|
|
205
|
230
|
import searchFilter from './components/searchFilter.vue'
|
|
206
|
231
|
import moreInfo from './components/moreInfo.vue'
|
|
207
|
|
-import { permissionCheck,getWarehouseFieldPermissions } from '../../utils/util.js'
|
|
|
232
|
+import { getWarehouseButtonPermissions, getWarehouseFieldPermissions,getRoles } from '../../utils/util.js'
|
|
208
|
233
|
import orderList from './components/orderList/index.vue'
|
|
209
|
234
|
import { paymentTabList,productAttributeList } from './js/public.js'
|
|
210
|
235
|
import jtimePickerPopup from '@/uni_modules/jtime-picker-popup/components/JTimePicker/JTimePicker.vue';
|
|
|
@@ -215,6 +240,11 @@ export default {
|
|
215
|
240
|
orderList,
|
|
216
|
241
|
jtimePickerPopup
|
|
217
|
242
|
},
|
|
|
243
|
+ computed: {
|
|
|
244
|
+ isAdmin() {
|
|
|
245
|
+ return getRoles().some(v => v.includes('admin' || 'ADMIN'))
|
|
|
246
|
+ }
|
|
|
247
|
+ },
|
|
218
|
248
|
data() {
|
|
219
|
249
|
return {
|
|
220
|
250
|
searchString: '',//搜索编号、名称、品牌...
|
|
|
@@ -304,7 +334,7 @@ export default {
|
|
304
|
334
|
},
|
|
305
|
335
|
paymentTabList: paymentTabList,
|
|
306
|
336
|
productAttributeList: productAttributeList,
|
|
307
|
|
- selectText:'暂无筛选条件'
|
|
|
337
|
+ selectText: '暂无筛选条件'
|
|
308
|
338
|
};
|
|
309
|
339
|
},
|
|
310
|
340
|
onLoad() {
|
|
|
@@ -349,6 +379,7 @@ export default {
|
|
349
|
379
|
this.$refs.moreInfoRef.showMoreInfo();
|
|
350
|
380
|
},
|
|
351
|
381
|
getWarehouseFieldPermissions,
|
|
|
382
|
+ getWarehouseButtonPermissions,
|
|
352
|
383
|
handleMoreInfoConfirm() {
|
|
353
|
384
|
this.$refs.moreInfoRef.closeModal();
|
|
354
|
385
|
},
|
|
|
@@ -400,7 +431,7 @@ export default {
|
|
400
|
431
|
if (!attr || attr.length == 0) {
|
|
401
|
432
|
return '暂无'
|
|
402
|
433
|
}
|
|
403
|
|
- return attr.map(a=>this.productAttributeList.find(b=>b.value == a))?.map(item=>item.name).join(' ') || '暂无'
|
|
|
434
|
+ return attr.map(a => this.productAttributeList.find(b => b.value == a))?.map(item => item.name).join(' ') || '暂无'
|
|
404
|
435
|
},
|
|
405
|
436
|
formatterStockStatus(status) {
|
|
406
|
437
|
if (!status) {
|
|
|
@@ -427,7 +458,7 @@ export default {
|
|
427
|
458
|
handleSwipeClick(e, item, goodsIndex) {
|
|
428
|
459
|
if (e.index == 0) {//删除
|
|
429
|
460
|
this.isSwipeClick = true;
|
|
430
|
|
- if (!permissionCheck('WAREHOUSER')) return false
|
|
|
461
|
+ if (!this.getWarehouseButtonPermissions('delete')) return false
|
|
431
|
462
|
uni.$u.api.wareHouseDelete({
|
|
432
|
463
|
id: item.id
|
|
433
|
464
|
}).then(() => {
|
|
|
@@ -520,7 +551,7 @@ export default {
|
|
520
|
551
|
return false;
|
|
521
|
552
|
},
|
|
522
|
553
|
},
|
|
523
|
|
-
|
|
|
554
|
+
|
|
524
|
555
|
onShow() {
|
|
525
|
556
|
// 尝试恢复页面状态
|
|
526
|
557
|
if (!this.restorePageState()) {
|
|
|
@@ -528,7 +559,7 @@ export default {
|
|
528
|
559
|
this.pageNum = 1;
|
|
529
|
560
|
this.getList();
|
|
530
|
561
|
}
|
|
531
|
|
-
|
|
|
562
|
+
|
|
532
|
563
|
this.getCard();
|
|
533
|
564
|
// 监听数据更新事件
|
|
534
|
565
|
this.updateListener = uni.$on('warehouse-data-updated', () => {
|
|
|
@@ -542,7 +573,7 @@ export default {
|
|
542
|
573
|
onHide() {
|
|
543
|
574
|
// 页面隐藏时保存状态
|
|
544
|
575
|
this.savePageState();
|
|
545
|
|
-
|
|
|
576
|
+
|
|
546
|
577
|
// 移除事件监听器
|
|
547
|
578
|
if (this.updateListener) {
|
|
548
|
579
|
uni.$off('warehouse-data-updated', null);
|