huangxw 10 kuukautta sitten
vanhempi
säilyke
744d45281e

BIN
src/assets/images/pdf_icon.png


BIN
src/assets/images/sf_icon.png


+ 25 - 0
src/utils/ruoyi.ts

@@ -253,3 +253,28 @@ export const fileExt = (fileName: string) => {
     // 获取文件后缀, 从后面到第一个点取 不包括.
     return fileName.slice(fileName.lastIndexOf('.') + 1);
 };
+export const changeByte = (byte: number) => {
+    let size = '';
+    if (byte < 0.1 * 1024) {
+        // 小于0.1KB,则转化成B
+        size = `${byte.toFixed(2)}B`;
+    } else if (byte < 0.1 * 1024 * 1024) {
+        // 小于0.1MB,则转化成KB
+        size = `${(byte / 1024).toFixed(2)}KB`;
+    } else if (byte < 0.1 * 1024 * 1024 * 1024) {
+        // 小于0.1GB,则转化成MB
+        size = `${(byte / (1024 * 1024)).toFixed(2)}MB`;
+    } else {
+        // 其他转化成GB
+        size = `${(byte / (1024 * 1024 * 1024)).toFixed(2)}GB`;
+    }
+
+    const sizeStr = `${size}`; // 转成字符串
+    const index = sizeStr.indexOf('.'); // 获取小数点处的索引
+    const dou = sizeStr.substring(index + 1, index + 3); // 获取小数点后两位的值
+    if (dou == '00') {
+        // 判断后两位是否为00,如果是则删除00
+        return sizeStr.substring(0, index);
+    }
+    return size;
+};

+ 125 - 4
src/views/cdt/models/orderInfo.vue

@@ -1,5 +1,5 @@
 <template>
-    <div>
+    <div v-if="info">
         <div class="info-title f-w-5 mb-15">订单信息</div>
         <vxe-table ref="vxeTableRef" border :data="info?.testOrderDetailList" :merge-cells="mergeCells">
             <vxe-column title="订单号" fixed="left" width="120">
@@ -45,18 +45,118 @@
                 </template>
             </vxe-column>
         </vxe-table>
