jufubao-admin-library 1.1.204 → 1.1.206

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -131,9 +131,20 @@
131
131
  <el-checkbox v-for="(item,index) in tagData" :label="item.value" :key="index">{{item.label}}</el-checkbox>
132
132
  </el-checkbox-group>
133
133
  </el-form-item>
134
- <el-form-item prop="spider_url" label="产品来源地址">
134
+ <div v-if="setForm.skus.length">
135
+ <el-table :data="setForm.skus" style="width: 100%" border>
136
+ <el-table-column prop="product_sku_name" label="规格名称" width="120"></el-table-column>
137
+ <el-table-column prop="spider_url" label="产品来源地址">
138
+ <template slot-scope="scope">
139
+ <el-input v-model="scope.row.spider_url" placeholder="请输入"></el-input>
140
+ </template>
141
+ </el-table-column>
142
+ </el-table>
143
+ </div>
144
+ <el-form-item v-else prop="spider_url" label="产品来源地址">
135
145
  <el-input v-model="setForm.spider_url" placeholder="请输入"></el-input>
136
146
  </el-form-item>
147
+
137
148
  </el-form>
138
149
  </xd-dialog>
139
150
  <xd-dialog :show.sync="showOpen" title="发票名称设置" width="600px" @onConfirm="handleOpenConfirm">
@@ -409,6 +420,7 @@ export default {
409
420
  this.setForm.partner_product_tags = info.data['entity']['partner_product_tags']
410
421
  this.setForm.public = info.data['entity']['is_public']
411
422
  this.setForm.spider_url = info.data['entity']['spider_url']
423
+ this.setForm.skus = info.data['entity']['skus']
412
424
  this.showPublicSet = true
413
425
  }
414
426
  //开票设置
@@ -860,6 +872,7 @@ export default {
860
872
  is_public: this.setForm.public,
861
873
  partner_product_tags:this.setForm.partner_product_tags,
862
874
  spider_url:this.setForm.spider_url,
875
+ skus: this.setForm.skus
863
876
  }
