lxf il y a 1 an
Parent
commit
a31d25c7c8
1 fichiers modifiés avec 30 ajouts et 34 suppressions
  1. 30 34
      src/views/group/BOM/management/index.vue

+ 30 - 34
src/views/group/BOM/management/index.vue

@@ -44,40 +44,36 @@
             @get-list="getList"
             @clickReset="clickReset">
             <template #typeExpand="{ item }">
-              <div style="width: 100%">
-                <el-table
-                  :data="item.bomSpecList"
-                  size="small"
-                  :row-style="{ height: '35px' }"
-                  :cell-style="{ padding: '0' }"
-                  header-row-class-name="tableHeader"
-                  :show-header="false">
-                  <el-table-column width="100" align="center" />
-                  <el-table-column label="设计图" width="100">
-                    <template #default="{ row }">
-                      <div v-if="row.mainImgUrl">
-                        <img
-                          style="width: 32px; height: 32px; object-fit: contain; vertical-align: middle; border: none; cursor: pointer; margin-bottom: 8px"
-                          :src="row.mainImgUrl"
-                          @click="openFile(row.mainImgUrl)" />
-                      </div>
-                    </template>
-                  </el-table-column>
-                  <el-table-column label="品号" prop="name" min-width="240" />
-                  <el-table-column label="品名" prop="code" width="200" />
-                  <el-table-column label="单品尺寸(L*W*H)" width="240">
-                    <template #default="{ row }">
-                      <span>{{ `${row.length} * ${row.width} * ${row.height}` }}</span>
-                    </template>
-                  </el-table-column>
-                  <el-table-column label="操作" align="center" width="120" v-if="props.selectStatus">
-                    <template #default="{ row }">
-                      <div>
-                        <el-button type="text" @click="selectBOM(row)" :disabled="selectBtnStatus" v-db-click>选择</el-button>
-                      </div>
-                    </template>
-                  </el-table-column>
-                </el-table>
+              <div style="padding: 0px 20px; box-sizing: border-box" v-if="item.bomSpecList && item.bomSpecList.length > 0">
+                <div
+                  v-for="spec in item.bomSpecList"
+                  :key="spec.id"
+                  style="display: flex; padding: 8px 16px; align-items: center; box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.1); margin-bottom: 8px">
+                  <div style="width: 80px">
+                    <div v-if="spec.mainImgUrl">
+                      <img
+                        style="width: 40px; height: 40px; object-fit: contain; vertical-align: middle; border: none; cursor: pointer"
+                        :src="spec.mainImgUrl"
+                        @click="openFile(spec.mainImgUrl)" />
+                    </div>
+                    <div
+                      v-else
+                      class="el-icon-picture-outline"
+                      style="width: 40px; height: 40px; font-size: 36px; line-height: 40px; text-align: center; color: rgb(229 228 228)"></div>
+                  </div>
+                  <div style="width: 180px">
+                    {{ spec.code }}
+                  </div>
+                  <div style="flex: 1">
+                    {{ spec.name }}
+                  </div>
+                  <div style="width: 180px">
+                    {{ `${spec.length}  *  ${spec.width}  *  ${spec.height}(cm³)` }}
+                  </div>
+                  <div style="width: 60px; text-align: center" v-if="props.selectStatus">
+                    <el-button type="text" @click="selectBOM(row)" :disabled="selectBtnStatus" v-db-click>选择</el-button>
+                  </div>
+                </div>
               </div>
             </template>
             <template #name="{ item }">