Quellcode durchsuchen

feat(orderDetail): 添加入库选择功能和相关接口

在订单详情页面新增入库选择功能,用户可以选择是否将订单入库。根据选择,调用相应的新增或编辑仓库接口。同时,更新确认按钮文案以反映用户选择的状态。
Yannay vor 1 Monat
Ursprung
Commit
09ffacfd3e
2 geänderte Dateien mit 61 neuen und 3 gelöschten Zeilen
  1. 54 3
      pages/orderDetailRefactored/components/PageFour.vue
  2. 7 0
      utils/api.js

+ 54 - 3
pages/orderDetailRefactored/components/PageFour.vue

@@ -147,6 +147,21 @@
147
           </u-col>
147
           </u-col>
148
         </u-row>
148
         </u-row>
149
 
149
 
150
+        <!-- 是否入库 -->
151
+        <!-- <u-row class="info-row">
152
+          <u-col span="12">
153
+            <view @tap="selectIsWarehouse">
154
+              <u-form-item label="是否入库" prop="isWarehouse">
155
+                <view class="click-wrapper info-input">
156
+                  {{ isWarehouseLabel || '点击选择是否入库' }}
157
+                </view>
158
+              </u-form-item>
159
+              <u-picker :show="showIsWarehousePicker" :columns="isWarehouseColumns" confirm keyName="label"
160
+                @confirm="handleConfirmIsWarehouse" @cancel="showIsWarehousePicker = false" />
161
+            </view>
162
+          </u-col>
163
+        </u-row> -->
164
+
150
         <!-- 收单备注 -->
165
         <!-- 收单备注 -->
151
         <u-row class="info-row">
166
         <u-row class="info-row">
152
           <u-col span="12">
167
           <u-col span="12">
@@ -232,7 +247,8 @@
232
     <view class="confirm-button-container">
247
     <view class="confirm-button-container">
233
       <u-button class="next-btn" type="success" @click="confirmWarehouseEntry">
248
       <u-button class="next-btn" type="success" @click="confirmWarehouseEntry">
234
         <u-icon name="checkmark-circle-fill" size="28rpx" color="#fff" />
249
         <u-icon name="checkmark-circle-fill" size="28rpx" color="#fff" />
235
-        <text style="margin-left: 8rpx;">确认入库</text>
250
+        <text style="margin-left: 8rpx;" v-show="isWarehouse == '2'">确认收单</text>
251
+        <text style="margin-left: 8rpx;" v-show="isWarehouse == '1'">确认收单并入库</text>
236
       </u-button>
252
       </u-button>
237
     </view>
253
     </view>
238
 
254
 
@@ -309,7 +325,16 @@ export default {
309
         { label: '是', value: '1' },
325
         { label: '是', value: '1' },
310
         { label: '否', value: '2' }
326
         { label: '否', value: '2' }
311
       ]],
327
       ]],
312
-      currentEditItem: ''
328
+      currentEditItem: '',
329
+
330
+
331
+      isWarehouse: '2',
332
+      isWarehouseLabel: '不入库',
333
+      showIsWarehousePicker: false,
334
+      isWarehouseColumns: [[
335
+        { label: '确认入库', value: '1' },
336
+        { label: '不入库', value: '2' }
337
+      ]],
313
     }
338
     }
314
   },
339
   },
315
   computed: {
340
   computed: {
@@ -722,6 +747,24 @@ export default {
722
               // 上传分成数据
747
               // 上传分成数据
723
               await this.addShare()
748
               await this.addShare()
724
 
749
 
750
+              //新增仓库或者编辑仓库
751
+              //等于1的时候放入仓库表
752
+              if (this.isWarehouse == '1') {
753
+                //建立入库data
754
+                const warehouseData = {
755
+
756
+                }
757
+                if (!warehouseData.warehouseId) {
758
+                  //当没有仓库id的时候调用新增仓库接口
759
+                  await uni.$u.api.addWarehouse(warehouseData)
760
+                } else {
761
+                  //当有仓库id的时候调用编辑仓库接口
762
+                  await uni.$u.api.updateWarehouse(warehouseData)
763
+                }
764
+              } else if (this.isWarehouse == '2') {
765
+                //等于2的时候不放入仓库表
766
+              }
767
+
725
               this.$refs.uToast.show({
768
               this.$refs.uToast.show({
726
                 type: 'success',
769
                 type: 'success',
727
                 message: '入库成功',
770
                 message: '入库成功',
@@ -762,7 +805,15 @@ export default {
762
           await uni.$u.api.clueCommissionAdd(data)
805
           await uni.$u.api.clueCommissionAdd(data)
763
         }
806
         }
764
       }
807
       }
765
-    }
808
+    },
809
+    selectIsWarehouse() {
810
+      this.showIsWarehousePicker = true
811
+    },
812
+    handleConfirmIsWarehouse({ value }) {
813
+      this.isWarehouse = value[0].value
814
+      this.isWarehouseLabel = value[0].label
815
+      this.showIsWarehousePicker = false
816
+    },
766
   }
817
   }
767
 }
818
 }
768
 </script>
819
 </script>

+ 7 - 0
utils/api.js

@@ -128,6 +128,13 @@ const install = (Vue, vm) => {
128
 		// 删除订单分成数据
128
 		// 删除订单分成数据
129
 		deleteClueCommissionForm: (id, config = {}) => http.delete(store.state.user.path + '/clueCommissionForm/' + id),
129
 		deleteClueCommissionForm: (id, config = {}) => http.delete(store.state.user.path + '/clueCommissionForm/' + id),
130
 
130
 
131
+
132
+
133
+		//新增仓库接口
134
+		addWarehouse: (data) => http.post(store.state.user.path + '/wareHouse/wareHouseAdd', data), 
135
+		//编辑仓库接口
136
+		updateWarehouse: (data) => http.post(store.state.user.path + '/wareHouse/wareHouseUpdate', data), 
137
+
131
 	}
138
 	}
132
 }
139
 }
133
 
140