Explorar el Código

生产设备台账

quwangxin hace 3 años
padre
commit
38c77d5d6b

+ 1 - 0
src/enum/dict.js

@@ -6,6 +6,7 @@ export default {
   流程分类: 'processCategory',
   角度: 'angle',
   生命周期: 'life_cycle',
+  网络状态: 'network_status',
   金额单位: 'money_unit',
   时间单位: 'time_unit'
 };

+ 243 - 0
src/views/ledgerAssets/equipment/components/baseInfo.vue

@@ -0,0 +1,243 @@
+<template>
+  <div class="baseinfo-container">
+    <div class="basic-details-title border-none">
+      <span class="border-span">基本信息</span>
+    </div>
+    <el-descriptions title="" :column="4" size="medium" border>
+      <el-descriptions-item>
+        <template slot="label"> 类别编码 </template>
+        {{ information.code }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 舟皿名称 </template>
+        {{ information.name }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 型号</template>
+        {{ information.modelType }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 规格 </template>
+        {{ information.specification }}
+      </el-descriptions-item>
+      <el-descriptions-item :span="2">
+        <template slot="label"> 分类 </template>
+        {{information.categoryLevelPath}}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 长/宽/高(mm) </template>
+        {{information.extendField.length}}/{{information.extendField.width}}/{{information.extendField.high}}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 计量单位</template>
+        {{information.measuringUnit}}
+      </el-descriptions-item>
+    </el-descriptions>
+    <div class="basic-details-title border-none">
+      <span class="border-span">舟皿明细</span>
+    </div>
+    <div>
+      <el-tabs v-model="activeName" type="card" @tab-click="tabClick" class="basic-tab">
+          <el-tab-pane :label="`在用(${countInfo.inUseSum?countInfo.inUseSum:'0'})`" name="inUse" >
+          </el-tab-pane>
+          <el-tab-pane :label="`在库(${countInfo.inLibrarySum?countInfo.inLibrarySum:'0'})`" name="inLibrary">
+          </el-tab-pane>
+          <el-tab-pane :label="`消耗(${countInfo.consumeSum?countInfo.consumeSum:'0'})`" name="hasConsume">
+          </el-tab-pane>
+      </el-tabs>
+      <el-table :data="tableData" class="table-box"
+         :header-cell-style="{ background: '#F0F3F3', border: 'none'}"
+      >
+           <el-table-column type="index" label="序号"  width="100"> </el-table-column>
+           <el-table-column prop="code" label="编码" > </el-table-column>
+           <el-table-column prop="name" label="名称" > </el-table-column>
+           <el-table-column prop="inCode" label="入库单号" v-if="activeName=='inLibrary'"> </el-table-column>
+           <el-table-column prop="inTime" label="入库时间" v-if="activeName=='inLibrary'"> </el-table-column>
+           <el-table-column prop="outCode" label="出库单号" v-if="activeName!='inLibrary'"> </el-table-column>
+           <el-table-column prop="outTime" label="出库时间" v-if="activeName!='inLibrary'"> </el-table-column>
+      </el-table>
+      <div class="pagination">
+        <el-pagination
+          background
+          layout="total, sizes, prev, pager, next, jumper"
+          :total="total"
+          :page-sizes="[15, 30, 50, 100, 500]"
+          :page-size="pagination.size"
+          :current-page.sync="pagination.pageNum"
+          @current-change="handleCurrent"
+          @size-change="handleSize"
+        >
+        </el-pagination>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+  import {
+    getCategoryInfo,
+    getPageSingle
+  } from '@/api/ledgerAssets/boat.js';
+export default {
+  props: {
+    rowId:{
+      type:String ,
+      default:''
+    },
+  },
+  data () {
+    return {
+      information:{
+        extendField:{}
+      },
+      activeName:'inUse',
+      tableData:[],
+      pagination: {
+        pageNum: 1,
+        size: 15
+      },
+      total: 0,
+      searchForm:{
+        categoryId:this.rowId,
+        positionType:1
+      },
+      countInfo:{}
+
+    }
+  },
+  created () {
+    this.getDetilInfo()
+    this.handleList()
+    // this.getCountNum()
+  },
+  methods:{
+     getDetilInfo(){
+       getCategoryInfo(this.rowId).then(res=>{
+          this.information = res.data
+          if(res.data.extendField){
+            this.$set(this.information, 'extendField', JSON.parse(res.data.extendField))
+          }
+       })
+     },
+     tabClick(val){
+        switch (this.activeName) {
+          case 'inUse': {
+            this.searchForm.positionType = 1
+            break;
+          }
+          case 'inLibrary': {
+            this.searchForm.positionType = 2
+            break;
+          }
+          case 'hasConsume': {
+            this.searchForm.positionType = 3
+            break;
+          }
+          default:
+            break;
+        }
+        this.handleList()
+     },
+
+     handleCurrent (page) {
+       this.pagination.pageNum = page
+       this.handleList()
+     },
+     handleSize (size) {
+       this.pagination.pageNum = 1
+       this.pagination.size = size
+       this.handleList()
+     },
+
+      handleList () {
+         const params = {
+           ...this.searchForm,
+           ...this.pagination
+         }
+         getPageSingle(params).then(res=>{
+            this.tableData = res.list
+            this.total = res.count
+         })
+
+      },
+
+     getCountNum(){
+       const params = {
+           assetType:'ZHOUMIN',
+           informationId:this.rowInfo.id
+       }
+       getCount(params).then(res=>{
+           if(res?.success){
+               this.countInfo = res.data
+           }
+       })
+     }
+
+
+  },
+
+  watch:{
+    // 监听类别id变化
+    // rowId() {
+    //   this.getDetilInfo()
+    // }
+  },
+
+}
+</script>
+
+<style lang="scss" scoped>
+ .baseinfo-container {
+    background-color: #fff;
+    padding: 20px;
+    .content {
+      padding: 0 20px;
+    }
+  .basic-details-title{
+    font-size: 16px;
+    margin: 15px 0;
+  }
+  .basic-tab{
+    margin-bottom: 15px;
+  }
+  .upload-container {
+    display: flex;
+    .img-box {
+      width: 280px;
+      height: 342px;
+      border: 1px solid rgba(215, 215, 215, 1);
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      img {
+        max-width: 100%;
+      }
+    }
+    .file-list {
+      margin-left: 50px;
+      flex: 1;
+      display: flex;
+      justify-content: space-between;
+      flex-wrap: wrap;
+      justify-items: baseline;
+      align-content: flex-start;
+      .file-box {
+        width: 30%;
+        margin-bottom: 20px;
+        height: 57px;
+        text-align: center;
+        line-height: 55px;
+        border: 1px solid var(--mainColor);
+        color: var(--mainColor);
+        cursor: pointer;
+
+        &.disabled {
+          cursor: not-allowed;
+          border-color: rgba(215, 215, 215, 1);
+          color: rgba(215, 215, 215, 1);
+        }
+      }
+    }
+  }
+}
+</style>

+ 163 - 0
src/views/ledgerAssets/equipment/components/equipment-list.vue

@@ -0,0 +1,163 @@
+<template>
+  <div>
+    <equipment-search @search="reload" />
+    <!-- 数据表格 -->
+    <ele-pro-table
+      ref="table"
+      :columns="columns"
+      :datasource="datasource"
+      height="calc(100vh - 265px)"
+      full-height="calc(100vh - 116px)"
+      tool-class="ele-toolbar-form"
+      cache-key="systemOrgUserTable"
+    >
+      <!-- 表头工具栏 -->
+      <template v-slot:toolbar>
+        <el-button
+          size="small"
+          type="primary"
+          icon="el-icon-download"
+          class="ele-btn-icon"
+        >
+          导出
+        </el-button>
+      </template>
+      <!-- 编码列 -->
+      <template v-slot:code="{ row }">
+        <el-link @click="details(row)">
+          {{ row.code }}
+        </el-link>
+      </template>
+    </ele-pro-table>
+  </div>
+</template>
+
+<script>
+  import EquipmentSearch from './equipment-search.vue';
+  import { getBoatList } from '@/api/ledgerAssets/boat.js';
+
+  export default {
+    components: { EquipmentSearch },
+    props: {
+      // 类别id
+      categoryId: [Number, String],
+      rootId: [Number, String]
+    },
+    data () {
+      return {
+        // 表格列配置
+        columns: [
+          {
+            columnKey: 'index',
+            type: 'index',
+            label: '序号',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'code',
+            label: '类别编码',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            slot: 'code'
+          },
+          {
+            prop: 'name',
+            label: '类别名称',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'module',
+            label: '型号',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'specification',
+            label: '规格',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'angle',
+            label: '角度',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'width',
+            label: '长*宽*高',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'categoryLevelPath',
+            label: '分类',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'inUseSum',
+            label: '在用',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'inLibrarySum',
+            label: '在库',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'consumeSum',
+            label: '消耗',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'totalSum',
+            label: '总数量',
+            showOverflowTooltip: true,
+            minWidth: 110
+          }
+        ]
+      };
+    },
+    methods: {
+      /* 表格数据源 */
+      datasource ({ page, limit, where, order }) {
+        return getBoatList({
+          ...where,
+          ...order,
+          pageNum: page,
+          size: limit,
+          categoryId: this.categoryId,
+          rootCategoryLevelId: this.rootId
+        });
+      },
+      /* 刷新表格 */
+      reload (where) {
+        this.$refs.table.reload({ pageNum: 1, where: where });
+      },
+
+      // 跳转到详情页
+      details ({ id }) {
+        this.$router.push({
+          path: '/ledgerAssets/boat/detail',
+          query: {
+            id
+          }
+        });
+      }
+    },
+    watch: {
+      // 监听类别id变化
+      categoryId () {
+        this.reload();
+      }
+    }
+  };
+</script>

+ 113 - 0
src/views/ledgerAssets/equipment/components/equipment-search.vue

@@ -0,0 +1,113 @@
+<!-- 搜索表单 -->
+<template>
+  <el-form
+    label-width="77px"
+    class="ele-form-search"
+    @keyup.enter.native="search"
+    @submit.native.prevent
+  >
+    <el-row :gutter="15">
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="设备编码:" label-width="50px">
+          <el-input clearable v-model="where.code" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="固资编码:" label-width="50px">
+          <el-input
+            clearable
+            v-model="where.fixAssetCode"
+            placeholder="请输入"
+          />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="设备名称:" label-width="50px">
+          <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="规格/型号:" label-width="50px">
+          <el-input
+            clearable
+            v-model="where.spaceModule"
+            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.networkStatus"
+          >
+          </DictSelection>
+        </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.source">
+          </DictSelection>
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 12, md: 12 } : { span: 12 }">
+        <div class="ele-form-actions">
+          <el-button
+            type="primary"
+            icon="el-icon-search"
+            class="ele-btn-icon"
+            @click="search"
+            size="small"
+          >
+            查询
+          </el-button>
+          <el-button
+            @click="reset"
+            icon="el-icon-refresh-left"
+            size="small"
+            type="primary"
+            >重置</el-button
+          >
+        </div>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+  export default {
+    data () {
+      // 默认表单数据
+      const defaultWhere = {
+        name: '',
+        code: '',
+        networkStatus: '',
+        fixAssetCode: '',
+        source: '',
+        spaceModule: ''
+      };
+      return {
+        // 表单数据
+        where: { ...defaultWhere }
+      };
+    },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive () {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
+    methods: {
+      /* 搜索 */
+      search () {
+        this.$emit('search', this.where);
+      },
+      /*  重置 */
+      reset () {
+        this.where = { ...this.defaultWhere };
+        this.search();
+      }
+    }
+  };
+</script>

+ 66 - 0
src/views/ledgerAssets/equipment/detail.vue

@@ -0,0 +1,66 @@
+<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>
+</template>
+
+<script>
+import baseInfo from './components/baseInfo.vue'
+export default {
+  components: {
+    baseInfo
+  },
+  data () {
+    return {
+      activeComp: 'baseInfo',
+      tabOptions: [
+        { key: 'baseInfo', name: '舟皿信息' },
+      ],
+      rowId:null,
+    }
+  },
+  created () {
+     this.rowId = this.$route.query.id
+  },
+  methods:{
+     // async getDetilInfo(id){
+     //   const res = await getDetails({id:id})
+     //   if (res.success){
+
+     //   }
+     // },
+  }
+
+}
+</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;
+}
+</style>

+ 78 - 0
src/views/ledgerAssets/equipment/index.vue

@@ -0,0 +1,78 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never" v-loading="loading">
+      <ele-split-layout
+        width="266px"
+        allow-collapse
+        :right-style="{ overflow: 'hidden' }"
+      >
+        <div>
+          <div class="ele-border-lighter sys-organization-list">
+            <AssetTree
+              @handleNodeClick="handleNodeClick"
+              @setRootId="setRootId"
+              :type="'1'"
+              :paramsType="'type'"
+              ref="treeList"
+            />
+          </div>
+        </div>
+        <template v-slot:content>
+          <equipment-list
+            v-if="current"
+            :category-id="current.id"
+            :root-id="rootId"
+          />
+        </template>
+      </ele-split-layout>
+    </el-card>
+  </div>
+</template>
+
+<script>
+  import AssetTree from '@/components/AssetTree';
+  import EquipmentList from './components/equipment-list.vue';
+  import { getBoatList } from '@/api/ledgerAssets/boat.js';
+  export default {
+    components: {
+      AssetTree,
+      EquipmentList
+    },
+    data () {
+      return {
+        // 加载状态
+        loading: false,
+        // 表格选中数据
+        selection: [],
+        current: null,
+        rootId: null
+      };
+    },
+    computed: {},
+    methods: {
+      handleNodeClick (info) {
+        this.current = info;
+      },
+      // 获取根节点id
+      setRootId (id) {
+        this.rootId = id;
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .sys-organization-list {
+    height: calc(100vh - 264px);
+    box-sizing: border-box;
+    border-width: 1px;
+    border-style: solid;
+    overflow: auto;
+  }
+  .sys-organization-list :deep(.el-tree-node__content) {
+    height: 40px;
+    & > .el-tree-node__expand-icon {
+      margin-left: 10px;
+    }
+  }
+</style>