864
877
  }).then(res => {
865
878
  console.log(res)
@@ -159,6 +159,7 @@
159
159
  {"type": "normal", "prop": "volume", "align": "left", "min-width": 80, "label": "体积"},
160
160
  {"type": "normal", "prop": "product_code", "align": "left", "min-width": 80, "label": "商品编码"},
161
161
  {"type": "normal", "prop": "product_bar_code", "align": "left", "min-width": 80, "label": "商品条码"},
162
+ {"type": "normal", "prop": "spider_url", "align": "left", "min-width": 80, "label": "产品来源地址"},
162
163
  {
163
164
  type: "operate",
164
165
  align: "center",
@@ -190,7 +191,7 @@
190
191
  getTableDataFromResponseData(data = []) {
191
192
  let list = this.$xdHelper.cloneDeep(data);
192
193
  return list.map((item) => {
193
- let {specs, stocks, sku_uniq_id, standards,product_sku} = item;
194
+ let {specs, stocks, sku_uniq_id, standards,product_sku, spider_url} = item;
194
195
  let imgStandIndex = standards.findIndex((ss) => ss.image);
195
196
  if (imgStandIndex > -1) {
196
197
  let imgUrl = standards[imgStandIndex].image;
@@ -226,6 +227,7 @@
226
227
  sku_uniq_id,
227
228
  product_sku,
228
229
  standards,
230
+ spider_url
229
231
  };
230
232
  });
231
233
  },
@@ -256,6 +256,26 @@ module.exports = {
256
256
  role: '',
257
257
  method:'put'
258
258
  },
259
+ // #ifdef saas-admin sms-walking
260
+ {
261
+ title: '健步走:地图 - 修改点位周期限制',
262
+ mapFn: "walkingPointPeriodLimit",
263
+ // #ifdef saas-admin
264
+ path: '/saas-app-company/v1/walking/x_map/point-period-limit/:id',
265
+ // #endif
266
+ // #ifdef sms-walking
267
+ path: '/saas-app-partner/v1/walking/x_map/point-period-limit/:id',
268
+ // #endif
269
+ isRule: false,
270
+ data: {
271
+ id: ['点位ID', 'string', '必填'],
272
+ point_period_limit: ['点位周期限制', 'string', '必填'],
273
+ },
274
+ disabled: true,
275
+ role: '',
276
+ method: 'put'
277
+ },
278
+ // #endif
259
279
  {
260
280
  title: '健步走:地图 - 删除点位',
261
281
  mapFn: "walkingPointDelete",
@@ -37,6 +37,11 @@
37
37
  <span>到达点位颜色:</span>
38
38
  <el-color-picker v-model="color" size="small" @change="e => handleColorChange(e)"></el-color-picker>
39
39
  </div>
40
+ <div class="btn-item">
41
+ <el-tooltip content="在限制周期内未到达,即未完成也按未达到展示。" placement="top">
42
+ <span class="el-icon-question"></span>
43
+ </el-tooltip>
44
+ </div>
40
45
  </div>
41
46
  <div class="right">
42
47
  <el-button type="primary" round size="mini" @click="add">新增点位</el-button>
@@ -55,6 +60,19 @@
55
60
  >关闭辅助线</el-button>
56
61
  </div>
57
62
  </div>
63
+ <!-- #ifdef saas-admin sms-walking -->
64
+ <div>
65
+ <el-form ref="form" :model="form" label-width="120px">
66
+ <el-form-item label="点位周期限制" required prop="isCycle">
67
+ <el-radio-group v-model="form.isCycle" @input="handleCycleChange">
68
+ <el-radio label="Y">开启</el-radio>
69
+ <el-radio label="N">关闭</el-radio>
70
+ </el-radio-group>
71
+ <div style="color: red;">开启后,将限制在指定周期内到达点位才算完成</div>
72
+ </el-form-item>
73
+ </el-form>
74
+ </div>
75
+ <!-- #endif -->
58
76
  <div class="container" :style="containerObjet">
59
77
  <div class="content" id="content"></div>
60
78
  <div
@@ -86,6 +104,7 @@
86
104
  :circle-color="color"
87
105
  :site_id="siteId"
88
106
  :typeData="typeData"
107
+ :is-cycle="form.isCycle"
89
108
  @onDelete="handleItemDelete"
90
109
  @onSubmit="handleItemSubmit"
91
110
  v-model="item.model"
@@ -154,8 +173,12 @@ export default {
154
173
  yLeft:15.2,
155
174
  yHeight: 15.2,
156
175
  siteId:'',
157
- typeData:[],
158
-
176
+ typeData: [],
177
+ // #ifdef saas-admin sms-walking
178
+ form:{
179
+ isCycle:'',
180
+ }
181
+ // #endif
159
182
  };
160
183
  },
161
184
  computed:{
@@ -226,12 +249,16 @@ export default {
226
249
  'walkingPointColor',//点位颜色
227
250
  'walkingPointSize',//点位大小
228
251
  'walkingPointDelete',//删除点位
252
+ // #ifdef saas-admin sms-walking
253
+ 'walkingPointPeriodLimit',//点位周期限制
254
+ // #endif
229
255
  ]),
230
256
  getInfo(){
231
257
  let loading = Loading.service({});
232
258
  this.containerDone = false;
233
259
  Promise.all([this.getDetail(),this.getPointList()])
234
- .then(([info, list])=>{
260
+ .then(([info, list]) => {
261
+
235
262
  let backgroundImage = this.getImageFullPath(info['map_image_url'])
236
263
  let pointList = []
237
264
  list.map(item=>{
@@ -254,6 +281,7 @@ export default {
254
281
  this.color = info['map_point_color'] || '#3498db';
255
282
  this.noArriveColor = info['map_point_color_for_no_arrived'] || '#999999';
256
283
  this.name = info['map_name'];
284
+ this.form.isCycle = info['point_period_limit'];
257
285
  this.backgroundImage = backgroundImage;
258
286
  loading.close()
259
287
 
@@ -445,6 +473,22 @@ export default {
445
473
  this.$message.error('请至少设置一个点位!')
446
474
  return
447
475
  }
476
+
477
+ // 检查点位周期限制
478
+ if(this.form.isCycle === 'Y') {
479
+ let noPeriodPoints = [];
480
+ this.dataList.forEach(item => {
481
+ if(!item.model.period_start_time || !item.model.period_end_time) {
482
+ noPeriodPoints.push(`点位${item.model.point_total_mileage + 1}`);
483
+ }
484
+ });
485
+
486
+ if(noPeriodPoints.length > 0) {
487
+ this.$message.error(`${noPeriodPoints.join('、')}完成周期需设置`);
488
+ return;
489
+ }
490
+ }
491
+
448
492
  // let params = this.getDoneParams();
449
493
  let params = {
450
494
  // #ifdef admin
@@ -472,6 +516,19 @@ export default {
472
516
 
473
517
  //获取完成参数
474
518
  getDoneParams(){},
519
+ // #ifdef saas-admin sms-walking
520
+ // 处理周期限制切换
521
+ handleCycleChange(value) {
522
+ this.walkingPointPeriodLimit({
523
+ id: this.map_id,
524
+ point_period_limit: value
525
+ }).then(res => {
526
+ this.$message.success('点位周期限制设置成功')
527
+ }).catch(err => {
528
+ console.log(err, 'err')
529
+ })
530
+ },
531
+ // #endif
475
532
 
476
533
  //半径改变
477
534
  handleRadiusChange(e){
@@ -35,6 +35,7 @@
35
35
  :show.sync="dialogShow"
36
36
  :is-move="true"
37
37
  :is-btn="false"
38
+ width="1000px"
38
39
  >
39
40
  <xd-base-dynamic-field
40
41
  :list="formList"
@@ -122,6 +123,10 @@ export default {
122
123
  return []
123
124
  }
124
125
  },
126
+ isCycle: {
127
+ type: String,
128
+ default: 'N'
129
+ },
125
130
  },
126
131
  data(){
127
132
  return {
@@ -197,7 +202,16 @@ export default {
197
202
  }
198
203
  }
199
204
  }
205
+ },
206
+ // #ifdef saas-admin sms-walking
207
+ isCycle: {
208
+ handler(n,o){
209
+ if(n&&n!==o){
210
+ this.initForm(Object.assign({},this.orgFormValue,this.formValue))
211
+ }
212
+ }
200
213
  }
214
+ // #endif
201
215
  },
202
216
  computed: {
203
217
  styleObject() {
@@ -217,8 +231,8 @@ export default {
217
231
  },
218
232
  orgFormValue(){
219
233
  let point_position = this.item.point_position;
220
- if(typeof point_position === 'string') point_position = JSON.parse(this.item.point_position);
221
- return {
234
+ if(typeof point_position === 'string') point_position = JSON.parse(point_position);
235
+ let formValue = {
222
236
  ...this.item,
223
237
  point_image_url: {
224
238
  url: this.item.point_image_url
@@ -227,7 +241,14 @@ export default {
227
241
  // #ifdef sms-walking saas-admin
228
242
  sms_activity_list:[{label:this.item.sms_activity_name,value:this.item.sms_activity_id}]
229
243
  // #endif
244
+ };
245
+ // 处理完成周期
246
+ if (this.item.period_start_time && this.item.period_end_time) {
247
+ // 反显时将秒转换为毫秒
248
+ formValue.period_start_time = parseInt(this.item.period_start_time) * 1000;
249
+ formValue.period_end_time = parseInt(this.item.period_end_time) * 1000;
230
250
  }
251
+ return formValue;
231
252
  },
232
253
  },
233
254
  created(){
@@ -539,6 +560,22 @@ export default {
539
560
  notice: '单位:里,2里=1公里',
540
561
  inline: true
541
562
  },
563
+ // #ifdef saas-admin sms-walking
564
+ this.isCycle === 'Y' && {
565
+ label: '完成周期:',
566
+ ele: 'xd-date-range',
567
+ valueKey: ['period_start_time', 'period_end_time'],
568
+ value: params['period_start_time']?[params['period_start_time'],params['period_end_time']]:[],
569
+ placeholder: ['开始日期', '结束日期'],
570
+ className: 'input40',
571
+ format: 'yyyy/MM/dd HH:mm:ss',//时间显示格式
572
+ formatValue: 'timestamp', //输出时间格式
573
+ notice: '在周期内兑换的步数才算有效兑换,超过结束时间未达到点位,则算未完成',
574
+ rules: [
575
+ {required: true, message: '请选择完成周期', trigger: 'change'},
576
+ ]
577
+ },
578
+ // #endif
542
579
  {
543
580
  label: '点位知识:',
544
581
  ele: 'xd-tinymce',
@@ -581,12 +618,36 @@ export default {
581
618
  y: this.changeOffsetY || this.defaultValue.y,
582
619
  }
583
620
  if(isString) point_position = JSON.stringify(point_position);
621
+ let period_start_time = '';
622
+ let period_end_time = '';
623
+
624
+ if (this.formValue.period_start_time) {
625
+ // 提交时将毫秒转换为秒
626
+ period_start_time = Math.floor(this.formValue.period_start_time / 1000);
627
+ } else if (this.orgFormValue.period_start_time) {
628
+ // 提交时将毫秒转换为秒
629
+ period_start_time = Math.floor(this.orgFormValue.period_start_time / 1000);
630
+ }
631
+
632
+ if (this.formValue.period_end_time) {
633
+ // 提交时将毫秒转换为秒
634
+ period_end_time = Math.floor(this.formValue.period_end_time / 1000);
635
+ } else if (this.orgFormValue.period_end_time) {
636
+ // 提交时将毫秒转换为秒
637
+ period_end_time = Math.floor(this.orgFormValue.period_end_time / 1000);
638
+ }
639
+
584
640
  let params = {
585
641
  point_image_url: type==='normal'?this.formValue.point_image_url.url || this.orgFormValue.point_image_url.url:this.orgFormValue.point_image_url.url,
586
642
  point_knowledge: type==='normal'?this.formValue.point_knowledge || this.orgFormValue.point_knowledge:this.orgFormValue.point_knowledge,
587
643
  point_name: type==='normal'?this.formValue.point_name || this.orgFormValue.point_name:this.orgFormValue.point_name,
588
644
  point_total_mileage: type==='normal'?Number( this.formValue.point_total_mileage || this.orgFormValue.point_total_mileage):Number(this.orgFormValue.point_total_mileage),
589
645
  point_position:point_position,
646
+ // 只有当 isCycle 为 Y 时,才提交周期相关字段
647
+ ...(this.isCycle === 'Y' && {
648
+ period_start_time: period_start_time,
649
+ period_end_time: period_end_time,
650
+ }),
590
651
  // #ifdef sms-walking saas-admin
591
652
  sms_activity_type: type==='normal'?this.formValue.sms_activity_type || this.orgFormValue.sms_activity_type:this.orgFormValue.sms_activity_type,
592
653
  sms_activity_id: type==='normal'?(this.formValue.sms_activity_list&&this.formValue.sms_activity_list.length)?this.formValue.sms_activity_list[0]['value']:'':this.orgFormValue.sms_activity_list[0]['value'],
@@ -132,6 +132,26 @@
132
132
  ></xd-pagination-jfb>
133
133
  </div>
134
134
  </el-card>
135
+ <xd-dialog
136
+ :title="stockTitle"
137
+ v-if="showStockDialog"
138
+ :show.sync="showStockDialog"
139
+ width="500px"
140
+ @onCancel="handleCancelStock"
141
+ @onConfirm="handleConfirmStock"
142
+ >
143
+ <el-form ref="stockForm" :model="stockForm" :rules="stockRules" label-width="120px">
144
+ <el-form-item label="秒杀库存数量:" prop="total_stock">
145
+ <el-input
146
+ v-model="stockForm.total_stock"
147
+ placeholder="请输入秒杀库存数量"
148
+ type="number"
149
+ min="0"
150
+ max="99999"
151
+ ></el-input>
152
+ </el-form-item>
153
+ </el-form>
154
+ </xd-dialog>
135
155
  </div>
136
156
  </template>
137
157
 
@@ -194,7 +214,7 @@ export default {
194
214
  lazy: true,
195
215
  lazyLoad(node, resolve) {
196
216
  getOptions({
197
- server: "product-partner",
217
+ server: 'product-partner',
198
218
  fn: "categories",
199
219
  path: "p4",
200
220
  params: {
@@ -310,6 +330,35 @@ export default {
310
330
  ],
311
331
  searchOtherForm: {},
312
332
  cityData: [],
333
+ stockTitle: "",
334
+ showStockDialog: false,
335
+ stockForm: {
336
+ total_stock: '',
337
+ },
338
+ stockRules: {
339
+ total_stock: [
340
+ { required: true, message: '请输入秒杀库存数量', trigger: 'blur' },
341
+ {
342
+ validator: (rule, value, callback) => {
343
+ const num = Number(value);
344
+ if (value === '' || value === null || value === undefined) {
345
+ callback(new Error('请输入秒杀库存数量'));
346
+ } else if (isNaN(num)) {
347
+ callback(new Error('请输入有效的数字'));
348
+ } else if (num < 0) {
349
+ callback(new Error('库存数量不能小于0'));
350
+ } else if (num > 99999) {
351
+ callback(new Error('库存数量不能超过99999'));
352
+ } else {
353
+ callback();
354
+ }
355
+ },
356
+ trigger: 'blur'
357
+ }
358
+ ]
359
+ },
360
+ stock_type: "",
361
+ selectProductIds: [], // 当前选中的商品ID列表(单个或批量)
313
362
  };
314
363
  },
315
364
  computed: {
@@ -364,7 +413,7 @@ export default {
364
413
  let cityData = await this.getAllCityList();
365
414
  this.cityData = cityData.data.list;
366
415
  await getOptions({
367
- server: "supplier-partner",
416
+ server: 'supplier-partner',
368
417
  fn: "supplier-channel",
369
418
  path: "p1",
370
419
  params: {
@@ -387,6 +436,11 @@ export default {
387
436
  console.log(setting,'ssss')
388
437
  this.initSearchForm();
389
438
  await this.getList();
439
+ this.activityGet({
440
+ activity_id: this.activity_id
441
+ }).then(res => {
442
+ this.stock_type = res.data.stock_type;
443
+ })
390
444
  },
391
445
 
392
446
  methods: {
@@ -397,6 +451,7 @@ export default {
397
451
  "getActivityCodeCount",
398
452
  "getPolicyListSetting"
399
453
  ]),
454
+ ...mapActions("flashsale", ["updateStock", "activityGet"]),
400
455
 
401
456
  /**
402
457
  * @description 按钮操作
@@ -406,33 +461,109 @@ export default {
406
461
  */
407
462
  handleTableClick(row, value, idx) {
408
463
  if (value.event === "add") {
464
+ // stock_type === '0' 表示不限库存,直接添加不弹框
465
+ if (this.stock_type === '0') {
466
+ let data = {
467
+ session_id: this.session_id,
468
+ product_ids: [row.product_id], // 单个商品也包裹成数组
469
+ };
470
+ const loading = Loading.service({});
471
+ this.batchSessionAddProduct(data)
472
+ .then((res) => {
473
+ loading.close();
474
+ this.$message.success("添加成功");
475
+ this.getList();
476
+ })
477
+ .catch((err) => {
478
+ loading.close();
479
+ console.log(err, "err");
480
+ });
481
+ } else {
482
+ // 需要设置库存,显示弹框
483
+ this.stockTitle = "请配置商品限购库存";
484
+ this.stockForm = {
485
+ total_stock: '',
486
+ };
487
+ this.selectProductIds = [row.product_id]; // 单个商品也包裹成数组
488
+ this.showStockDialog = true;
489
+ }
490
+ }
491
+ },
492
+ handleBatchadd() {
493
+ // stock_type === '0' 表示不限库存,直接添加不弹框
494
+ if (this.stock_type === '0') {
409
495
  let data = {
410
496
  session_id: this.session_id,
411
- product_id: row.product_id,
497
+ product_ids: this.selectList,
412
498
  };
413
- this.sessionAddProduct(data)
499
+ const loading = Loading.service({});
500
+ this.batchSessionAddProduct(data)
414
501
  .then((res) => {
502
+ loading.close();
415
503
  this.$message.success("添加成功");
416
504
  this.getList();
417
505
  })
418
506
  .catch((err) => {
507
+ loading.close();
419
508
  console.log(err, "err");
420
509
  });
510
+ } else {
511
+ // 需要设置库存,显示弹框
512
+ this.stockTitle = "请配置商品限购库存";
513
+ this.stockForm = {
514
+ total_stock: '',
515
+ };
516
+ this.selectProductIds = this.selectList;
517
+ this.showStockDialog = true;
421
518
  }
422
519
  },
423
- handleBatchadd() {
424
- let data = {
425
- session_id: this.session_id,
426
- product_ids: this.selectList,
427
- };
428
- this.batchSessionAddProduct(data)
429
- .then((res) => {
430
- this.$message.success("添加成功");
431
- this.getList();
432
- })
433
- .catch((err) => {
434
- console.log(err, "err");
435
- });
520
+ /**
521
+ * @description 取消设置库存
522
+ */
523
+ handleCancelStock() {
524
+ this.showStockDialog = false;
525
+ },
526
+ /**
527
+ * @description 确认设置库存并添加商品
528
+ */
529
+ handleConfirmStock() {
530
+ this.$refs.stockForm.validate((valid) => {
531
+ if (valid) {
532
+ const totalStock = Number(this.stockForm.total_stock);
533
+ const loading = Loading.service({});
534
+ this.batchSessionAddProduct({
535
+ session_id: this.session_id,
536
+ product_ids: this.selectProductIds,
537
+ }).then((res) => {
538
+ // 设置库存
539
+ if (totalStock > 0) {
540
+ this.updateStock({
541
+ session_id: this.session_id,
542
+ product_ids: this.selectProductIds,
543
+ total_stock: totalStock,
544
+ }).then(() => {
545
+ loading.close();
546
+ this.$message.success("添加并设置库存成功");
547
+ this.showStockDialog = false;
548
+ this.getList();
549
+ }).catch((err) => {
550
+ loading.close();
551
+ console.log(err, "库存设置失败");
552
+ this.showStockDialog = false;
553
+ this.getList();
554
+ });
555
+ } else {
556
+ loading.close();
557
+ this.$message.success("添加成功");
558
+ this.showStockDialog = false;
559
+ this.getList();
560
+ }
561
+ }).catch((err) => {
562
+ loading.close();
563
+ console.log(err, "err");
564
+ });
565
+ }
566
+ });
436
567
  },
437
568
  /**
438
569
  * @description 点击搜索进行搜索操作
@@ -568,7 +699,7 @@ export default {
568
699
  console.log("remoteSearch", query, resolve);
569
700
  // $vm.handleRemoteSearch(query, resolve)
570
701
  getOptions({
571
- server: "supplier-partner",
702
+ server: 'supplier-partner',
572
703
  fn: "brand",
573
704
  path: "p1",
574
705
  params: {
@@ -639,7 +770,7 @@ export default {
639
770
  handleRemoteSearch({ query }, resolve) {
640
771
  console.log("handleRemoteSearch", query, resolve);
641
772
  getOptions({
642
- server: "supplier-partner",
773
+ server: 'supplier-partner',
643
774
  fn: "supplier",
644
775
  path: "p1",
645
776
  params: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jufubao-admin-library",
3
- "version": "1.1.204",
3
+ "version": "1.1.206",
4
4
  "description": "聚福宝福利后台管理系统公共模块",
5
5
  "author": "goashiyong <gaoshiyong1272@vip.163.com>",
6
6
  "scripts": {