LAPTOP-16IUEB3P\Lenovo 2 лет назад
Родитель
Сommit
f635c939ee

+ 24 - 0
src/utils/index.js

@@ -142,3 +142,27 @@ export function pushZero (num) {
 export function tableIndex (index, page, size) {
   return index + 1 + size * (page - 1)
 }
+
+// 图片预览
+export const imageView = item => {
+  let date = new Date()
+  let nowTime = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`
+  let docName = item
+  let suffix = ''
+  let accessUrl = ''
+
+  if (typeof item === 'string') {
+    suffix = item.substr(item.lastIndexOf('.'))
+    accessUrl = item.substr(item.lastIndexOf('/') + 1)
+  } else {
+    docName = item.name.substr(0, item.name.lastIndexOf('.'))
+    suffix = item.accessUrl.substr(item.accessUrl.lastIndexOf('.'))
+    accessUrl = item.accessUrl.substr(item.accessUrl.lastIndexOf('/') + 1)
+  }
+  return getImageBlob(
+    '/common/file/downloadFile/' + accessUrl,
+    {},
+    `${docName}_${nowTime}${suffix}`
+  ).then(data => window.URL.createObjectURL(new Blob([data])))
+}
+

+ 11 - 11
src/views/ledgerAssets/boat/components/baseInfo.vue

@@ -26,9 +26,9 @@
       </el-descriptions-item>
       <el-descriptions-item>
         <template slot="label"> 长/宽/高(mm) </template>
-        {{ information.extendField.length }}/{{
-          information.extendField.width
-        }}/{{ information.extendField.high }}
+       {{ information.extendField.palletLen }}/{{
+          information.extendField.wilde
+        }}/{{ information.extendField.hight }}
       </el-descriptions-item>
       <el-descriptions-item>
         <template slot="label"> 计量单位</template>
@@ -151,13 +151,13 @@
     methods: {
       getDetilInfo () {
         getDetails(this.rowId).then((res) => {
-          this.information = res;
-          if (res.extendField) {
-            this.$set(
-              this.information,
-              'extendField',
-              JSON.parse(res.extendField)
-            );
+          this.information = res.category;
+          if ( typeof res.categoryPallet != 'string') {
+             this.$set(
+               this.information,
+               'extendField',
+                res.categoryPallet
+             );
           }
         });
       },
@@ -226,7 +226,7 @@
 <style lang="scss" scoped>
   .baseinfo-container {
     background-color: #fff;
-    padding: 20px;
+    padding: 0px 20px 20px;
     .content {
       padding: 0 20px;
     }

+ 13 - 3
src/views/ledgerAssets/boat/components/boat-list.vue

@@ -38,8 +38,9 @@
   import BoatSearch from './boat-search.vue';
   import { getBoatList } from '@/api/ledgerAssets';
   // import { downloadAction } from '@/api/flowable/manage';
-
+  import dictMixins from '@/mixins/dictMixins';
   export default {
+    mixins: [dictMixins],
     components: { BoatSearch },
     props: {
       // 类别id
@@ -88,13 +89,19 @@
             prop: 'angle',
             label: '角度',
             showOverflowTooltip: true,
-            minWidth: 110
+            minWidth: 110,
+            formatter: (row) => {
+              return this.getDictValue('角度', row.detail.angle);
+            }
           },
           {
             prop: 'width',
             label: '长*宽*高',
             showOverflowTooltip: true,
-            minWidth: 110
+            minWidth: 200,
+            formatter: (row) => {
+              return row.detail.palletLen + ' * ' + row.detail.wilde + ' * ' + row.detail.hight
+            }
           },
           {
             prop: 'categoryLevelPath',
@@ -129,6 +136,9 @@
         ]
       };
     },
+    created () {
+       this.requestDict('角度');
+    },
     methods: {
       /* 表格数据源 */
       datasource({ page, limit, where, order }) {

+ 6 - 10
src/views/ledgerAssets/boat/components/boat-search.vue

@@ -11,19 +11,15 @@
         <el-form-item label="编码:">
           <el-input clearable v-model="where.code" placeholder="请输入" />
         </el-form-item>
-        <el-form-item label="型号:">
-          <el-input clearable v-model="where.module" placeholder="请输入" />
-        </el-form-item>
       </el-col>
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
         <el-form-item label="名称:">
           <el-input clearable v-model="where.name" placeholder="请输入" />
         </el-form-item>
       </el-col>
-      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
-        <el-form-item label="角度:">
-          <DictSelection dictName="角度" clearable v-model="where.angle">
-          </DictSelection>
+     <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="型号:">
+          <el-input clearable v-model="where.module" placeholder="请输入" />
         </el-form-item>
       </el-col>
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
@@ -31,8 +27,8 @@
           <el-input clearable v-model="where.space" placeholder="请输入" />
         </el-form-item>
       </el-col>
-      <el-col v-bind="styleResponsive ? { lg: 12, md: 12 } : { span: 12 }">
-        <div class="ele-form-actions">
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label-width="50px">
           <el-button
             type="primary"
             icon="el-icon-search"
@@ -47,7 +43,7 @@
             size="small"
             type="primary"
           >重置</el-button>
-        </div>
+        </el-form-item>
       </el-col>
     </el-row>
   </el-form>

+ 18 - 27
src/views/ledgerAssets/boat/detail.vue

@@ -1,24 +1,17 @@
 <template>
-  <div>
-    <!-- tab切换 -->
-<!--   <div class="switch">
-      <div class="switch_left">
-        <ul>
-          <li
-            v-for="item in tabOptions"
-            :key="item.key"
-            :class="{ active: activeComp == item.key }"
-            @click="activeComp = item.key"
-          >
-            {{ item.name }}
-          </li>
-        </ul>
-        <el-button size="small" @click="$router.go(-1)">返回</el-button>
-      </div>
-    </div> -->
-    <div class="content-wrapper">
-      <component :is="activeComp" :rowId="rowId"></component>
-    </div>
+  <div class="ele-body">
+    <el-card :body-style="{ padding: 0 }">
+       <div class="page-title">
+         <el-page-header @back="$router.go(-1)">
+           <div slot="content" class="pageContent">
+             <div>舟皿信息详情</div>
+           </div>
+         </el-page-header>
+       </div>
+       <div class="content-wrapper">
+         <component :is="activeComp" :rowId="rowId"></component>
+       </div>
+    </el-card>
   </div>
 </template>
 
@@ -64,11 +57,9 @@ export default {
 .content-wrapper {
   background-color: #fff;
 }
-.switch_left{
-  width:100%;
-  display:flex;
-  align-items:center;
-  justify-content: space-between;
-  padding-right:20px;
-}
+   .page-title{
+     background: #fff;
+     padding:26px 10px 15px;
+     border-bottom:1px solid #eaeefb;
+   }
 </style>

+ 1 - 1
src/views/ledgerAssets/equipment/components/baseInfo.vue

@@ -307,7 +307,7 @@
   }
   .baseinfo-container {
     background-color: #fff;
-    padding: 20px;
+    padding: 0px 20px 20px;
     .content {
       padding: 0 20px;
     }

+ 13 - 1
src/views/ledgerAssets/equipment/detail.vue

@@ -2,7 +2,7 @@
   <div class="ele-body">
     <el-card :body-style="{ padding: 0 }">
       <!-- tab切换 -->
-      <div class="switch">
+<!--      <div class="switch">
         <div class="switch_left">
           <ul>
             <li
@@ -18,6 +18,13 @@
         <div class="right" style="padding: 10px">
           <el-button @click="$router.go(-1)">返回</el-button>
         </div>
+      </div> -->
+      <div class="page-title">
+        <el-page-header @back="$router.go(-1)">
+          <div slot="content" class="pageContent">
+            <div>设备信息详情</div>
+          </div>
+        </el-page-header>
       </div>
       <div class="content-wrapper">
         <component :is="activeComp" :id="id" :code="code"></component>
@@ -78,4 +85,9 @@
   .content-wrapper {
     background-color: #fff;
   }
+  .page-title{
+    background: #fff;
+    padding:26px 10px 15px;
+    border-bottom:1px solid #eaeefb;
+  }
 </style>

+ 9 - 9
src/views/ledgerAssets/turnoverCar/components/baseInfo.vue

@@ -90,7 +90,7 @@
     <div class="basic-details-title border-none">
       <span class="border-span">图文信息</span>
     </div>
-<!--   <div class="upload-container">
+  <div class="upload-container">
        <div class="img-box">
          <img
            src="~@/assets/upload-placeholder.svg"
@@ -99,7 +99,7 @@
          />
          <img v-else :src="imageUrl" alt="周转车图片" />
        </div>
-    </div> -->
+    </div>
     <div class="basic-details-title border-none">
       <span class="border-span">扩展信息</span>
     </div>
@@ -123,7 +123,7 @@
 <script>
 // import {getAssetInfo} from "@/api/ledgerAssets/asset"
 // import DetailsDialog from '@/views/ledgerAssets/components/outstoreDetailsDialog.vue'
-// import { imageView } from "@/utils"
+import { imageView } from "@/utils"
   import {
     getAssetInfo
   } from '@/api/ledgerAssets';
@@ -164,11 +164,11 @@ export default {
           this.$set(this.info, 'category', res.category)
           this.$set(this.info, 'extInfoSelf', res.extInfoSelf?res.extInfoSelf:[])
           // this.$set(this.info, 'warehouseDetail', res.data.warehouseDetail)
-          // if (res.data.imageUrl) {
-          //   imageView(res.data.imageUrl).then((res) => {
-          //     this.imageUrl = res;
-          //   });
-          // }
+          if (res.imageUrl) {
+            imageView(res.imageUrl).then((res) => {
+              this.imageUrl = res;
+            });
+          }
        }
      },
      // 打开详情弹窗
@@ -189,7 +189,7 @@ export default {
 <style lang="scss" scoped>
 .baseinfo-container {
   background-color: #fff;
-  padding: 20px;
+  padding: 0px 20px 20px;
   .content {
     padding: 0 20px;
   }

+ 9 - 16
src/views/ledgerAssets/turnoverCar/components/turnovercar-list.vue

@@ -36,18 +36,6 @@
           {{ row.code }}
         </el-link>
       </template>
-      <!-- 材质列 -->
-      <template v-slot:texture="{ row }">
-        <div>
-          {{ row.category.extendField && JSON.parse(row.category.extendField).texture }}
-        </div>
-      </template>
-      <!-- 型号列 -->
-      <template v-slot:modelType="{ row }">
-        <div>
-          {{ row.category.modelType }}
-        </div>
-      </template>
       <!-- 分类列 -->
       <template v-slot:categoryLevelPath="{ row }">
         <div>
@@ -124,18 +112,22 @@
             minWidth: 110
           },
           {
-            prop: 'texture',
+            prop: 'materialQuality',
             label: '材质',
             showOverflowTooltip: true,
             minWidth: 110,
-            slot: 'texture'
+            formatter: (_row, _column, cellValue) => {
+              return this.getDictValue('周转车材质',  _row.categoryDetail.materialQuality)
+            }
           },
           {
             prop: 'modelType',
             label: '型号',
             showOverflowTooltip: true,
             minWidth: 110,
-            slot:'modelType'
+            formatter: (_row, _column, cellValue) => {
+              return  _row.category.modelType
+            }
           },
           {
             prop: 'categoryLevelPath',
@@ -175,6 +167,7 @@
     },
     created () {
       this.requestDict('生命周期');
+      this.requestDict('周转车材质');
     },
     methods: {
       /* 表格数据源 */
@@ -216,7 +209,7 @@
       // 导出
       btnExport() {
         const obj = this.$refs.searchRef.getForm()
-        
+
       },
 
     },

+ 18 - 29
src/views/ledgerAssets/turnoverCar/detail.vue

@@ -1,24 +1,18 @@
 <template>
-  <div>
+  <div class="ele-body">
     <!-- tab切换 -->
-<!--    <div class="switch">
-      <div class="switch_left">
-        <ul>
-          <li
-            v-for="item in tabOptions"
-            :key="item.key"
-            :class="{ active: activeComp == item.key }"
-            @click="activeComp = item.key"
-          >
-            {{ item.name }}
-          </li>
-        </ul>
-        <el-button size="small" @click="$router.go(-1)">返回</el-button>
-      </div>
-    </div> -->
-    <div class="content-wrapper">
-      <component :is="activeComp" :rowId="rowId"></component>
-    </div>
+    <el-card :body-style="{ padding: 0 }">
+       <div class="page-title">
+         <el-page-header @back="$router.go(-1)">
+           <div slot="content" class="pageContent">
+             <div>周转车信息详情</div>
+           </div>
+         </el-page-header>
+       </div>
+       <div class="content-wrapper">
+         <component :is="activeComp" :rowId="rowId"></component>
+       </div>
+    </el-card>
   </div>
 </template>
 
@@ -46,14 +40,9 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-.content-wrapper {
-  background-color: #fff;
-}
-.switch_left{
-  width:100%;
-  display:flex;
-  align-items:center;
-  justify-content: space-between;
-  padding-right:20px;
-}
+   .page-title{
+     background: #fff;
+     padding:26px 10px 15px;
+     border-bottom:1px solid #eaeefb;
+   }
 </style>

+ 16 - 19
src/views/ledgerAssets/turnoverCar/edit.vue

@@ -33,7 +33,8 @@
           </el-descriptions-item>
           <el-descriptions-item>
             <template slot="label"> 材质 </template>
-            {{ info.category.extendField && JSON.parse(info.category.extendField).texture }}
+            {{getDictValue('周转车材质',  info.category.materialQuality)}}
+            <!-- {{ info.category.extendField && JSON.parse(info.category.extendField).texture }} -->
           </el-descriptions-item>
           <el-descriptions-item>
             <template slot="label"> 型号 </template>
@@ -88,11 +89,7 @@
           <span class="border-span">文档信息</span>
         </div>
         <div class="upload-container">
-          <!-- <UploadImg
-            @getImgs="cbUploadImg"
-            :assetName="`周转车`"
-            ref="UploadImg"
-          /> -->
+          <WithView v-model="imageUrl" :limit="1" :assetName="'周转车'"/>
         </div>
         <div class="basic-details-title border-none">
           <span class="border-span">扩展信息</span>
@@ -151,7 +148,13 @@
 <script>
   import { getAssetInfo , saveOrEdit } from '@/api/ledgerAssets';
   import { listOrganizations } from '@/api/system/organization';
+  import WithView from '@/components/upload/WithView';
+  import dictMixins from '@/mixins/dictMixins';
   export default {
+    mixins: [dictMixins],
+    components: {
+      WithView
+    },
     data () {
       return {
         formData: {},
@@ -163,7 +166,7 @@
         itemForm: {
           addList: []
         },
-        imageUrl: null,
+        imageUrl: {},
         treeData:[],
         btnLoading: false,
       };
@@ -172,6 +175,7 @@
       let id = this.$route.query.id;
       this.getDetilInfo(id);
       this.query();
+      this.requestDict('周转车材质');
     },
     methods: {
       // 树形结构数据
@@ -191,20 +195,13 @@
       async getDetilInfo (id) {
         const res = await getAssetInfo(id);
         if (res) {
-          this.info = res.data;
-          this.$set(this.info, 'category', res.data.category);
-          // this.$set(this.info, 'warehouseDetail', res.data.warehouseDetail);
-          // this.$set(this.info, 'imgUrl', res.data.imageUrl)
+          this.info = res;
+          this.$set(this.info, 'category', res.category);
           this.itemForm.addList = this.info.extInfoSelf
             ? this.info.extInfoSelf
             : [];
           // 设备图片
-          this.imageUrl = res.data.imageUrl;
-          if (this.imageUrl) {
-            imageView(this.imageUrl).then((res) => {
-              this.$refs.UploadImg.setImg(res);
-            });
-          }
+          this.imageUrl = res.imageUrl?res.imageUrl:{}
         }
       },
 
@@ -238,12 +235,12 @@
           id: this.info.id,
           code: this.info.code,
           fixCode: this.info.fixCode,
-          // imageUrl: this.imageUrl,
+          imageUrl: this.imageUrl || {},
           extInfoSelf: extendField,
           ownershipGroupId: this.info.ownershipGroupId,
           rootCategoryLevelId:this.info.rootCategoryLevelId,
           categoryId:this.info.categoryId,
-          positionIds: JSON.parse(this.info.category.categoryLevelPathId).join(',')
+          positionIds: typeof this.info.category.categoryLevelPathId == 'string'? this.info.category.categoryLevelPathId : JSON.parse(this.info.category.categoryLevelPathId).join(',')
         };
         this.btnLoading = true;
         this.$refs['formCustom'].validate((valid) => {