Bläddra i källkod

feat:仓库数据如果未入库点击进入编辑页面,如果已经入库进入详情页面

zhangxin 1 månad sedan
förälder
incheckning
bd3db47575

+ 7 - 9
components/add-inquiry-dialog/index.vue

@@ -89,14 +89,13 @@ export default {
89 89
                 xAxis: {
90 90
                     disableGrid: true,
91 91
                     scrollShow: true,
92
-                    itemCount: 7
92
+                    itemCount: 10,
93
+                    rotateLabel: true,
94
+                    rotateAngle: 45,
93 95
                 },
94 96
                 yAxis: {
95 97
                     gridType: "dash",
96 98
                     dashLength: 7,
97
-                    axisLabel:{
98
-                        show: false
99
-                    }
100 99
                 },
101 100
                 extra: {
102 101
                     line: {
@@ -244,17 +243,16 @@ export default {
244 243
         },
245 244
         getChartData() {
246 245
             uni.$u.api.inquiryChart({
247
-                dictValue: this.info.dictValue,
248 246
                 model: this.info.model,
249 247
             }).then(res => {
250 248
                 if (res.code == 200) {
251
-                    
249
+                    const reverseData = res.data.reverse()
252 250
                     let data = {
253
-                        categories: res.data.map(item=>item.recycleTime),
251
+                        categories: reverseData.map(item=>item.recycleTime),
254 252
                         series: [
255 253
                             {
256
-                                name: this.info.model+'价格趋势',
257
-                                data: res.data.map(item=>item.costPrice),
254
+                                name: this.info.model+'价格',
255
+                                data: reverseData.map(item=>item.price),
258 256
                                 setShadow: [
259 257
                                     3,
260 258
                                     8,

+ 2 - 2
pages.json

@@ -174,9 +174,9 @@
174 174
 			}
175 175
 		},
176 176
 		{
177
-			"path": "pages/wareHouse/components/add",
177
+			"path": "pages/wareHouse/components/edit",
178 178
 			"style": {
179
-				"navigationBarTitleText": "仓库新增",
179
+				"navigationBarTitleText": "仓库编辑",
180 180
 				"enablePullDownRefresh": false,
181 181
 				"navigationStyle": "custom"
182 182
 			}

+ 67 - 18
pages/wareHouse/components/detail.vue

@@ -12,7 +12,7 @@
12 12
 
13 13
         <!-- 立即下架按钮 -->
14 14
         <view class="immediate_off_shelf">
15
-            <u-button type="error" shape="circle" size="large" @click="handleOffShelf" :disabled="lockStatus === '1'">
15
+            <u-button type="error" shape="circle" size="large" @click="handleOffShelf" :disabled="lockStatus === '1' || globalEditMode">
16 16
                 <u-icon :name="downStatus == '0' ? 'arrow-upward' : 'arrow-downward'" size="38rpx"
17 17
                     color="#ffffff"></u-icon>
18 18
                 <text>{{ downStatus == '0' ? '立即上架' : '立即下架' }}</text>
@@ -73,6 +73,10 @@
73 73
                 </view>
74 74
             </view>
75 75
             <view class="info_row">
76
+                <view class="info_label">是否入库</view>
77
+                <view class="info_value">{{ stockStatusFormatter(coreInfo.stockStatus) }}</view>
78
+            </view>
79
+            <view class="info_row">
76 80
                 <view class="info_label">入库日期</view>
77 81
                 <view class="info_value">{{ coreInfo.createTime || '-' }}</view>
78 82
             </view>
@@ -188,22 +192,28 @@
188 192
         </view>
189 193
 
190 194
         <!-- 底部功能按钮栏 -->
191
-        <view class="bottom_bar">
192
-            <view class="bar_item" @click.stop="globalEditMode ? handleClickOutside() : enterGlobalEdit()">
195
+        <view :class="['bottom_bar', { 'fourPart': coreInfo.stockStatus === '1', 'fivePart': coreInfo.stockStatus === '0' }]">
196
+            <view class="bar_item" @click.stop="globalEditMode ? confirmGlobalEdit() : enterGlobalEdit()">
193 197
                 <u-icon :name="globalEditMode ? 'checkbox-mark' : 'edit-pen'" size="46rpx"
194 198
                     :color="globalEditMode ? '#10b981' : '#9ca3af'"></u-icon>
195 199
                 <text class="bar_text">{{ globalEditMode ? '确定' : '编辑' }}</text>
196 200
             </view>
197
-            <view class="bar_item" @click.stop="lockGoods">
201
+            <view :class="['bar_item', { 'disabled': globalEditMode}]" @click.stop="lockGoods">
198 202
                 <u-icon :name="lockStatus === '1' ? 'lock-open' : 'lock'" size="46rpx" color="#9ca3af"></u-icon>
199 203
                 <text class="bar_text">{{ lockStatus === '1' ? '解锁' : '锁单' }}</text>
200 204
             </view>
201
-            <view class="bar_item">
202
-                <image class="bar_icon" src="../../../static//icons/print.png" alt=""></image>
205
+            <view :class="['bar_item', { 'disabled': globalEditMode}]">
206
+                <image class="bar_icon" src="../../../static/icons/print.png" alt=""></image>
203 207
                 <text class="bar_text">打印</text>
204 208
             </view>
205
-            <view :class="['bar_item', { 'disabled': lockStatus === '1' }]" @click="handleOpenOrder">
206
-                <view class="primary">
209
+            <view class="bar_item" v-if="coreInfo.stockStatus === '0'" @click.stop="handleConfirmStockIn">
210
+                <view class="primary blue">
211
+                    <image class="bar_img" src="../../../static/icons/stockIn.png" alt=""></image>
212
+                    <text class="bar_text">确认入库</text>
213
+                </view>
214
+            </view>
215
+            <view :class="['bar_item', { 'disabled': lockStatus === '1' ||  globalEditMode}]" @click="handleOpenOrder">
216
+                <view class="primary orange">
207 217
                     <u-icon name="bag" size="44rpx" color="#fff"></u-icon>
208 218
                     <text class="bar_text">开单</text>
209 219
                 </view>
@@ -271,6 +281,17 @@ export default {
271 281
                 icon: 'none'
272 282
             })
273 283
         },
284
+        // 是否入库格式化
285
+        stockStatusFormatter(val){
286
+            switch (val) {
287
+                case '1':
288
+                    return '已入库'
289
+                case '0':
290
+                    return '未入库'
291
+                default:
292
+                    return '-'
293
+            }
294
+        },
274 295
         payTypeFormatter(val){
275 296
             switch (val) {
276 297
                 case '1':
@@ -291,6 +312,13 @@ export default {
291 312
         },
292 313
         // 锁单
293 314
         lockGoods() {
315
+            if (this.globalEditMode) {
316
+                uni.showToast({
317
+                    title: '编辑状态下不能操作',
318
+                    icon: 'none'
319
+                })
320
+                return
321
+            }
294 322
             uni.$u.api.wareHouseLock({
295 323
                 id: this.goodsId,
296 324
                 lockStatus: this.lockStatus === '1' ? '0' : '1',
@@ -358,6 +386,13 @@ export default {
358 386
                 })
359 387
                 return
360 388
             }
389
+            if (this.globalEditMode) {
390
+                uni.showToast({
391
+                    title: '编辑状态下不能开单',
392
+                    icon: 'none'
393
+                })
394
+                return
395
+            }
361 396
             const params = {
362 397
                 id: this.goodsId,
363 398
                 url: this.imgsUrl[0]?.url,
@@ -374,6 +409,10 @@ export default {
374 409
                 url: '/pages/wareHouse/components/openOrder?params=' + JSON.stringify(params),
375 410
             });
376 411
         },
412
+        handleConfirmStockIn(){
413
+            this.coreInfo.stockStatus = '1';
414
+            this.submitEdit(this.coreInfo)
415
+        },
377 416
         viewLog() {
378 417
             uni.$u.api.wareHouseLog({
379 418
                 id: this.goodsId,
@@ -393,6 +432,13 @@ export default {
393 432
                 })
394 433
                 return
395 434
             }
435
+            if (this.globalEditMode) {
436
+                uni.showToast({
437
+                    title: '编辑状态下不能操作',
438
+                    icon: 'none'
439
+                })
440
+                return
441
+            }
396 442
             uni.$u.api.wareHouseDown({
397 443
                 id: this.goodsId,
398 444
                 downStatus: this.downStatus === '1' ? '0' : '1',
@@ -474,6 +520,7 @@ export default {
474 520
                 recyclePersonId: info.recyclePersonId,
475 521
                 identifyingPerson: info.identifyingPerson,
476 522
                 identifyingPersonId: info.identifyingPersonId,
523
+                stockStatus: info.stockStatus,
477 524
             }
478 525
             uni.$u.api.wareHouseUpdate(data).then(res => {
479 526
                 uni.showToast({
@@ -491,16 +538,7 @@ export default {
491 538
         },
492 539
         // 点击页面其他地方保存所有编辑
493 540
         handleClickOutside() {
494
-            if (this.globalEditMode) {
495
-                this.submitEdit(this.tempValues)
496
-                // 全局编辑模式下,点击外部区域重置所有编辑
497
-                this.globalEditMode = false;
498
-                // 退出所有编辑状态
499
-                this.resetEditMode();
500
-                // 清空临时值,恢复初始状态
501
-                this.tempValues = {};
502
-
503
-            } else {
541
+            if (!this.globalEditMode) {
504 542
                 // 保存当前正在编辑的字段
505 543
                 Object.keys(this.editMode).forEach(key => {
506 544
                     if (this.editMode[key]) {
@@ -508,8 +546,19 @@ export default {
508 546
                     }
509 547
                 });
510 548
             }
549
+            // 当globalEditMode为true时,不执行任何操作
511 550
 
512 551
         },
552
+        // 确认全局编辑
553
+        confirmGlobalEdit() {
554
+            this.submitEdit(this.tempValues)
555
+            // 重置全局编辑模式
556
+            this.globalEditMode = false;
557
+            // 退出所有编辑状态
558
+            this.resetEditMode();
559
+            // 清空临时值,恢复初始状态
560
+            this.tempValues = {};
561
+        },
513 562
         handleDownload() {
514 563
             if (this.imgsUrl.length == 0) {
515 564
                 uni.showToast({

+ 113 - 63
pages/wareHouse/components/add.vue

@@ -37,14 +37,16 @@
37 37
                         </view>
38 38
                     </u-form-item>
39 39
                     <u-form-item label="商品描述(详细的描述让用户更好的了解您的产品)" required prop="desc" borderBottom>
40
-                        <u--textarea v-model="formData.desc" clearable placeholder="95新 WHZ19219H
41
-                        CHANEL香奈儿链条单肩包
40
+                        <u--textarea v-model="formData.desc" clearable placeholder="95新 WHZ19219H CHANEL香奈儿链条单肩包
42 41
                         21开 牛皮 尺寸25 4 15
43 42
                         配件中溯卡" count autoHeight maxlength="250" height="100" confirmType="done"></u--textarea>
44 43
                     </u-form-item>
44
+                    <u-form-item label="来源" prop="origin" borderBottom>
45
+                        <u--textarea v-model="formData.origin" clearable placeholder="请输入来源" count autoHeight maxlength="250" height="100" confirmType="done"></u--textarea>
46
+                    </u-form-item>
45 47
                     <u-form-item label="商品分类" required prop="type" borderBottom>
46
-                        <TabSelect :tabList="typeList" :isClear="typeIsClear" @tabChange="handleTabChangeType" labelKey="dictLabel" valueKey="dictValue"
47
-                            :colNum="4" mode="single" echoInfo="1">
48
+                        <TabSelect :tabList="typeList" :isClear="typeIsClear" @tabChange="handleTabChangeType"
49
+                            labelKey="dictLabel" valueKey="dictValue" :colNum="4" mode="single" :echoInfo="echoInfoType">
48 50
                         </TabSelect>
49 51
                     </u-form-item>
50 52
                     <u-form-item label="品牌" required prop="dictLabel" class="u-form-item-row" borderBottom
@@ -81,11 +83,12 @@
81 83
                     </u-form-item>
82 84
                     <u-form-item label="商品成色" required prop="productCondition" borderBottom>
83 85
                         <TabSelect :tabList="productConditionList" :isClear="productConditionIsClear"
84
-                            @tabChange="handleTabChangeProductCondition" :colNum="2" mode="single" echoInfo="1"></TabSelect>
86
+                            @tabChange="handleTabChangeProductCondition" :colNum="2" mode="single" :echoInfo="echoInfoProductCondition">
87
+                        </TabSelect>
85 88
                     </u-form-item>
86 89
                     <u-form-item label="细节图" borderBottom>
87 90
                         <!-- <view class="detail_pic_container"> -->
88
-                            <!-- <view>
91
+                        <!-- <view>
89 92
                                 <text class="tip">视频:</text>
90 93
                                 <ImgsRowScroll v-if="formData.detailVideoFileList.length > 0" :isShowDeleteIcon="true"
91 94
                                     @deleteVideoInfo="getDeleteDetailVideoInfo" imgMode="aspectFill" :totalWidth="400"
@@ -93,16 +96,16 @@
93 96
                                     :imageHeight="150" accept="video"></ImgsRowScroll>
94 97
                                 <u-upload @afterRead="afterReadDeatilVideo"  name="2" multiple :maxCount="10" accept="video"></u-upload>
95 98
                             </view> -->
96
-                            <!-- <view> -->
97
-                                <!-- <text class="tip">图片:</text> -->
98
-                                <view class="imgs_scroll">
99
-                                    <ImgsRowScroll v-if="formData.detailPicFileList.length > 0" :isShowDeleteIcon="true"
100
-                                        @deleteImgInfo="getDeleteDetailPicInfo" imgMode="aspectFill" :totalWidth="400"
101
-                                        :images="formData.detailPicFileList" :previewEnabled="true" :imageWidth="150"
102
-                                        :imageHeight="150"></ImgsRowScroll>
103
-                                    <u-upload @afterRead="afterReadDetailPic" name="1" multiple :maxCount="10"></u-upload>
104
-                                </view>
105
-                            <!-- </view> -->
99
+                        <!-- <view> -->
100
+                        <!-- <text class="tip">图片:</text> -->
101
+                        <view class="imgs_scroll">
102
+                            <ImgsRowScroll v-if="formData.detailPicFileList.length > 0" :isShowDeleteIcon="true"
103
+                                @deleteImgInfo="getDeleteDetailPicInfo" imgMode="aspectFill" :totalWidth="400"
104
+                                :images="formData.detailPicFileList" :previewEnabled="true" :imageWidth="150"
105
+                                :imageHeight="150"></ImgsRowScroll>
106
+                            <u-upload @afterRead="afterReadDetailPic" name="1" multiple :maxCount="10"></u-upload>
107
+                        </view>
108
+                        <!-- </view> -->
106 109
                         <!-- </view> -->
107 110
                     </u-form-item>
108 111
                     <u-form-item label="商品标题" borderBottom>
@@ -113,12 +116,14 @@
113 116
                         <u--input v-model="formData.productNo" placeholder="请输入" clearable border="none"></u--input>
114 117
                     </u-form-item>
115 118
                     <u-form-item label="商品属性" required prop="productAttribute" borderBottom>
116
-                        <TabSelect :tabList="productAttributeList"  :colNum="4" mode="single"
117
-                            :isClear="productAttributeIsClear" @tabChange="handleTabChangeProductAttribute" echoInfo="1">
119
+                        <TabSelect :tabList="productAttributeList" :colNum="4" mode="single"
120
+                            :isClear="productAttributeIsClear" @tabChange="handleTabChangeProductAttribute"
121
+                            :echoInfo="echoInfoProductAttribute">
118 122
                         </TabSelect>
119 123
                     </u-form-item>
120 124
                     <u-form-item label="库存数量" required prop="stock" class="u-form-item-row" borderBottom>
121
-                        <u--input v-model="formData.stock" placeholder="请输入" clearable border="none" type="number"></u--input>
125
+                        <u--input v-model="formData.stock" placeholder="请输入" clearable border="none"
126
+                            type="number"></u--input>
122 127
                     </u-form-item>
123 128
                     <u-form-item label="总成本价" class="u-form-item-row" borderBottom>
124 129
                         <u--input v-model="formData.costPrice" placeholder="请输入" clearable border="none"></u--input>
@@ -140,24 +145,30 @@
140 145
                         <u--input v-model="formData.watchYear" placeholder="请输入" clearable border="none"></u--input>
141 146
                     </u-form-item>
142 147
                     <u-form-item label="鉴定人员" class="u-form-item-row" borderBottom @click="identifyingPersonClick">
143
-                        <Cell :val="formData.identifyingPerson" :isDelete="true" @handleClear="clear('identifyingPerson')"></Cell>
148
+                        <Cell :val="formData.identifyingPerson" :isDelete="true"
149
+                            @handleClear="clear('identifyingPerson')"></Cell>
144 150
                         <PersonPicker ref="identifyingPersonPickerRef" title="请选择鉴定人员"
145 151
                             @selectPerson="handleSelectIdentifyingPerson"></PersonPicker>
146 152
                     </u-form-item>
153
+                    <u-form-item label="是否入库" borderBottom required prop="stockStatus">
154
+                        <TabSelect :tabList="stockStatusList" :colNum="2" mode="single" :isClear="stockStatusIsClear" :echoInfo="echoInfoStockStatus"
155
+                            @tabChange="handleTabChangeStockStatus"></TabSelect>
156
+                    </u-form-item>
147 157
                     <u-form-item label="回收类型" borderBottom>
148
-                        <TabSelect :tabList="recycleTypeList" :colNum="4" mode="single" 
149
-                            :isClear="recycleTypeIsClear" @tabChange="handleTabChangeRecycleType">
158
+                        <TabSelect :tabList="recycleTypeList" :colNum="4" mode="single" :isClear="recycleTypeIsClear"
159
+                            @tabChange="handleTabChangeRecycleType">
150 160
                         </TabSelect>
151 161
                     </u-form-item>
152 162
                     <u-form-item label="标签" borderBottom>
153
-                        <TabSelect :tabList="labelList" :colNum="4" mode="single" 
154
-                            :isClear="labelIsClear" @tabChange="handleTabChangeLabel">
163
+                        <TabSelect :tabList="labelList" :colNum="5" mode="single" :isClear="labelIsClear"
164
+                            @tabChange="handleTabChangeLabel">
155 165
                         </TabSelect>
156 166
                     </u-form-item>
157 167
                     <u-form-item label="回收人员" class="u-form-item-row" borderBottom @click="recyclePersonClick">
158 168
                         <!-- <u--input v-model="formData.recyclePerson" disabledColor="#fff" disabled clearable
159 169
                             border="none"></u--input> -->
160
-                        <Cell :val="formData.recyclePerson" :isDelete="true" @handleClear="clear('recyclePerson')"></Cell>
170
+                        <Cell :val="formData.recyclePerson" :isDelete="true" @handleClear="clear('recyclePerson')">
171
+                        </Cell>
161 172
                         <PersonPicker ref="recyclePersonPickerRef" title="请选择回收人员"
162 173
                             @selectPerson="handleSelectRecyclePerson"></PersonPicker>
163 174
                     </u-form-item>
@@ -235,17 +246,16 @@
235 246
                         </view>
236 247
                     </u-form-item>
237 248
                     <u-form-item label="付款方式">
238
-                        <TabSelect :tabList="paymentTabList" :echoInfo="payTypeEcho" :colNum="4" mode="single" 
249
+                        <TabSelect :tabList="paymentTabList" :echoInfo="payTypeEcho" :colNum="4" mode="single"
239 250
                             :isClear="payTypeIsClear" @tabChange="handlePayTypeTabChange">
240 251
                         </TabSelect>
241 252
                     </u-form-item>
242 253
                 </u--form>
243 254
             </view>
244
-
245 255
         </view>
246
-        <view class="btn_group">
247
-            <u-button plain type="primary" @click="submitForm('onlyIn')">仅入库</u-button>
248
-            <u-button type="primary" @click="submitForm('inAndUp')">入库并上架</u-button>
256
+        <view :class="['btn_group', {'col-2': formData.stockStatus == '1'}]">
257
+            <u-button plain type="primary" @click="submitForm('onlyIn')">{{ formData.stockStatus == '0' ? '待入库' : '仅入库' }}</u-button>
258
+            <u-button type="primary" @click="submitForm('inAndUp')" v-if="formData.stockStatus == '1'">入库并上架</u-button>
249 259
         </view>
250 260
     </view>
251 261
 </template>
@@ -271,6 +281,7 @@ export default {
271 281
             formData: {
272 282
                 goodPicFileList: [],//商品图片
273 283
                 desc: '',
284
+                origin: '',
274 285
                 type: '1',
275 286
                 dictLabel: '艾美',
276 287
                 dictValue: '88',
@@ -297,6 +308,7 @@ export default {
297 308
                 watchYear: '',
298 309
                 identifyingPerson: '',
299 310
                 identifyingPersonId: '',
311
+                stockStatus: '0',
300 312
                 recycleType: '',
301 313
                 recyclePerson: '',
302 314
                 recyclePersonId: '',
@@ -320,25 +332,28 @@ export default {
320 332
                     { required: true, message: '请上传商品图片' },
321 333
                 ],
322 334
                 desc: [
323
-                    { required: true, message: '请输入商品描述', trigger: 'blur' },
335
+                    { required: true, message: '请输入商品描述', trigger: ['blur', 'change'] },
324 336
                 ],
325 337
                 type: [
326
-                    { required: true, message: '请选择商品分类', trigger: 'blur' },
338
+                    { required: true, message: '请选择商品分类', trigger: ['blur', 'change'] },
327 339
                 ],
328 340
                 dictLabel: [
329
-                    { required: true, message: '请选择品牌', trigger: 'blur' },
341
+                    { required: true, message: '请选择品牌', trigger: ['blur', 'change'] },
330 342
                 ],
331 343
                 productCondition: [
332
-                    { required: true, message: '请选择商品成色', trigger: 'blur' },
344
+                    { required: true, message: '请选择商品成色', trigger: ['blur', 'change'] },
333 345
                 ],
334 346
                 productAttribute: [
335
-                    { required: true, message: '请选择商品属性', trigger: 'blur' },
347
+                    { required: true, message: '请选择商品属性', trigger: ['blur', 'change'] },
336 348
                 ],
337 349
                 stock: [
338 350
                     { required: true, message: '请输入库存数量' },
339 351
                 ],
352
+                stockStatus: [
353
+                    { required: true, message: '请选择是否入库', trigger: [ 'change'] },
354
+                ],
340 355
                 recycleTime: [
341
-                    { required: true, message: '请选择回收时间', trigger: 'blur' },
356
+                    { required: true, message: '请选择回收时间', trigger: ['blur', 'change'] },
342 357
                 ],
343 358
 
344 359
             },
@@ -373,6 +388,16 @@ export default {
373 388
                     value: '4',
374 389
                 },
375 390
             ],
391
+            stockStatusList: [
392
+                {
393
+                    name: '待入库',
394
+                    value: '0',
395
+                },
396
+                {
397
+                    name: '已入库',
398
+                    value: '1',
399
+                },
400
+            ],
376 401
             recycleTypeList: [
377 402
                 {
378 403
                     name: '线上',
@@ -391,26 +416,26 @@ export default {
391 416
                     value: '4',
392 417
                 },
393 418
             ],
394
-            labelList:[
419
+            labelList: [
395 420
                 {
396
-                    name:'完美',
397
-                    value:'1',
421
+                    name: '完美',
422
+                    value: '1',
398 423
                 },
399 424
                 {
400
-                    name:'普通',
401
-                    value:'2',
425
+                    name: '普通',
426
+                    value: '2',
402 427
                 },
403 428
                 {
404
-                    name:'瑕疵',
405
-                    value:'3',
429
+                    name: '瑕疵',
430
+                    value: '3',
406 431
                 },
407 432
                 {
408
-                    name:'假货',
409
-                    value:'4',
433
+                    name: '假货',
434
+                    value: '4',
410 435
                 },
411 436
                 {
412
-                    name:'亏损',
413
-                    value:'5',
437
+                    name: '亏损',
438
+                    value: '5',
414 439
                 },
415 440
             ],
416 441
             paymentTabList: [
@@ -443,25 +468,44 @@ export default {
443 468
             productConditionIsClear: false,//商品成色是否清空
444 469
             productAttributeIsClear: false,//商品属性是否清空
445 470
             recycleTypeIsClear: false,//回收类型是否清空
471
+            stockStatusIsClear: false,//是否入库是否清空
446 472
             labelIsClear: false,//商品标签是否清空
447 473
             payTypeIsClear: false,//付款方式是否清空
448
-            payTypeEcho: ''//付款方式识别回显
449
-
474
+            payTypeEcho: '',//付款方式识别回显
475
+            echoInfoType:'',//入库回显的时候 类型回显
476
+            echoInfoProductAttribute:'',//入库回显的时候 商品属性回显
477
+            echoInfoProductCondition:'',//入库回显的时候 商品成色回显
478
+            echoInfoStockStatus:'',//入库回显的时候 是否入库回显
450 479
         }
451 480
     },
452
-    onLoad() {
481
+    onLoad(options) {
453 482
         this.getTypeList();
483
+        this.$nextTick(()=>{
484
+            if(options.formType == 'add'){
485
+                this.clearForm()
486
+            }else if(options.formType == 'edit'){
487
+                uni.$u.api.wareHouseDetail({
488
+                    id: options.id,
489
+                    userId: this.$store.state.user.userInfo.userId,
490
+                }).then(res => {
491
+                    const key = ['costPrice','dictLabel','dictValue','goodPicFileList','indexntifuCode','origin','stockStatus']
492
+                    key.forEach(item => {
493
+                        this.formData[item] = res.data[item]
494
+                    })
495
+                    this.recycleTime = this.$dayjs(res.data.recycleTime).format('YYYY-MM-DD') || ''
496
+                    this.echoInfoType = res.data.type || '1'
497
+                });
498
+            }
499
+        })
454 500
     },
455 501
     methods: {
456
-        getTypeList(){
502
+        getTypeList() {
457 503
             this.$getDicts("crm_form_category").then(res => {
458 504
                 this.typeList = res
459 505
             })
460 506
         },
461 507
         // 提交表单
462 508
         submitForm(submitType) {
463
-            console.log(this.formData);
464
-            
465 509
             this.$refs.addForm.validate().then((valid) => {
466 510
                 if (valid) {
467 511
                     if (this.formData.title == '') {
@@ -470,13 +514,10 @@ export default {
470 514
                     this.formData.recycleTime = this.$dayjs(this.formData.recycleTime).format('YYYY-MM-DD')
471 515
                     const data = {
472 516
                         ...this.formData,
473
-                        submitType: submitType, //提交类型 onlyIn:仅入库 inAndUp:入库并上架
517
+                        submitType: submitType, //提交类型 onlyIn:仅入库/暂存入库 inAndUp:入库并上架
474 518
                         continuousWarehousing: this.continuousWarehousing[0] || '0',//是否连续入库 1:是 0:否
475 519
                     }
476
-                    console.log(data);
477
-                    
478 520
                     uni.$u.api.wareHouseAdd(data).then(res => {
479
-                        console.log(res);
480 521
                         if (res.code === 200) {
481 522
                             uni.$u.toast('新增成功');
482 523
                             if (data.continuousWarehousing == '0') {
@@ -501,6 +542,7 @@ export default {
501 542
             this.formData = {
502 543
                 goodPicFileList: [],//商品图片
503 544
                 desc: '',
545
+                origin: '',
504 546
                 type: '1',
505 547
                 dictLabel: '艾美',
506 548
                 dictValue: '88',
@@ -527,6 +569,7 @@ export default {
527 569
                 watchYear: '',
528 570
                 identifyingPerson: '',
529 571
                 identifyingPersonId: '',
572
+                stockStatus: '0',
530 573
                 recycleType: '',
531 574
                 label: '',
532 575
                 recyclePerson: '',
@@ -545,14 +588,17 @@ export default {
545 588
                 productDescPicFileList: [],//商品备注图片
546 589
                 payType: '',
547 590
             }
548
-            this.typeIsClear = true;
549
-            this.productConditionIsClear = true;
550
-            this.productAttributeIsClear = true;
551 591
             this.recycleTypeIsClear = true;
552 592
             this.payTypeIsClear = true;
553 593
             this.labelIsClear = true;
594
+            this.echoInfoType = '1';//类型默认第一项
595
+            this.echoInfoProductCondition = '1';//商品成色默认第一项
596
+            this.echoInfoProductAttribute = '1';//商品属性默认第一项
597
+            this.echoInfoStockStatus = '0';//是否入库默认第一项
554 598
             this.continuousWarehousing = [];
555
-            this.$refs.addForm.resetFields();
599
+            this.$nextTick(()=>{
600
+                this.$refs.addForm.resetFields();
601
+            })
556 602
         },
557 603
         // 选择品牌
558 604
         handleSelectedBrand(info) {
@@ -601,6 +647,10 @@ export default {
601 647
             this.formData.productAttribute = e;
602 648
             this.$refs.addForm.validateField('productAttribute')
603 649
         },
650
+        // 是否入库
651
+        handleTabChangeStockStatus(e) {
652
+            this.formData.stockStatus = e;
653
+        },
604 654
         // 回收类型
605 655
         handleTabChangeRecycleType(e) {
606 656
             this.formData.recycleType = e;
@@ -761,7 +811,7 @@ export default {
761 811
                     this.formData.dictLabel = result['品牌'];
762 812
                 }
763 813
                 if (result['来源']) {
764
-                    this.formData.desc = result['来源'];
814
+                    this.formData.origin = result['来源'];
765 815
                 }
766 816
                 if (result['实价']) {
767 817
                     this.formData.costPrice = result['实价'];
@@ -806,5 +856,5 @@ export default {
806 856
 }
807 857
 </script>
808 858
 <style lang="scss" scoped>
809
-@import '../styles/add.scss';
859
+@import '../styles/edit.scss';
810 860
 </style>

+ 64 - 0
pages/wareHouse/components/moreInfo.vue

@@ -0,0 +1,64 @@
1
+<template>
2
+    <u-modal :show="show">
3
+        <div class="more-info">
4
+            <view class="modal-item">
5
+                <text>品牌:</text>
6
+                <text>{{ moreOptions.dictLabel || '-' }}</text>
7
+            </view>
8
+            <view class="modal-item">
9
+                <text>来源:</text>
10
+                <text>{{ moreOptions.origin || '-' }}</text>
11
+            </view>
12
+            <view class="modal-item">
13
+                <text>实价:</text>
14
+                <text>¥{{ moreOptions.costPrice || '-' }}</text>
15
+            </view>
16
+            <view class="modal-item">
17
+                <text>型号:</text>
18
+                <text>{{ moreOptions.model || '-' }}</text>
19
+            </view>
20
+            <view class="modal-item">
21
+                <text>编码:</text>
22
+                <text>{{ moreOptions.indentifyCode || '-' }}</text>
23
+            </view>
24
+            <view class="modal-item">
25
+                <text>日期:</text>
26
+                <text>{{ recycleTimeFormatter(moreOptions.recycleTime) || '-' }}</text>
27
+            </view>
28
+            <view class="modal-item">
29
+                <text>备注:</text>
30
+                <text>{{ moreOptions.productDesc || '-' }}</text>
31
+            </view>
32
+        </div>
33
+    </u-modal>
34
+</template>
35
+
36
+<script>
37
+export default {
38
+    name: 'MoreInfo',
39
+    props: {
40
+        moreOptions: {
41
+            type: Object,
42
+            default: () => { }
43
+        }
44
+    },
45
+    data() {
46
+        return {
47
+            show: false,
48
+        }
49
+    },
50
+    methods: {
51
+        showMoreInfo() {
52
+            this.show = true;
53
+        },
54
+        recycleTimeFormatter(val) {
55
+            if (val) {
56
+                return this.$dayjs(val).format('YYYY-MM-DD HH:mm:ss')
57
+            }
58
+            return '-'
59
+        }
60
+    }
61
+}
62
+</script>
63
+
64
+<style lang="scss" scoped></style>

+ 24 - 1
pages/wareHouse/components/searchFilter.vue

@@ -29,6 +29,9 @@
29 29
             <u-form-item label="商品属性" labelWidth="70">
30 30
                 <TabSelect :tabList="productAttributeList" :colNum="3" :echoInfo="formData.productAttribute" mode="multiple" @tabChange="handleTabChangeProductAttribute"></TabSelect>
31 31
             </u-form-item>
32
+            <u-form-item label="是否入库" labelWidth="70">
33
+                <TabSelect :tabList="stockStatusList" :colNum="4" :echoInfo="formData.stockStatus" mode="single" @tabChange="handleTabChangeStockStatus"></TabSelect>
34
+            </u-form-item>
32 35
         </u--form>
33 36
         <view class="btns">
34 37
             <u-button text="重置" @click="resetForm"></u-button>
@@ -66,6 +69,7 @@ export default {
66 69
                 identifyingPerson:'',
67 70
                 identifyingPersonId: '',
68 71
                 productAttribute: [],
72
+                stockStatus: '',
69 73
             },
70 74
             recycleTimeDefault: new Date().getTime(),
71 75
             recycleTimeShow: false,
@@ -88,6 +92,21 @@ export default {
88 92
                     value: '4',
89 93
                 },
90 94
             ],
95
+            stockStatusList: [
96
+                {
97
+                    name: '全部',
98
+                    value: '',
99
+                },
100
+                {
101
+                    name: '待入库',
102
+                    value: '0',
103
+                },
104
+                {
105
+                    name: '已入库',
106
+                    value: '1',
107
+                },
108
+
109
+            ],
91 110
         }
92 111
     },
93 112
     props: {
@@ -110,7 +129,8 @@ export default {
110 129
                 recyclePersonId: '',
111 130
                 identifyingPerson:'',
112 131
                 identifyingPersonId: '',
113
-                productAttribute: '',
132
+                productAttribute: [],
133
+                stockStatus: '',
114 134
             };
115 135
             this.recycleTimeDefault = new Date().getTime();
116 136
         },
@@ -173,6 +193,9 @@ export default {
173 193
         handleTabChangeProductAttribute(e) {
174 194
             this.formData.productAttribute = e;
175 195
         },
196
+        handleTabChangeStockStatus(e) {
197
+            this.formData.stockStatus = e;
198
+        },
176 199
     }
177 200
 }
178 201
 </script>

BIN
pages/wareHouse/imgs/1.jpg


+ 31 - 13
pages/wareHouse/index.vue

@@ -59,7 +59,7 @@
59 59
 			</view>
60 60
 
61 61
 			<scroll-view class="goods-list" scroll-y @scrolltolower="handleLoadMore" enable-back-to-top>
62
-				<view @click="handleToDetail(goods)" class="goods-item" v-for="(goods, goodsIndex) in goodsList" :key="`goods-${goodsIndex}`">
62
+				<view @click="clickItem(goods)" class="goods-item" v-for="(goods, goodsIndex) in goodsList" :key="`goods-${goodsIndex}`">
63 63
 					<view class="goods-img-container">
64 64
 						<image class="goods-img" :src="goods.imgUrl ? goods.imgUrl : '/static/no-img.png'" mode="aspectFill" lazy-load></image>
65 65
 						<!-- <image class="goods-img" src="/static/no-img.png" mode="aspectFill" lazy-load></image> -->
@@ -100,28 +100,26 @@
100 100
 						</view> -->
101 101
 					</view>
102 102
 					<view class="more">
103
-						<view></view>
104
-						<!-- <u-icon name="more-dot-fill" size="16" color="#666666"></u-icon> -->
103
+						<u-icon name="more-dot-fill" size="16" color="#666666" @click="showMoreOptions(goods)"></u-icon>
105 104
 						<text class="goods-stock">数量:{{ goods.stock}}</text>
106 105
 					</view>
107 106
 				</view>
108
-				<show-emtry v-if="goodsList.length === 0"></show-emtry>
109 107
 			</scroll-view>
110
-			
111 108
 		</view>
112 109
 		<!-- 添加按钮 -->
113
-		<view class="add-button" @click="handleAdd">
110
+		<view class="add-button" @click="handleEdit">
114 111
 			<u-icon name="plus" size="36" color="#ffffff"></u-icon>
115 112
 		</view>
113
+		<!-- <moreInfo ref="moreInfoRef" :moreOptions="moreOptions"></moreInfo> -->
116 114
 	</view>
117
-	
118 115
 </template>
119
-
120 116
 <script>
121 117
 	import searchFilter from './components/searchFilter.vue'
118
+	import moreInfo from './components/moreInfo.vue'
122 119
 export default {
123 120
 	components: {
124 121
 		searchFilter,
122
+		moreInfo,
125 123
 	},
126 124
 	data() {
127 125
 		return {
@@ -188,13 +186,19 @@ export default {
188 186
 			]],
189 187
 			priceVisible:true,
190 188
 			searchPopShow:false,
191
-			total:0
189
+			total:0,
190
+			moreOptions:{},
191
+			moreOptionsShow:false,	
192 192
 		};
193 193
 	},
194 194
 	onLoad() {
195 195
 		this.getTypeList();
196 196
 	},
197 197
 	methods: {
198
+		showMoreOptions(goods){
199
+			this.moreOptions = goods;
200
+			this.$refs.moreInfoRef.showMoreInfo();
201
+		},
198 202
 		getTypeList(){
199 203
             this.$getDicts("crm_form_category").then(res => {
200 204
                 this.tabList = [...res]
@@ -250,15 +254,29 @@ export default {
250 254
 			this.type = item.dictValue;
251 255
 			this.handleSearch();
252 256
 		},
257
+		clickItem(item){
258
+			// 如果是待入库商品,点击后跳转到添加页面补全信息
259
+			if(item.stockStatus === '0'){
260
+				this.handleEdit(item)
261
+			}else{
262
+				this.handleToDetail(item);
263
+			}
264
+		},
253 265
 		handleToDetail(item) {
254 266
 			uni.navigateTo({
255 267
 				url: `/pages/wareHouse/components/detail?id=${item.id}`,
256 268
 			});
257 269
 		},
258
-		handleAdd() {
259
-			uni.navigateTo({
260
-				url: `/pages/wareHouse/components/add`
261
-			});
270
+		handleEdit(item) {
271
+			if(item.id){
272
+				uni.navigateTo({
273
+					url: `/pages/wareHouse/components/edit?formType=edit&id=${item.id}`
274
+				});
275
+			}else{
276
+				uni.navigateTo({
277
+					url: `/pages/wareHouse/components/edit?formType=add`
278
+				});
279
+			}
262 280
 		},
263 281
 		// 获取仓库卡片数据
264 282
 		getCard() {

+ 22 - 6
pages/wareHouse/styles/detail.scss

@@ -114,11 +114,15 @@
114 114
         right: 0;
115 115
         height: 120rpx;
116 116
         background-color: #fff;
117
-        display: flex;
118
-        align-items: center;
119
-        justify-content: space-around;
117
+        display: grid;
118
+        padding-right:10rpx;
120 119
         box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.1);
121
-        
120
+        &.fourPart{
121
+            grid-template-columns: 1fr 1fr 1fr 1fr;
122
+        }
123
+        &.fivePart{
124
+            grid-template-columns: 1fr 1fr 1fr 1.5fr 1fr;
125
+        }
122 126
         .bar_item{
123 127
             flex: 1;
124 128
             height: 100%;
@@ -133,14 +137,26 @@
133 137
                 gap: 8rpx;
134 138
                 padding: 14rpx 22rpx;
135 139
                 border-radius: 20rpx;
136
-                background-color: #ca8a04;
137
-                box-shadow: 0 10px 15px -3px #fef08a, 0 4px 6px -4px #fef08a;
140
+                height:46rpx;
138 141
                 .bar_text{
139 142
                     margin-top: 0;
140 143
                     color: #ffffff;
141 144
                     font-size: 23rpx;
142 145
                 }
143 146
             }
147
+            .orange{
148
+                background-color: #ca8a04;
149
+                box-shadow: 0 10px 15px -3px #fef08a, 0 4px 6px -4px #fef08a;
150
+            }
151
+
152
+            .blue{
153
+                background-color: #007bff;
154
+                box-shadow: 0 10px 15px -3px #93c5fd, 0 4px 6px -4px #93c5fd;
155
+                .bar_img{
156
+                    width: 34rpx;
157
+                    height: 40rpx;
158
+                }
159
+            }
144 160
             
145 161
             .bar_text{
146 162
                 margin-top: 8rpx;

+ 3 - 1
pages/wareHouse/styles/add.scss

@@ -32,12 +32,14 @@
32 32
     bottom: 0;
33 33
     padding: 20rpx;
34 34
     display: grid;
35
-    grid-template-columns: 1fr 1fr;
36 35
     gap: 10px;
37 36
     box-shadow: 0 4px 25px 2px rgba(0, 0, 0, 0.1);
38 37
     background: #fff;
39 38
     z-index: 1;
40 39
     width:fill-available;
40
+    &.col-2{
41
+        grid-template-columns: 1fr 1fr;
42
+    }
41 43
 }
42 44
 
43 45
 ::v-deep .u-form-item {

BIN
static/icons/stockIn.png


+ 2 - 2
store/modules/user.js

@@ -28,8 +28,8 @@ export default {
28 28
 		netConfig: {
29 29
 			// http://59.42.9.166:9520/proxy
30 30
 			// http://10.0.7.100:9500
31
-			ip: "https://crm.nanjingshiyu.com/prod-api", // ip
32
-			// ip: "https://crmtest.nanjingshiyu.com/prod-api", // 测试环境ip
31
+			// ip: "https://crm.nanjingshiyu.com/prod-api", // ip
32
+			ip: "https://crmtest.nanjingshiyu.com/prod-api", // 测试环境ip
33 33
 			// ip : "/api", // 测试环境ip
34 34
 			// ip : "http://47.113.184.101", // 测试环境ip
35 35
 			// ip: "http://172.16.7.200", // ip