+        <el-divider />
+        <template v-if="+info.status >= 6 && info?.status !== '90'">
+            <el-descriptions title="发票信息" :column="3">
+                <el-descriptions-item label="上传人:">{{ info?.invoiceLog?.operator }}</el-descriptions-item>
+                <el-descriptions-item label="上传时间:">{{ info?.invoiceLog?.operationTime }}</el-descriptions-item>
+                <el-descriptions-item v-if="info?.invoice" label="发票:">
+                    <FileLook v-model="info.invoice" isObject></FileLook>
+                </el-descriptions-item>
+            </el-descriptions>
+            <el-divider />
+        </template>
+        <template v-if="+info.status >= 5 && info?.status !== '90'">
+            <el-descriptions title="检测报告" :column="4">
+                <el-descriptions-item label="上传人:">{{ info?.reportLog?.operator}}</el-descriptions-item>
+                <el-descriptions-item label="上传时间:">{{ info?.reportLog?.operationTime }}</el-descriptions-item>
+                <el-descriptions-item label="检测单位:">{{ info?.testOrg }}</el-descriptions-item>
+                <el-descriptions-item v-if="info?.report" class-name="zy-desc" label="检测报告:">
+                    <FileLook v-model="info.report" isObject></FileLook>
+                </el-descriptions-item>
+            </el-descriptions>
+            <el-divider />
+        </template>
+        <template v-if="+info.status >= 2 && info?.status !== '90' && info?.postInfo?.length">
+            <div class="f-s-16 c-333 f-w-6 mb-16">物流信息</div>
+            <div class="d-flex a-c mb-10">
+                <img class="mr-10" style="width: 30px; height: 30px;" src="@/assets/images/sf_icon.png" />
+                <div>
+                    <span class="f-s-14 mr-16">顺丰快递</span>
+                    <span class="c-999 f-s-12">{{ info?.postInfo[0]?.mailno }}</span>
+                </div>
+            </div>
+            <el-steps direction="vertical" :active="1">
+                <template v-for="(item, index) in info?.postInfo" :key="index">
+                    <el-step>
+                        <template #icon>
+                            <el-button v-if="item.opCode === '80'" type="primary" circle size="small">收</el-button>
+                            <div class="dot" :class="{ ['active' + index]: true }"></div>
+                        </template>
+                        <template #title>
+                            <span>{{ selectDictLabel(sf_router_code, item?.opCode) }}</span>
+                            <span>{{ item?.acceptTime }}</span>
+                        </template>
+                        <template #description>
+                            <div class="pt-10 pb-10">
+                                <span class="f-s-14 c-666">[{{ item.acceptAddress }}]</span>
+                                <span class="f-s-14 c-666">{{ item?.remark }}</span>
+                            </div>
+                        </template>
+                    </el-step>
+                </template>
+            </el-steps>
+            <el-divider />
+        </template>
+        <template v-if="+info.status >= 2  && +info?.originStatus >= 2">
+            <div class="f-s-16 c-333 f-w-6 mb-16">寄样信息</div>
+            <div class="d-flex a-c">
+                <div class="card-blcok pd-16 d-flex flex1">
+                    <div class="mr-16">
+                        <el-button type="danger" circle>取</el-button>
+                    </div>
+                    <div class="flex1 ov-hd">
+                        <div class="f-s-14 c-333 f-w-5 mb-5">{{ info?.sendAddress?.province + info?.sendAddress?.city + info?.sendAddress?.district + info?.sendAddress?.address }}</div>
+                        <div class="f-s-14 c-999">
+                            <span class="mr-30">{{ info?.sendAddress?.contactName }}</span>
+                            <span>{{ info?.sendAddress?.contactPhone }}</span>
+                        </div>
+                    </div>
+                </div>
+                <div class="c-primary f-w-6 pd-20" style="font-size: 30px;">
+                    <el-icon><Right /></el-icon>
+                </div>
+                <div class="card-blcok pd-16 d-flex flex1">
+                    <div class="mr-16">
+                        <el-button type="primary" circle>收</el-button>
+                    </div>
+                    <div class="flex1 ov-hd">
+                        <div class="f-s-14 c-333 f-w-5 mb-5">{{ info?.orgAddress?.province + info?.orgAddress?.city + info?.orgAddress?.district + info?.orgAddress?.address }}</div>
+                        <div class="f-s-14 c-999">
+                            <span class="mr-30">{{ info?.orgAddress?.contactName }}</span>
+                            <span>{{ info?.orgAddress?.contactPhone }}</span>
+                        </div>
+                    </div>
+                </div>
+            </div>
+            <div class="pd-8"></div>
+            <el-descriptions :column="4">
+                <el-descriptions-item label="取件时间:">{{ info?.reservationTime}}</el-descriptions-item>
+            </el-descriptions>
+            <el-divider />
+        </template>
+
+        <el-descriptions title="订单信息" :column="4">
+            <el-descriptions-item label="订单号:">{{ info?.orderNo }}</el-descriptions-item>
+            <el-descriptions-item label="下单人:">{{ info?.createName }}</el-descriptions-item>
+            <el-descriptions-item label="下单时间:">{{ info?.createTime }}</el-descriptions-item>
+            <el-descriptions-item label="收货地址:">{{ info?.reciveAddress?.province + info?.reciveAddress?.city + info?.reciveAddress?.district + info?.reciveAddress?.address }}</el-descriptions-item>
+            <el-descriptions-item label="收件人:">{{ info?.reciveAddress?.contactName  }}</el-descriptions-item>
+            <el-descriptions-item label="联系电话:">{{ info?.reciveAddress?.contactPhone  }}</el-descriptions-item>
+        </el-descriptions>
     </div>
 </template>
 <script setup lang="ts">
 import { propTypes } from '@/utils/propTypes';
 import { VxeTablePropTypes } from 'vxe-table';
 import { colNoData } from '@/utils/noData';
