Ver código fonte

Merge branch 'master' of http://106.52.242.177:3000/askqvn/crm-app into priceCenter

zhangxin 1 mês atrás
pai
commit
48ce027531
2 arquivos alterados com 128 adições e 3 exclusões
  1. 121 3
      pages/orderDetailRefactored/components/PageFour.vue
  2. 7 0
      utils/api.js

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

@@ -147,6 +147,21 @@
147 147
           </u-col>
148 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 166
         <u-row class="info-row">
152 167
           <u-col span="12">
@@ -232,7 +247,8 @@
232 247
     <view class="confirm-button-container">
233 248
       <u-button class="next-btn" type="success" @click="confirmWarehouseEntry">
234 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 252
       </u-button>
237 253
     </view>
238 254
 
@@ -250,6 +266,7 @@
250 266
 
251 267
 <script>
252 268
 import imageUpload from '../utils/imageUpload.js'
269
+import dayjs from 'dayjs'
253 270
 
254 271
 export default {
255 272
   name: 'PageFour',
@@ -309,7 +326,17 @@ export default {
309 326
         { label: '是', value: '1' },
310 327
         { label: '否', value: '2' }
311 328
       ]],
312
-      currentEditItem: ''
329
+      currentEditItem: '',
330
+
331
+
332
+      isWarehouse: '2',
333
+      isWarehouseLabel: '不入库',
334
+      showIsWarehousePicker: false,
335
+      isWarehouseColumns: [[
336
+        { label: '确认入库', value: '1' },
337
+        { label: '不入库', value: '2' }
338
+      ]],
339
+      brandList: []
313 340
     }
314 341
   },
