ci-plus 1.7.1 → 1.7.2

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ci-plus",
3
- "version": "1.7.1",
3
+ "version": "1.7.2",
4
4
  "description": "ci组件库",
5
5
  "main": "./index.ts",
6
6
  "scripts": {
@@ -2,9 +2,9 @@
2
2
  * @module identificationCard
3
3
  * @author : 卖女孩的小火柴
4
4
  * ?description : 11月22日开会重新更新成品工厂标识卡
5
- * !@version : 1.6.1
5
+ * !@version : 1.6.2
6
6
  * TODO:@since : 创建时间 2024-11-23 09:40:30
7
- * !update : 2025-01-09 处理责废标识卡r12行字段写错问题
7
+ * !update : 2025-01-14 调整装配标识卡模板
8
8
  */ -->
9
9
  <template>
10
10
  <div style="display: flex; flex-direction: column; height: 100%">
@@ -1147,15 +1147,15 @@
1147
1147
  {{ item.r5c4 }}
1148
1148
  </td>
1149
1149
  </tr>
1150
- <tr>
1151
- <!-- 外圈编码 内圈编码 -->
1150
+ <tr v-if="item.r6c2">
1151
+ <!-- 外圈编码 外圈批号 -->
1152
1152
  <td>{{ item.r6c1 }}</td>
1153
1153
  <td>{{ item.r6c2 }}</td>
1154
1154
  <td>{{ item.r6c3 }}</td>
1155
1155
  <td>{{ item.r6c4 }}</td>
1156
1156
  </tr>
1157
- <tr>
1158
- <!-- 外圈批号 内圈批号 -->
1157
+ <tr v-if="item.r7c2">
1158
+ <!-- 内圈编码 内圈批号 -->
1159
1159
  <td>{{ item.r7c1 }}</td>
1160
1160
  <td>{{ item.r7c2 }}</td>
1161
1161
  <td>{{ item.r7c3 }}</td>
@@ -2,9 +2,9 @@
2
2
  * @module cardPrint
3
3
  * @author : 卖女孩的小火柴
4
4
  * ?description : 11月22日开会重新更新成品工厂标识卡
5
- * !@version : 1.6.0
5
+ * !@version : 1.6.1
6
6
  * TODO:@since : 创建时间 2024-11-23 09:40:30
7
- * !update : 2024-11.30 更新检验员检验日期检验结果取值逻辑
7
+ * !update : 2025-01-14 调整装配标识卡模板
8
8
  */
9
9
 
10
10
  import { ElMessage, MessageParamsWithType } from 'element-plus'
@@ -606,10 +606,20 @@ export const cardPrint = (cParams: any, callback: (data: any) => void, baseUrl?:
606
606
  label: string
607
607
  value: string
608
608
  }[] = []
609
+ // 套圈的编码和批号数组
610
+ let tqList: {
611
+ id: number | string
612
+ label: string
613
+ value: string
614
+ }[] = []
615
+
609
616
  let nqbm = '' // 内圈编码
610
617
  let nqph = '' // 内圈批号
611
618
  let wqbm = '' // 内圈编码
612
619
  let wqph = '' // 内圈批号
620
+
621
+ let tqbm = '' // 内圈编码
622
+ let tqph = '' // 内圈批号
613
623
  if (item.children && badNum > 0) {
614
624
  item.children?.forEach((badItem: any) => {
615
625
  let objbad = { id: '', label: '', value: '' }
@@ -619,6 +629,23 @@ export const cardPrint = (cParams: any, callback: (data: any) => void, baseUrl?:
619
629
  } else if (badItem.category == '外圈') {
620
630
  wqbm = badItem.material_code || ''
621
631
  wqph = badItem.b2b_batch_number || ''
632
+ } else if (badItem.category == '套圈') {
633
+ tqbm = badItem.material_code || ''
634
+ tqph = badItem.b2b_batch_number || ''
635
+ let tqbmobj = {
636
+ id: badItem.card_code + 'bm',
637
+ label: badItem.category + '编码',
638
+ value: tqbm
639
+ }
640
+ let tqphobj = {
641
+ id: badItem.card_code + 'ph',
642
+ label: badItem.category + '批号',
643
+ value: tqph
644
+ }
645
+ if (badItem.category) {
646
+ tqList.push(tqbmobj)
647
+ tqList.push(tqphobj)
648
+ }
622
649
  } else {
623
650
  objbad = {
624
651
  id: badItem.card_code,
@@ -631,7 +658,6 @@ export const cardPrint = (cParams: any, callback: (data: any) => void, baseUrl?:
631
658
  }
632
659
  })
633
660
  }
634
-
635
661
  let obj1 = {
636
662
  card_state: item.card_state,
637
663
  // 工厂类型:1:为尚工厂 | 2:成品工厂
@@ -651,31 +677,55 @@ export const cardPrint = (cParams: any, callback: (data: any) => void, baseUrl?:
651
677
  r5c4: item.card_code, // 标识卡号
652
678
  r6c1: '外圈编码',
653
679
  r6c2: wqbm,
654
- r6c3: '内圈编码',
655
- r6c4: nqbm,
656
- r7c1: '外圈批号',
657
- r7c2: wqph,
680
+ r6c3: '外圈批号',
681
+ r6c4: wqph,
682
+ r7c1: '内圈编码',
683
+ r7c2: nqbm,
658
684
  r7c3: '内圈批号',
659
685
  r7c4: nqph
660
686
  }
687
+
661
688
  // 获取obj1最后一条属性的行号列号
662
689
  // 获取obj1最后一条属性
663
690
  let lastKey = Object.keys(obj1)[Object.keys(obj1).length - 1]
691
+ console.log('%c Line:691 🎂 lastKey', 'color:#ffdd4d', lastKey)
664
692
  // 获取行号
665
693
  let row = Number(parseInt(lastKey.split('r')[1].split('c')[0]))
666
694
  // 获取列号
667
695
  let column = Number(lastKey.split('c')[1])
668
696
 
669
- // 通过循环badList数组,将数组中的每一项合并到obj中
670
- let obj2 = {}
697
+ //-------
698
+ // 通过循环 tqList 数组,将数组中的每一项合并到obj中
699
+ console.log('%c Line:699 🍰 套圈数组', 'color:#ed9ec7', tqList)
700
+ let obj4: any = {}
701
+ for (let i = 0; i < tqList.length; i++) {
702
+ const item = tqList[i]
703
+ console.log('%c Line:703 🌰 item', 'color:#ffdd4d', item)
704
+ const rowIndex = Math.floor(i / 2) + (row + 1) // 从r8c1开始这里就是8
705
+ const columnIndex = (i % 2) * 2 + 1
706
+ obj4[`r${rowIndex}c${columnIndex}`] = item.label
707
+ obj4[`r${rowIndex}c${columnIndex + 1}`] = item.value
708
+ }
709
+ console.log('%c Line:709 🌭 obj4', 'color:#42b983', obj4)
710
+ //-------
711
+
712
+ // 获取obj4最后一条属性
713
+ let lastKey4 = Object.keys(obj4)[Object.keys(obj4).length - 1]
714
+ console.log('%c Line:714 🍻 lastKey4', 'color:#6ec1c2', lastKey4)
715
+ // 获取行号
716
+ let row4 = Number(parseInt(lastKey4.split('r')[1].split('c')[0]))
717
+
718
+ // 通过循环 badList 数组,将数组中的每一项合并到obj中
719
+ let obj2: any = {}
671
720
  for (let i = 0; i < badList.length; i++) {
672
721
  const item = badList[i]
673
- const rowIndex = Math.floor(i / 2) + (row + 1) // 从r8c1开始这里就是8
722
+ const rowIndex = Math.floor(i / 2) + (row4 + 1) // 从r8c1开始这里就是8
674
723
  const columnIndex = (i % 2) * 2 + 1
675
724
  obj2[`r${rowIndex}c${columnIndex}`] = item.label
676
725
  obj2[`r${rowIndex}c${columnIndex + 1}`] = item.value
677
726
  // 页面中只渲染到了 r20c4
678
727
  }
728
+ console.log('%c Line:728 🥓 obj2', 'color:#465975', obj2)
679
729
  let obj3 = {
680
730
  r50c1: '本箱数量',
681
731
  r50c2: item.current_inventory,
@@ -701,7 +751,7 @@ export const cardPrint = (cParams: any, callback: (data: any) => void, baseUrl?:
701
751
  r55c2: item.remark
702
752
  }
703
753
  // 将 obj1, obj2, obj3 合并到obj的后面
704
- Object.assign(obj, obj1, obj2, obj3)
754
+ Object.assign(obj, obj1, obj4, obj2, obj3)
705
755
  }
706
756
  // 为尚工厂-装配标识卡(为尚工厂无装配标识卡)
707
757
  else if (item.card_state == 'ZHUANGPEI' && item.is_finished_goods == 1) {