+import { FileLook } from '@/views/models';
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
-const { test_order_status_bg } = toRefs<any>(proxy?.useDict('test_order_status_bg'));
+const { test_order_status_bg, sf_router_code } = toRefs<any>(proxy?.useDict('test_order_status_bg', 'sf_router_code'));
 const vxeTableRef = ref<any>(null);
 const list = ref<any[]>([]);
 const props = defineProps({
-    info: propTypes.any.def({})
+    info: propTypes.any.def(null)
 });
 // 合并表格
 const mergeCells = ref<VxeTablePropTypes.MergeCells>([
@@ -68,4 +168,25 @@ const mergeCells = ref<VxeTablePropTypes.MergeCells>([
     { row: 0, col: 8, rowspan: 2, colspan: 0 }
 ]);
 </script>
-<style lang="scss" scoped></style>
+<style lang="scss" scoped>
+.card-blcok {
+    border: 1px solid #f2f2f2;
+    border-radius: 4px;
+}
+.dot {
+    width: 20px;
+    height: 20px;
+    background-color: #d7d7d7;
+    border-radius: 50%;
+
+    &.active0 {
+        background-color: #2A6D52;
+    }
+    &.active1 {
+        background-color: #333;
+    }
+}
+.zy-desc {
+    display: inline-block;
+}
+</style>

+ 1 - 1
src/views/cdt/orders/detail/index.vue

@@ -29,7 +29,7 @@ import { getTestOrderDetail } from '@/api/cdt/orders';
 import { orderInfo, menuInfo } from '../../models';
 const { query }:any = useRoute()
 const router = useRouter();
-const activeName = ref('log');
+const activeName = ref('info');
 // 获取详细信息
 const orderItem = ref<any>(null);
 const getDetail = async () => {

+ 115 - 0
src/views/models/FileLook.vue

@@ -0,0 +1,115 @@
+<template>
+    <transition-group class="upload-file-list" name="el-fade-in-linear flex1 ov-hd" tag="div">
+        <el-row :gutter="60">
+            <el-col :span="span" v-for="(file, index) in fileList" :key="index">
+                <div class="upload-list-item">
+                    <el-link class="flex1 right-item" :href="`${file.url}`" :underline="false" target="_blank">
+                        <img style="width: 36px; height: 36px;" class="mr5" src="@/assets/images/pdf_icon.png" alt="" />
+                        <div>
+                            <div class="item-text">{{ file.fileName }}</div>
+                            <div v-if="file.fileSize" class="item-text">{{ changeByte(file.fileSize) }}</div>
+                        </div>
+                    </el-link>
+                    <a class="delete-item" @click="download(file.url, {}, file.fileName)" :underline="false">
+                        <div class="d-flex a-c j-c flex-cln">
+                            <el-icon size="16"><Download /></el-icon>
+                            <div style="padding-top: 6px;">下载</div>
+                        </div>
+                    </a>
+                </div>
+            </el-col>
+        </el-row>
+        <div v-if="!fileList.length">-</div>
+    </transition-group>
+</template>
+
+<script setup lang="ts">
+import { download } from '@/utils/request';
+import { propTypes } from '@/utils/propTypes';
+import { changeByte } from '@/utils/ruoyi';
+
+const props = defineProps({
+    modelValue: [String, Object, Array],
+    span: propTypes.number.def(18),
+    isObject: propTypes.bool.def(true)
+});
+
+const fileList = ref<any>([]);
+watch(
+    () => props.modelValue,
+    async (val) => {
+        if (val) {
+            let list = [];
+            if (Array.isArray(val)) {
+                list = val;
+            } else if (props.isObject) {
+                list = [val];
+            }
+            fileList.value = [...list];
+        } else {
+            fileList.value = [];
+            return [];
+        }
+    },
+    { deep: true, immediate: true }
+);
+const handleDownload = () => {};
+</script>
+
+<style scoped lang="scss">
+.upload-file-uploader {
+    margin-bottom: 5px;
+}
+
+.upload-list-item {
+    position: relative;
+    display: flex;
+    align-items: center;
+    border: 1px solid #e8e8e8;
+    border-radius: 2px;
+    padding-right: 60px;
+    box-sizing: border-box;
+    margin-bottom: 12px;
+
+    &:hover {
+        border-color: var(--el-color-primary);
+        background-color: rgba(#0f8240, 0.06);
+        .delete-item {
+            opacity: 1;
+        }
+    }
+}
+
+.item-text {
+    line-height: 1.2;
+    font-size: 14px;
+    word-break:break-all;
+}
+
+.delete-item {
+    width: 48px;
+    position: absolute;
+    top: -1px;
+    bottom: -1px;
+    right: 0;
+    display: flex;
+    justify-content: center;
+    font-size: 12px;
+    align-items: center;
+    color: #fff;
+    border: 1px solid var(--el-color-primary);
+    cursor: pointer;
+    background-color: var(--el-color-primary);
+    opacity: 0;
+}
+
+.right-item {
+    padding: 8px 10px;
+    justify-content: start;
+    box-sizing: border-box;
+}
+
+.upload-file {
+    width: 100%;
+}
+</style>

+ 1 - 0
src/views/models/index.ts

@@ -5,3 +5,4 @@ export { default as BtnRadio } from './BtnRadio.vue'; // 按钮单选
 export { default as AddBtn } from './AddBtn.vue'; // 新增按钮
 export { default as SearchSelect } from './SearchSelect.vue'; // 搜索选择服务端获取数据
 export { default as ImageViewer } from './ImageViewer.vue'; // 图片预览
+export { default as FileLook } from './FileLook.vue'; // 文件查看