315 342
   computed: {
@@ -345,9 +372,22 @@ export default {
345 372
   },
346 373
   mounted() {
347 374
     this.loadCommissionUserList()
375
+    this.loadBrandList()
348 376
   },
349 377
   methods: {
350 378
     /**
379
+     * 加载品牌列表
380
+     */
381
+    async loadBrandList() {
382
+      try {
383
+        const res = await this.$getDicts('crm_form_brand')
384
+        this.brandList = res
385
+      } catch (error) {
386
+        console.error('加载品牌列表失败:', error)
387
+      }
388
+    },
389
+
390
+    /**
351 391
      * 初始化入库信息
352 392
      */
353 393
     initWarehouseInfo(data) {
@@ -722,6 +762,76 @@ export default {
722 762
               // 上传分成数据
723 763
               await this.addShare()
724 764
 
765
+              //新增仓库或者编辑仓库
766
+              //等于1的时候放入仓库表
767
+              if (this.isWarehouse == '1') {
768
+                // 获取品牌ID
769
+                const brandObj = this.brandList.find(item => item.dictLabel === this.currentReceipt.brand)
770
+                const brandId = brandObj ? brandObj.dictValue : ''
771
+
772
+                //建立入库data
773
+                const warehouseData = {
774
+                  // goodPicFileList: [''],//商品图片 必填
775
+                  // desc: '',//商品描述 必填  
776
+                  type: this.warehouseInfo.category || '',//商品分类 
777
+                  dictLabel: this.currentReceipt.brand || '',//品牌名称 必填
778
+                  dictValue: brandId || '',//品牌id 必填
779
+                  // series: '',//系列
780
+                  // model: this.warehouseInfo.model||'',//型号
781
+                  // dialType: '',//机芯类型
782
+                  // caseMaterial: '',//表壳材质
783
+                  // dialDiameter: '',//表盘直径
784
+                  // material: '',//材质
785
+                  // size: '',//尺寸
786
+                  // yardage: '',//尺码
787
+                  // price: '',//官方指导价
788
+                  // productCondition: '',//商品成色 必填 1-闲置未使用 2-二手 
789
+                  // detailPicFileList: [''],//细节图片
790
+                  // title: '',//商品标题
791
+                  // productNo: '',//商品货号
792
+                  // productAttribute: '1',//商品属性 必填 1-自有商品 2-寄卖商品 3-质押商品 4-其它
793
+                  // stock: '',//库存数量 必填
794
+                  costPrice: this.computedTotalCost || '',//总成本价
795
+                  // peerPrice: '',//同行价格
796
+                  // agentPrice: '',//代理价格
797
+                  // salePrice: '',//销售价格
798
+                  // productPosition: '',//商品位置
799
+                  // watchYear: '',//手表年份
800
+                  // identifyingPerson: '',//鉴定人员
801
+                  // identifyingPersonId: '',//鉴定人员id
802
+                  // recycleType: '1',//回收类型 1-线上 2-同行 3-门店 4-其它
803
+                  // label: '1', 1-完美 2-普通 3-瑕疵 4-假货 5-亏损
804
+                  // recyclePerson: '',//回收人员
805
+                  // recyclePersonId: '',//回收人员id
806
+                  // recycleBottomDesc: '',//回收留底图描述
807
+                  // recycleBottomFileList: [' '],//回收留底图
808
+                  recycleTime: dayjs().format('YYYY-MM-DD'),//回收时间 必填
809
+                  // indentifyCode: '',//独立编码
810
+                  // targetAudience: 'general',// general-通用 man-男 woman-女
811
+                  // productCard: '',//商品保卡 has-有 no-无
812
+                  // cardYear: '',//保卡年份 如果有商品保卡就有这个字段,如果没有商品保卡,这个字段为空
813
+                  // productCardPicFileList: [''],//商品保卡图片留底
814
+                  // productTag: '',//商品标签  
815
+                  // productAttachment: '',//商品附件
816
+                  // productDesc: '',//商品备注
817
+                  // productDescPicFileList: [''],//商品备注图片
818
+                  // payType: '1',//付款方式 1:微信 2:支付宝 3:银行卡 4:现金 5:数字货币 6:挂账
819
+                  // submitType: 'inAndUp',//提交类型 onlyIn:仅入库 inAndUp:入库并上架
820
+                  // continuousWarehousing: '0',//是否连续入库 1:是 0:否
821
+
822
+                }
823
+                if (!this.currentReceipt.warehouseId) {
824
+                  //当没有仓库id的时候调用新增仓库接口
825
+                  await uni.$u.api.addWarehouse(warehouseData)
826
+                } else {
827
+                  //当有仓库id的时候调用编辑仓库接口
828
+                  warehouseData.id = this.currentReceipt.warehouseId
829
+                  await uni.$u.api.updateWarehouse(warehouseData)
830
+                }
831
+              } else if (this.isWarehouse == '2') {
832
+                //等于2的时候不放入仓库表
833
+              }
834
+
725 835
               this.$refs.uToast.show({
726 836
                 type: 'success',
727 837
                 message: '入库成功',
@@ -762,7 +872,15 @@ export default {
762 872
           await uni.$u.api.clueCommissionAdd(data)
763 873
         }
764 874
       }
765
-    }
875
+    },
876
+    selectIsWarehouse() {
877
+      this.showIsWarehousePicker = true
878
+    },
879
+    handleConfirmIsWarehouse({ value }) {
880
+      this.isWarehouse = value[0].value
881
+      this.isWarehouseLabel = value[0].label
882
+      this.showIsWarehousePicker = false
883
+    },
766 884
   }
767 885
 }
768 886
 </script>

+ 7 - 0
utils/api.js

@@ -144,6 +144,13 @@ const install = (Vue, vm) => {
144 144
 		// 删除订单分成数据
145 145
 		deleteClueCommissionForm: (id, config = {}) => http.delete(store.state.user.path + '/clueCommissionForm/' + id),
146 146
 
147
+
148
+
149
+		//新增仓库接口
150
+		addWarehouse: (data) => http.post(store.state.user.path + '/wareHouse/wareHouseAdd', data), 
151
+		//编辑仓库接口
152
+		updateWarehouse: (data) => http.post(store.state.user.path + '/wareHouse/wareHouseUpdate', data), 
153
+
147 154
 	}
148 155
 }
149 156