|
|
@@ -249,6 +249,14 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <view class="pt-16 pb-16 info-border-bottom" v-if="form?.baseRef?.baseInfo?.landList.length">
|
|
|
+ <view class="c-#666 f-s-30 mb-20">具体位置:</view>
|
|
|
+ <view class="p-rtv pd-24 b-radius mb-10" v-for="(it, indexs) in form?.baseRef?.baseInfo?.landList" :key="indexs" style="border: 1px solid #afddbb">
|
|
|
+ <view class="c-#333 f-s-34 f-w-5">{{ it?.landName }}</view>
|
|
|
+ <view class="c-#666 f-s-24">{{ stringifyCheckedList(it?.checkedList, Number(it?.capacityAmount || 0)) }}</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
<view class="pt-16 pb-16 info-border-bottom">
|
|
|
<text class="c-#666 f-s-30">溯源级别:</text>
|
|
|
<text class="c-#333 f-s-30 f-w-5">{{ form.mgMethod ? selectDictLabel(pt_mg_method, form.mgMethod) : '--' }}</text>
|
|
|
@@ -466,6 +474,56 @@ const getInfo = async () => {
|
|
|
const handlechoseConfirm = () => {
|
|
|
uni.$u.route({ type: 'navigateTo', url: '/plant/port/port-create/index', params: { taskId: taskId.value } });
|
|
|
};
|
|
|
+const stringifyCheckedList = (list: CheckedPosition[], perLayerCount: number) => {
|
|
|
+ if (!Array.isArray(list) || !list.length) {
|
|
|
+ return '';
|
|
|
+ }
|
|
|
+ const capacity = Number(perLayerCount || 0);
|
|
|
+ if (!capacity) {
|
|
|
+ return '';
|
|
|
+ }
|
|
|
+
|
|
|
+ const serialMap = new Map<number, CheckedPosition>();
|
|
|
+ list.forEach((item) => {
|
|
|
+ const serial = (item.x - 1) * capacity + item.y;
|
|
|
+ if (serial > 0 && !serialMap.has(serial)) {
|
|
|
+ serialMap.set(serial, item);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ const serials = Array.from(serialMap.keys()).sort((a, b) => a - b);
|
|
|
+ if (!serials.length) {
|
|
|
+ return '';
|
|
|
+ }
|
|
|
+
|
|
|
+ const segments: string[] = [];
|
|
|
+ let startSerial = serials[0];
|
|
|
+ let endSerial = serials[0];
|
|
|
+
|
|
|
+ const pushSegment = (start: number, end: number) => {
|
|
|
+ const startItem = serialMap.get(start)!;
|
|
|
+ const endItem = serialMap.get(end)!;
|
|
|
+ if (start === end) {
|
|
|
+ segments.push(`${startItem.x}-${startItem.y}`);
|
|
|
+ } else {
|
|
|
+ segments.push(`${startItem.x}-${startItem.y}至${endItem.x}-${endItem.y}`);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ for (let index = 1; index < serials.length; index++) {
|
|
|
+ const current = serials[index];
|
|
|
+ if (current === endSerial + 1) {
|
|
|
+ endSerial = current;
|
|
|
+ } else {
|
|
|
+ pushSegment(startSerial, endSerial);
|
|
|
+ startSerial = current;
|
|
|
+ endSerial = current;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ pushSegment(startSerial, endSerial);
|
|
|
+
|
|
|
+ return `${segments.join(',')}共${serials.length}个位置`;
|
|
|
+};
|
|
|
onMounted(() => {
|
|
|
getInfo();
|
|
|
});
|