2213980799@qq.com 2 роки тому
батько
коміт
16d0da76ee
26 змінених файлів з 2304 додано та 765 видалено
  1. 20 0
      src/api/main/index.js
  2. 17 0
      src/api/maintenance/repair.js
  3. 11 3
      src/api/sparePartsApply/index.js
  4. 1 1
      src/components/bpmnProcessDesigner/package/theme/process-panel.scss
  5. 1 1
      src/enum/dict.js
  6. 307 0
      src/views/equipmentDisposal/components/DialogGoods.vue
  7. 0 0
      src/views/equipmentDisposal/components/edit.vue
  8. 89 0
      src/views/equipmentDisposal/components/search.vue
  9. 224 0
      src/views/equipmentDisposal/index.vue
  10. 87 41
      src/views/home/data.js
  11. 98 71
      src/views/home/index.vue
  12. 10 12
      src/views/ledgerAssets/components/assetInformation.vue
  13. 1 1
      src/views/maintenance/components/MaterialAdd.vue
  14. 15 11
      src/views/maintenance/components/programRulesDialog.vue
  15. 7 1
      src/views/maintenance/equipment/workOrder/details.vue
  16. 204 179
      src/views/maintenance/equipment/workOrder/index.vue
  17. 7 0
      src/views/maintenance/patrol/workOrder/details.vue
  18. 216 186
      src/views/maintenance/patrol/workOrder/index.vue
  19. 6 1
      src/views/maintenance/repair/components/RepairDetailsDialog.vue
  20. 28 27
      src/views/maintenance/repair/workOrder/index.vue
  21. 301 187
      src/views/sparePartsApply/components/AssetsDialog.vue
  22. 0 0
      src/views/sparePartsApply/components/assetTree.vue
  23. 374 0
      src/views/sparePartsApply/components/edit.vue
  24. 211 0
      src/views/sparePartsApply/components/editd.vue
  25. 1 1
      src/views/sparePartsApply/components/search.vue
  26. 68 42
      src/views/sparePartsApply/index.vue

+ 20 - 0
src/api/main/index.js

@@ -20,3 +20,23 @@ export async function listInspection(data) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+/**
+ * 部门故障统计率
+ */
+ export async function queryGroupName(data) {
+  const res = await request.get('/eam/workorder/queryGroupName');
+  if (res.data.code == 0) {
+    return Promise.resolve(res.data.data)
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 设备故障数统计
+ */
+ export async function queryDevice(data) {
+  const res = await request.get('/eam/workorder/queryDevice');
+  if (res.data.code == 0) {
+    return Promise.resolve(res.data.data)
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 17 - 0
src/api/maintenance/repair.js

@@ -29,6 +29,23 @@ export async function applySpareParts(data) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+export async function save(data) {
+  const res = await request.post(`/eam/spare_parts_apply/add`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+// // 详情
+export async function details (id) {
+  const res = await request.get(`/eam/spare_parts_apply/details/${id}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+
 // // 保存
 // export async function save (data) {
 //   const res = await request.post('/eam/repairrequest/save', data);

+ 11 - 3
src/api/sparePartsApply/index.js

@@ -4,9 +4,17 @@ import request from '@/utils/request';
  * 列表
  */
 export async function getList (data) {
-  const res = await request.get('/eam/apply_storage/page', {
-    params: data
-  });
+  const res = await request.post('/eam/spare_parts_apply/page', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+
+// // 详情
+export async function detailsId (id) {
+  const res = await request.get(`/eam/spare_parts_apply/detailsId/${id}`);
   if (res.data.code == 0) {
     return res.data.data;
   }

+ 1 - 1
src/components/bpmnProcessDesigner/package/theme/process-panel.scss

@@ -97,7 +97,7 @@
   padding-bottom: 0;
 }
 .el-input.is-disabled .el-input__inner {
-  color: #999999;
+  color: #606266;
 }
 .el-form-item.el-form-item--mini {
   margin-bottom: 0;

+ 1 - 1
src/enum/dict.js

@@ -33,7 +33,7 @@ export default {
   干燥区状态: 'dry_status',
   设备生命周期:'equipment_lifeCycle',
   设备处置方式:'equipment_Disposal',
-  精度等级:'accuracy_level'
+  精度等级:'accuracy_level',
 };
 
 export const numberList = ['patrol_cycle'];

+ 307 - 0
src/views/equipmentDisposal/components/DialogGoods.vue

@@ -0,0 +1,307 @@
+<template>
+  <div class="dialogBox">
+    <el-dialog
+      :close-on-click-modal="false"
+      :append-to-body="appendToBody"
+      :title="title"
+      :visible.sync="visibleSync"
+      :before-close="close"
+      :width="width"
+      :custom-class="customClass"
+    >
+      <ele-split-layout
+        width="256px"
+        allow-collapse
+        :right-style="{ overflow: 'hidden' }"
+      >
+        <div>
+          <div class="select">
+            <el-select
+              size="small"
+              @change="productChange"
+              v-model="productId"
+              placeholder="请选择"
+            >
+              <el-option
+                v-for="item in productList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              >
+              </el-option>
+            </el-select>
+          </div>
+          <div class="tree">
+            <asset-tree
+              @handleNodeClick="handleNodeClick"
+              ref="AssetTree"
+              :paramsType="'type'"
+              :init="false"
+              id="4"
+            />
+          </div>
+        </div>
+        <!-- <div class="minHeight ele-border-lighter split-layout-right-content">
+          <template> </template>
+          
+        </div> -->
+        <template v-slot:content>
+          <!-- 数据表格 -->
+          <ele-pro-table
+            ref="table"
+            :initLoad="false"
+            :columns="columns"
+            height="60vh"
+            :current.sync="current"
+            highlight-current-row
+            :datasource="datasource"
+            tool-class="ele-toolbar-form"
+            cache-key="systemOrgUserTable"
+            @row-click="chooseRow"
+          >
+            <!-- 表头工具栏 -->
+            <template v-slot:toolbar>
+              <el-row :gutter="22">
+                <el-col :span="8">
+                  <el-input
+                    type="text"
+                    v-model="searchForm.searchKey"
+                    size="small"
+                    placeholder="搜索物品编码/名称"
+                  ></el-input>
+                </el-col>
+                <el-col :span="8">
+                  <el-button
+                    icon="el-icon-refresh-left"
+                    size="small"
+                    @click="rest"
+                    >重置</el-button
+                  >
+                  <el-button
+                    type="primary"
+                    icon="el-icon-search"
+                    size="small"
+                    @click="reload"
+                    >搜索</el-button
+                  >
+                </el-col>
+              </el-row>
+            </template>
+            <template v-slot:action="{ row }">
+              <el-radio class="radio" v-model="radio" :label="row.id"
+                ><i></i
+              ></el-radio>
+            </template>
+          </ele-pro-table>
+        </template>
+      </ele-split-layout>
+      <footer slot="footer">
+        <el-button @click="close">取消</el-button>
+        <el-button @click="submit" type="primary">确认</el-button>
+      </footer>
+    </el-dialog>
+  </div>
+</template>
+<script>
+  import AssetTree from '@/components/AssetTree';
+  // import { getList } from "@/api/stockManagement/itemInformation";
+  import { getList } from '@/api/classifyManage/itemInformation';
+  import dictMixins from '@/mixins/dictMixins';
+  import { getTreeByPid } from '@/api/classifyManage';
+  export default {
+    mixins: [dictMixins],
+    props: {
+      // 宽度
+      width: {
+        type: String,
+        default: () => null
+      },
+      // 类名
+      customClass: {
+        type: String,
+        default: () => null
+      },
+      appendToBody: {
+        type: Boolean,
+        default: () => false
+      }
+    },
+    components: {
+      AssetTree
+    },
+    data() {
+      return {
+        productId: '',
+        visibleSync: false,
+        title: '选择物品',
+        searchForm: {
+          searchKey: '',
+          categoryLevelId: '1'
+        },
+        current: {},
+        radio: null,
+        productList: []
+      };
+    },
+    computed: {
+      // 表格列配置
+      columns() {
+        return [
+          {
+            columnKey: 'index',
+            type: 'index',
+            width: 80,
+            label: '序号',
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'code',
+            label: '物品编码',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'name',
+            label: '物品名称',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'specification',
+            label: '规格',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'modelType',
+            label: '型号',
+            showOverflowTooltip: true
+          },
+          // {
+          //   prop: 'type',
+          //   label: '物品类型',
+          //   showOverflowTooltip: true,
+          //   formatter: (_row) => this.getDictValue('类型用途', _row.type)
+          // },
+          {
+            prop: 'categoryLevelPath',
+            label: '分类',
+            showOverflowTooltip: true
+          },
+          {
+            columnKey: 'action',
+            slot: 'action',
+            align: 'center',
+            fixed: 'right',
+            width: 50
+          }
+        ];
+      }
+    },
+    created() {
+      this.requestDict('类型用途');
+    },
+    methods: {
+      productChange(e) {
+        this.$refs.AssetTree.getTreeData(e);
+      },
+      /* 表格数据源 */
+      datasource({ page, limit, where }) {
+        return getList({
+          ...where,
+          pageNum: page,
+          size: limit
+        });
+      },
+      reload() {
+        this.radio = null;
+        this.$nextTick(() => {
+          this.$refs.table.reload({
+            pageNum: 1,
+            where: {
+              ...this.searchForm
+            }
+          });
+        });
+      },
+      async open(id, boolen) {
+        this.visibleSync = true;
+        const { data } = await getTreeByPid(id);
+        this.productList = data;
+        this.$refs.AssetTree.getTreeData(id, boolen);
+        this.productId = '';
+      },
+      close() {
+        this.visibleSync = false;
+      },
+      rest() {
+        this.searchForm.searchKey = '';
+        this.reload();
+      },
+      handleNodeClick(info) {
+        this.searchForm.categoryLevelId = info.id;
+        this.reload();
+      },
+      chooseRow(row) {
+        this.current = row;
+        this.radio = row.id;
+      },
+      submit() {
+        if (!this.current) {
+          return this.$message.error('请选择物品编码');
+        }
+        this.$emit('succeed', this.current);
+        this.close();
+      }
+    }
+  };
+</script>
+<style lang="scss" scoped>
+  .select {
+    background: #fafafa;
+    border: 1px solid #ededed;
+    border-bottom: none;
+    padding: 9px 15px;
+    .el-select {
+      width: 100%;
+    }
+  }
+  .tree {
+    height: calc(100vh - 280px);
+    border: 1px solid #ededed;
+  }
+  .from-search-bar {
+    display: flex;
+    .btn-wrap {
+      margin-left: 20px;
+    }
+  }
+
+  .main {
+    display: flex;
+    .tree-col {
+      margin-right: 10px;
+      width: 350px;
+      height: 500px;
+      overflow-y: auto;
+      padding: 0 !important;
+      background-color: #fff;
+      margin-top: 10px;
+      border: 1px solid #e6ebf5;
+      border-radius: 4px;
+      overflow-x: auto;
+      box-sizing: border-box;
+    }
+    .right-wrap {
+      width: 100%;
+      margin-top: 10px;
+      .tableRef {
+        height: 450px;
+      }
+      .btn-wrap {
+        display: flex;
+        justify-content: flex-end;
+        margin-top: 20px;
+      }
+    }
+  }
+</style>

+ 0 - 0
src/views/equipmentDisposal/components/edit.vue


+ 89 - 0
src/views/equipmentDisposal/components/search.vue

@@ -0,0 +1,89 @@
+<!-- 搜索表单 -->
+<template>
+  <el-form label-width="90px" 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="编码:">
+          <el-input clearable v-model="where.workOrderCode" 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.warehouseName" 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.categoryName" placeholder="请输入"/>
+        </el-form-item>
+      </el-col>
+
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="组织机构:">
+          <auth-selection v-model="where.deptIds" style="width: 100%"></auth-selection>
+        </el-form-item>
+      </el-col>
+
+
+      <el-col style="display: flex;justify-content: flex-end"
+              v-bind="styleResponsive ? { lg: 24, md: 24 } : { span: 24 }">
+        <el-form-item label-width="0px">
+          <el-button type="primary" icon="el-icon-search" class="ele-btn-icon" @click="search">
+            查询
+          </el-button>
+          <el-button @click="reset" icon="el-icon-refresh-left" type="primary">重置</el-button>
+        </el-form-item>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+
+export default {
+  props: [],
+  data() {
+    // 默认表单数据
+    const defaultWhere = {
+      workOrderCode: '',
+      warehouseName: '',
+      categoryName: '',
+      deptIds:''
+
+    };
+    return {
+      // 表单数据
+      where: {...defaultWhere},
+
+    };
+  },
+  computed: {
+    // 是否开启响应式布局
+    styleResponsive() {
+      return this.$store.state.theme.styleResponsive;
+    }
+  },
+  watch: {},
+  created() {
+
+  },
+  methods: {
+    /* 搜索 */
+    search() {
+      this.$emit('search', this.where);
+    },
+    /*  重置 */
+    reset() {
+      this.where = {...this.defaultWhere};
+      this.search();
+    },
+
+
+  }
+};
+</script>
+<style lang="scss" scoped>
+
+</style>

+ 224 - 0
src/views/equipmentDisposal/index.vue

@@ -0,0 +1,224 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never" v-loading="loading">
+      <equipment-search
+        @search="reload"
+        :networkCounts="networkCounts"
+        ref="search"
+      />
+      <!-- 数据表格 -->
+      <ele-pro-table
+        ref="table"
+        :columns="columns"
+        :datasource="datasource"
+        height="calc(100vh - 400px)"
+        tool-class="ele-toolbar-form"
+        cache-key="systemOrgUserTable"
+        :initLoad="false"
+        @select="selectChange"
+        @select-all="changeSelectAll"
+      >
+        <!-- 表头工具栏 -->
+        <template v-slot:toolbar="{ row }">
+          <el-button
+            size="small"
+            type="primary"
+            icon="el-icon-plus"
+            class="ele-btn-icon"
+            @click="add"
+          >
+            新建
+          </el-button>
+
+          <!-- <el-button size="small" class="ele-btn-icon" @click="handlDelete"
+          >删除</el-button
+        >
+        <el-button
+          size="small"
+          @click="moveTo(checkRadioData, 'move')"
+          :disabled="checkRadioData.length == 0"
+          class="ele-btn-icon"
+          >移动到</el-button
+        > -->
+        </template>
+        <!-- 编码列 -->
+        <template v-slot:code="{ row }">
+          <el-link type="primary" :underline="false" @click="details(row)">
+            {{ row.code }}
+          </el-link>
+        </template>
+        <!-- 操作列 -->
+        <template v-slot:action="{ row }">
+          <el-link
+            type="primary"
+            :underline="false"
+            icon="el-icon-edit"
+            @click="handEdit(row)"
+          >
+            编辑
+          </el-link>
+        </template>
+      </ele-pro-table>
+    </el-card></div
+  >
+</template>
+
+<script>
+import { getAssetList } from '@/api/ledgerAssets';
+import dictMixins from '@/mixins/dictMixins';
+import equipmentSearch from './components/search.vue';
+
+export default {
+  mixins: [dictMixins],
+  components: {
+    equipmentSearch
+  },
+
+  data() {
+    return {
+      isConsumer: false,
+      // 表格列配置
+      columns: [
+        {
+          width: 45,
+          type: 'selection',
+          columnKey: 'selection',
+          align: 'center'
+        },
+        {
+          columnKey: 'index',
+          type: 'index',
+          label: '序号',
+          width: 55,
+          align: 'center',
+          showOverflowTooltip: true,
+          fixed: 'left'
+        },
+        {
+          columnKey: 'code',
+          prop: 'code',
+          slot: 'code',
+          align: 'center',
+          label: '名称',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          columnKey: 'code',
+          align: 'center',
+          prop: 'code',
+          slot: 'code',
+          label: '编码',
+          showOverflowTooltip: true,
+          minWidth: 180
+        },
+        {
+          columnKey: 'code',
+          prop: 'code',
+          align: 'center',
+          slot: 'code',
+          label: '处置方式',
+          showOverflowTooltip: true
+        },
+        {
+          columnKey: 'code',
+          prop: 'code',
+          align: 'center',
+          slot: 'code',
+          label: '物品编码',
+          showOverflowTooltip: true,
+          minWidth: 180
+        },
+
+        {
+          prop: 'name',
+          align: 'center',
+          label: '物品名称',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+
+        {
+          prop: 'category.modelType',
+          align: 'center',
+          label: '型号',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          prop: 'category.specification',
+          align: 'center',
+          label: '规格',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          align: 'center',
+          prop: 'usePerson',
+          label: '使用人',
+          showOverflowTooltip: true,
+          minWidth: 80
+        },
+        {
+          prop: 'chargePerson',
+          align: 'center',
+          label: '负责人',
+          showOverflowTooltip: true,
+          minWidth: 80
+        },
+
+        {
+          prop: 'status',
+          align: 'center',
+          label: '状态',
+          showOverflowTooltip: true
+        },
+
+        {
+          columnKey: 'action',
+          slot: 'action',
+          align: 'center',
+          label: '操作',
+          minWidth: 100,
+          fixed: 'right'
+        }
+      ],
+      networkCounts: {},
+      checkRadioData: [],
+      QRvisible: false
+    };
+  },
+  computed: {},
+  created() {},
+  methods: {
+    /* 表格数据源 */
+    datasource({ page, limit, where, order }) {
+      console.log('------reload-------');
+      // this.getNetWork(page, limit, where, order);
+      return getAssetList({
+        ...where,
+        ...order,
+        pageNum: page,
+        size: limit,
+        categoryLevelId: this.categoryId,
+        rootCategoryLevelId: this.rootId
+      });
+    },
+
+    /* 刷新表格 */
+    reload(where) {
+      this.$refs.table.reload({ pageNum: 1, where: where });
+    }
+  }
+};
+</script>
+<style lang="scss" scoped>
+@media print {
+  #printSection {
+    font-size: 34px;
+    span {
+      font-size: 34px;
+    }
+  }
+}
+</style>

+ 87 - 41
src/views/home/data.js

@@ -1,5 +1,44 @@
 
+// 引入Day.js库
+// const dayjs = require('dayjs');
+// var quarterOfYear = require('dayjs/plugin/quarterOfYear');
+// dayjs.extend(quarterOfYear);
+// // 获取本月日期列表的函数
+// function getDatesInMonth() {
+//     let year = dayjs().year()
+//     let month = dayjs().month()
+//     const dates = [];
+//     const startDate = dayjs(new Date(year, month, 1));
+//     const endDate = dayjs(new Date(year, month + 1, 1)).subtract(1, 'day');
+//     let currentDate = startDate;
+//     while (currentDate.isBefore(endDate) || currentDate.isSame(endDate, 'day')) {
+//         dates.push(currentDate.format('YYYY-MM-DD'));
+//         currentDate = currentDate.add(1, 'day');
+//     }
+//     return dates;
+// }
+// // 获取当前日期
 
+// // 获取季度 (1-4)
+// function getQuarter() {
+//     const now = dayjs();
+//     const quarter = now.quarter();
+//     const dates = [];
+//     let start = (quarter - 1) * 3 + 1
+//     for (let i = 0; i <= 2; i++) {
+//         dates.push((start + i) + '月')
+//     }
+//     console.log(dates)
+//     return dates;
+// }
+function getRandomNumber(type) {
+    let arr=[]
+    let j=type==1?5:type==2?4:12
+    for(let i=0;i<j;i++){
+        arr.push(Math.floor(Math.random() * 60))
+    }
+    return arr
+}
 export const repaireOptions = [
     {
         title: '巡点检工单',
@@ -18,6 +57,12 @@ export const repaireOptions = [
         imgUrl: require('../../assets/vector.png'),
         total: 0,
         num: 0
+    },
+    {
+        title: '校准校验工单',
+        imgUrl: require('../../assets/vector.png'),
+        total: 0,
+        num: 0
     }
 ]
 export const statusList = [
@@ -27,14 +72,14 @@ export const statusList = [
         numUrl: require('../../assets/num3.png'),
         color: '#07AF2E ',
         num: 0,
-        code:'runNumber',
+        code: 'runNumber',
     },
     {
         title: '维修',
         color: '#9F9F9F',
         titleUrl: require('../../assets/title1.png'),
         numUrl: require('../../assets/num1.png'),
-        code:'repairNumber',
+        code: 'repairNumber',
         num: 0
     },
     {
@@ -42,7 +87,7 @@ export const statusList = [
         color: '#C14E4D ',
         titleUrl: require('../../assets/title2.png'),
         numUrl: require('../../assets/num2.png'),
-        code:'faultNumber',
+        code: 'faultNumber',
         num: 0
     },
 
@@ -51,7 +96,7 @@ export const statusList = [
         color: '#F4C15E',
         titleUrl: require('../../assets/title4.png'),
         numUrl: require('../../assets/num4.png'),
-        code:'shutdownNumber',
+        code: 'shutdownNumber',
         num: 0
     }
 ]
@@ -77,34 +122,34 @@ export const rankList = [
 
 
 ];
-export const planList = [
-    {
-        label: '类型',
-        prop: 'type',
-        width: '13%',
-    },
+// export const planList = [
+//     {
+//         label: '类型',
+//         prop: 'type',
+//         width: '13%',
+//     },
 
-    {
-        prop: 'code',
-        label: '编码',
-        width: '30%',
-    },
-    {
-        prop: 'title',
-        label: '标题',
-        width: '30%',
-    },
-    {
-        prop: 'userName',
-        label: '申请人',
-        width: '17%',
-    },
-    {
-        prop: 'action',
-        label: '操作',
-        width: '10%',
-    },
-];
+//     {
+//         prop: 'code',
+//         label: '编码',
+//         width: '30%',
+//     },
+//     {
+//         prop: 'title',
+//         label: '标题',
+//         width: '30%',
+//     },
+//     {
+//         prop: 'userName',
+//         label: '申请人',
+//         width: '17%',
+//     },
+//     {
+//         prop: 'action',
+//         label: '操作',
+//         width: '10%',
+//     },
+// ];
 
 export const barOption = (data, itemStyle = {}) => {
     return {
@@ -232,7 +277,7 @@ export const pieOption1 = (data) => {
     }
 }
 
-export const lineOption = (data) => {
+export const lineOption = (type) => {
     return {
 
         tooltip: {
@@ -257,7 +302,7 @@ export const lineOption = (data) => {
                 fontSize: window.innerHeight * 0.012,
 
             },
-            data: [2020, 2021, 2022, 2023, 2024]
+            data: type == 1 ? [2020, 2021, 2022, 2023, 2024] : type == 2 ? ['1季度','2季度','3季度','4季度',] : ['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月',]
         },
         yAxis: {
             type: 'value'
@@ -265,20 +310,21 @@ export const lineOption = (data) => {
         series: [
             {
                 name: '班组一',
-                data: [40, 45, 36, 45, 56],
-                type: 'line'
+                data: getRandomNumber(type),
+                type: 'line',
+                smooth: true,
             }, {
                 name: '班组二',
-                data: [32, 33, 43, 56, 46],
-                type: 'line'
+                data: getRandomNumber(type),
+                type: 'line', smooth: true,
             }, {
                 name: '班组三',
-                data: [47, 43, 41, 65, 36],
-                type: 'line'
+                data: getRandomNumber(type),
+                type: 'line', smooth: true,
             }, {
                 name: '班组四',
-                data: [51, 56, 39, 54, 41],
-                type: 'line'
+                data: getRandomNumber(type),
+                type: 'line', smooth: true,
             }
         ]
     }

+ 98 - 71
src/views/home/index.vue

@@ -144,7 +144,7 @@
               <div class="tableList" ref="rankTableList">
                 <vue-seamless-scroll
                   :data="rankData"
-                  :class-option="seamlessScrollOption2"
+                  :class-option="seamlessScrollOption"
                   class="scroll_box"
                 >
                   <div
@@ -168,13 +168,22 @@
           </el-card>
         </div>
 
-        <el-card class="box-card" style="height: 35%; margin-top: 15px">
+        <el-card class="box-card" style="height: 60%; margin-top: 15px">
           <div slot="header" class="clearfix">
             <span>班组维修消耗费用趋势(万元)</span>
+            <el-radio-group
+              style="margin-left: 15px"
+              v-model="timeType"
+              @change="timeTypeChange()"
+            >
+              <el-radio-button label="3">月度</el-radio-button>
+              <el-radio-button label="2">季度</el-radio-button>
+              <el-radio-button label="1">年度</el-radio-button>
+            </el-radio-group>
           </div>
           <v-chart ref="lineRef" style="height: 100%" :option="lineOption" />
         </el-card>
-        <el-card class="box-card" style="height: calc(25% - 15px)">
+        <!-- <el-card class="box-card" style="height: calc(25% - 15px)">
           <div slot="header" class="clearfix">
             <span>待处理</span>
           </div>
@@ -234,7 +243,7 @@
               </vue-seamless-scroll>
             </div>
           </div>
-        </el-card>
+        </el-card> -->
       </el-col>
     </el-row>
   </div>
@@ -243,7 +252,7 @@
 import vueSeamlessScroll from 'vue-seamless-scroll';
 
 import {
-  planList,
+  // planList,
   statusList,
   rankList,
   repaireOptions,
@@ -263,7 +272,12 @@ import {
 
 import VChart from 'vue-echarts';
 import { echartsMixin } from '@/utils/echarts-mixin';
-import { listInspection,queryRunStatus } from '@/api/main';
+import {
+  listInspection,
+  queryRunStatus,
+  queryGroupName,
+  queryDevice
+} from '@/api/main';
 // 按需加载 echarts
 use([
   CanvasRenderer,
@@ -288,40 +302,41 @@ export default {
   mixins: [echartsMixin(['barRef', 'pieRef', 'lineRef'])],
   data() {
     return {
-      planList,
+      timeType: '3',
+      // planList,
       tabPosition: '个人',
-      planData: [
-        {
-          type: '审批',
-          code: 'XA123451',
-          title: '巡查点计划1',
-          userName: '李杰3213213123213123123'
-        },
-        {
-          type: '审批',
-          code: 'XA123452',
-          title: '巡查点计划2',
-          userName: '李杰'
-        },
-        {
-          type: '审批',
-          code: 'XA123453',
-          title: '巡查点计划3',
-          userName: '李杰'
-        },
-        {
-          type: '审批',
-          code: 'XA123454',
-          title: '巡查点计划4',
-          userName: '李杰'
-        },
-        {
-          type: '审批',
-          code: 'XA123455',
-          title: '巡查点计划5',
-          userName: '李杰'
-        }
-      ],
+      // planData: [
+      //   {
+      //     type: '审批',
+      //     code: 'XA123451',
+      //     title: '巡查点计划1',
+      //     userName: '李杰3213213123213123123'
+      //   },
+      //   {
+      //     type: '审批',
+      //     code: 'XA123452',
+      //     title: '巡查点计划2',
+      //     userName: '李杰'
+      //   },
+      //   {
+      //     type: '审批',
+      //     code: 'XA123453',
+      //     title: '巡查点计划3',
+      //     userName: '李杰'
+      //   },
+      //   {
+      //     type: '审批',
+      //     code: 'XA123454',
+      //     title: '巡查点计划4',
+      //     userName: '李杰'
+      //   },
+      //   {
+      //     type: '审批',
+      //     code: 'XA123455',
+      //     title: '巡查点计划5',
+      //     userName: '李杰'
+      //   }
+      // ],
 
       rankData: [
         {
@@ -413,7 +428,7 @@ export default {
       repaireOptions,
       date: new Date(),
       seamlessScrollOption: JSON.parse(JSON.stringify(seamlessScrollOption)),
-      seamlessScrollOption2: JSON.parse(JSON.stringify(seamlessScrollOption)),
+      // seamlessScrollOption2: JSON.parse(JSON.stringify(seamlessScrollOption)),
       barEquipmentFailureOption: {},
       pieEquipmentFailureOption: {},
       lineOption: {},
@@ -425,22 +440,6 @@ export default {
     VChart
   },
   created() {
-    this.barEquipmentFailureOption = barOption([
-      { name: '轴承', value: '45' },
-      { name: '升降机', value: '25' },
-      { name: '冲压杆', value: '18' },
-      { name: '冷却水管', value: '36' },
-      { name: '液压机', value: '21' },
-      { name: '电机', value: '42' },
-      { name: '水泵机', value: '38' }
-    ]);
-    this.pieEquipmentFailureOption = pieOption([
-      { name: '部门1', value: '45' },
-      { name: '部门2', value: '25' },
-      { name: '部门3', value: '18' },
-      { name: '部门4', value: '36' },
-      { name: '部门5', value: '21' }
-    ]);
     this.pieSparePartOption = pieOption1([
       {
         value: '2',
@@ -459,8 +458,11 @@ export default {
         name: '总装'
       }
     ]);
-    this.lineOption = lineOption();
-    this.queryRunStatus()
+
+    this.queryRunStatus();
+    this.timeTypeChange();
+    this.queryGroupName();
+    this.queryDevice();
   },
   methods: {
     //工单信息
@@ -473,26 +475,52 @@ export default {
         this.repaireOptions[index].num = item.finishNumber;
       });
     },
-    queryRunStatus(){
-      queryRunStatus().then(res=>{
-        this.statusList.forEach(item=>{
-          item.num=res[item.code]
+    async queryGroupName() {
+      const data = await queryGroupName();
+      this.pieEquipmentFailureOption = pieOption(
+        data.map((item) => {
+          return {
+            name: item.groupName,
+            value: item.failureRate
+          };
         })
-
-      })
+      );
+    },
+    async queryDevice() {
+      const data = await queryDevice();
+      this.barEquipmentFailureOption = barOption([
+        { name: '轴承', value: '45' },
+        { name: '升降机', value: '25' },
+        { name: '冲压杆', value: '18' },
+        { name: '冷却水管', value: '36' },
+        { name: '液压机', value: '21' },
+        { name: '电机', value: '42' },
+        { name: '水泵机', value: '38' }
+      ]);
+      console.log(data);
+    },
+    queryRunStatus() {
+      queryRunStatus().then((res) => {
+        this.statusList.forEach((item) => {
+          item.num = res[item.code];
+        });
+      });
     },
     handelRouterTo(path) {
       window.history.pushState(null, '', path);
+    },
+    timeTypeChange() {
+      this.lineOption = lineOption(this.timeType);
     }
   },
   mounted() {
     this.getListInspection();
     this.seamlessScrollOption.limitMoveNum = parseInt(
-      this.$refs.planTableList.clientHeight / 25
-    );
-    this.seamlessScrollOption2.limitMoveNum = parseInt(
       this.$refs.rankTableList.clientHeight / 25
     );
+    // this.seamlessScrollOption2.limitMoveNum = parseInt(
+    //   this.$refs.rankTableList.clientHeight / 25
+    // );
   }
 };
 </script>
@@ -573,7 +601,7 @@ export default {
       height: 99%;
     }
     .sparePart {
-      font-size: 0.70vw;
+      font-size: 0.7vw;
       font-weight: bold;
       position: absolute;
       display: flex;
@@ -691,10 +719,9 @@ export default {
           font-size: 0.6vw;
           display: flex;
           align-items: center;
-          span:nth-of-type(1){
-            margin-right: .6vw;
+          span:nth-of-type(1) {
+            margin-right: 0.6vw;
             font-size: 0.9vw;
-
           }
           // top:15px
         }

+ 10 - 12
src/views/ledgerAssets/components/assetInformation.vue

@@ -98,27 +98,27 @@
             <template slot="label"> 权属部门 </template>
             <el-form-item label-width="0">
               <div class="input">
-                <el-input
+                <!-- <el-input
                   v-model="zcInfo.workstation.groupName"
                   disabled
                   placeholder="请输入内容"
-                ></el-input>
-                <!-- <DeptSelect
+                ></el-input> -->
+                <DeptSelect
                   v-model="zcInfo.ownershipGroupId"
                   @input="getqsbm"
-                /> -->
+                />
               </div>
             </el-form-item>
           </el-descriptions-item>
           <el-descriptions-item>
             <template slot="label"> 权属人 </template>
             <el-form-item label-width="0">
-              <el-input
+              <!-- <el-input
                 v-model="zcInfo.workstation.leaderName"
                 disabled
                 placeholder="请输入内容"
-              ></el-input>
-              <!-- <el-select
+              ></el-input> -->
+              <el-select
                 style="width: 100%"
                 v-model="zcInfo.ownershipUserId"
                 placeholder="请选择"
@@ -130,7 +130,7 @@
                   :value="item.id"
                 >
                 </el-option>
-              </el-select> -->
+              </el-select>
             </el-form-item>
           </el-descriptions-item>
 
@@ -194,8 +194,6 @@
             </el-form-item>
           </el-descriptions-item>
 
-      
-         
           <el-descriptions-item>
             <template slot="label"> 类型 </template>
             <el-form-item label-width="0">
@@ -375,7 +373,7 @@ export default {
       labelStyle: {
         width: '180px'
       },
-   
+
       pageType: 'add',
       id: '', // 设备主键id
       rules: {
@@ -572,7 +570,7 @@ export default {
         this.options.ownershipUserId = data.list;
       }
     },
-  
+
     // 初始化
     async initData() {
       console.log('this.zcInfo---------------------', this.zcInfo);

+ 1 - 1
src/views/maintenance/components/MaterialAdd.vue

@@ -47,7 +47,7 @@
               <span>{{ row.category.specification }}</span>
             </template>
             <template v-slot:pathName="{ row }">
-              <span>{{ row.position[0].pathName }}</span>
+              <span>{{ row.position[0]&&row.position[0].pathName }}</span>
             </template>
           </ele-pro-table>
         </template>

+ 15 - 11
src/views/maintenance/components/programRulesDialog.vue

@@ -6,7 +6,7 @@
     :append-to-body="true"
     custom-class="ele-dialog-form"
     :title="dialogTitle"
-    @update:visible="updateVisible"
+  
   >
     <header-title title="基本信息"></header-title>
     <el-form
@@ -422,10 +422,10 @@
           return '新增巡检点计划配置';
         }
       },
-      visible: {
-        type: Boolean,
-        default: false
-      }
+      // visible: {
+      //   type: Boolean,
+      //   default: false
+      // }
     },
     data() {
       const defaultForm = {
@@ -440,6 +440,7 @@
         bomList: []
       };
       return {
+        visible:false,
         ruleIndex: 0, // 规则index
         ruleId: '',
         formLabel: '',
@@ -619,6 +620,7 @@
       async init(row, tips) {
         console.log(row);
         console.log(tips);
+        this.visible=true;
         if (row) {
           this.getInfo(row.id, tips);
         } else {
@@ -693,8 +695,8 @@
                     deviceId: item.id,
                     codeNumber: item.codeNumber,
                     // equiModel: item.modelType,
-                    equiLocation: item.position[0].pathName,
-                    equiLocationCode: item.position[0].pathIds,
+                    equiLocation: item.position[0]&&item.position[0].pathName,
+                    equiLocationCode: item.position[0]&&item.position[0].pathIds,
                     workItems: ruleItem.ruleItems ? ruleItem.ruleItems : []
                     // categoryId: item.category.categoryLevelId,
                     // categoryName: item.category.categoryLevelName
@@ -730,6 +732,8 @@
                 if (res) {
                   this.$message.success(type + '成功!');
                   this.$emit('done');
+                  this.visible=false
+
                 }
               } catch (error) {
                 this.$message.error(type + '失败!');
@@ -991,10 +995,10 @@
         this.$refs.productRefs.open(ruleIdList, ruleIdListIndex);
       },
 
-      /* 更新visible */
-      updateVisible(value) {
-        this.$emit('update:visible', value);
-      },
+      // /* 更新visible */
+      // updateVisible(value) {
+      //   this.$emit('update:visible', value);
+      // },
 
       handleAddTab() {
         this.tableData = this.tabsList;

+ 7 - 1
src/views/maintenance/equipment/workOrder/details.vue

@@ -275,7 +275,8 @@
             </div> -->
           </div>
         </div>
-
+        <HeaderTitle title="备品备件申请单" size="16px"></HeaderTitle>
+       <editd :id="infoData.id" />
         <!-- 巡点检、缺陷设备报修记录 -->
         <!-- <div class="repair_notes">
           <HeaderTitle title="缺陷设备报修记录" size="16px"></HeaderTitle>
@@ -318,8 +319,13 @@
 <script>
   import dictMixins from '@/mixins/dictMixins';
   import { getWordOrderDetail } from '@/api/maintenance/patrol_maintenance';
+  import editd from '@/views/sparePartsApply/components/editd';
+
   export default {
     mixins: [dictMixins],
+    components:{
+      editd
+    },
     data() {
       return {
         options: {

+ 204 - 179
src/views/maintenance/equipment/workOrder/index.vue

@@ -28,6 +28,14 @@
         </template>
         <!-- 操作列 -->
         <template v-slot:action="{ row }">
+          <el-link
+            type="primary"
+            :underline="false"
+            icon="el-icon-truck"
+            @click="addSpareItems(row)"
+          >
+            申请备品备件
+          </el-link>
           <el-link
             v-if="row.orderStatus !== 3 && row.orderStatus !== 4"
             type="primary"
@@ -55,195 +63,212 @@
     <redeployOther ref="redeployOtherRef" @refresh="reload" />
     <!-- 报工弹框 -->
     <signingUpWork ref="signingUpWorkRef" @refresh="reload" />
+    <edit @refresh="reload" ref="edit" />
   </div>
 </template>
 
 <script>
-  import WorkSearch from './components/work-search.vue';
-  // import { pageRoles } from '@/api/system/role';
-  import { workPage } from '@/api/equipment/work';
-  import redeployOther from '@/views/maintenance/components/redeployOther.vue';
-  import signingUpWork from '@/views/maintenance/components/signingUpWork.vue';
-  export default {
-    components: {
-      WorkSearch,
-      redeployOther,
-      signingUpWork
-    },
-    data() {
-      return {
-        // 表格列配置
-        columns: [
-          {
-            columnKey: 'index',
-            label: '序号',
-            type: 'index',
-            width: 55,
-            align: 'center',
-            showOverflowTooltip: true,
-            fixed: 'left'
-          },
-          {
-            columnKey: 'code',
-            slot: 'code',
-            prop: 'code',
-            label: '工单单号',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 140
-          },
-          {
-            prop: 'planCode',
-            label: '计划单号',
-            align: 'center',
-            showOverflowTooltip: true,
-            slot: 'planCode',
-            minWidth: 140
-          },
-          {
-            prop: 'planName',
-            label: '保养名称',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 120
-          },
-          {
-            prop: 'executeGroupName',
-            label: '保养部门',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 120
-          },
-          {
-            prop: 'executeUserName',
-            label: '保养人员',
-            align: 'center',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'ruleName',
-            label: '规则名称',
-            align: 'center',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'createTime',
-            label: '工单生成时间',
-            // sortable: true,
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 170
-          },
-          {
-            prop: 'acceptTime',
-            label: '开工时间',
-            align: 'center',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'finishTime',
-            label: '报工时间',
-            align: 'center',
-            showOverflowTooltip: true
-          },
-          {
-            columnKey: 'orderHour',
-            label: '实际工时(分钟)',
-            align: 'center',
-            resizable: false,
-            showOverflowTooltip: true,
-            minWidth: 120,
-            formatter: (row) => {
-              if (row.finishTime && row.acceptTime) {
-                return parseInt(
-                  (new Date(row.finishTime).getTime() -
-                    new Date(row.acceptTime).getTime()) /
-                    60000
-                );
-              }
-            }
-          },
-          {
-            prop: 'orderStatus',
-            label: '状态',
-            align: 'center',
-            showOverflowTooltip: true,
-            formatter: (row) => {
-              return {
-                0: '待接收',
-                1: '已接收',
-                2: '执行中',
-                3: '已完成'
-              }[row.orderStatus];
-            }
-          },
-          {
-            prop: 'executeResult',
-            label: '执行结果',
-            align: 'center',
-            showOverflowTooltip: true,
-            formatter(row) {
-              return { 0: '缺陷', 1: '正常' }[row.isAbnormal];
+import WorkSearch from './components/work-search.vue';
+// import { pageRoles } from '@/api/system/role';
+import edit from '@/views/sparePartsApply/components/edit';
+import { workPage } from '@/api/equipment/work';
+import redeployOther from '@/views/maintenance/components/redeployOther.vue';
+import signingUpWork from '@/views/maintenance/components/signingUpWork.vue';
+import { getWordOrderDetail } from '@/api/maintenance/patrol_maintenance';
+
+export default {
+  components: {
+    WorkSearch,
+    redeployOther,
+    signingUpWork,
+    edit
+  },
+  data() {
+    return {
+      // 表格列配置
+      columns: [
+        {
+          columnKey: 'index',
+          label: '序号',
+          type: 'index',
+          width: 55,
+          align: 'center',
+          showOverflowTooltip: true,
+          fixed: 'left'
+        },
+        {
+          columnKey: 'code',
+          slot: 'code',
+          prop: 'code',
+          label: '工单单号',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 140
+        },
+        {
+          prop: 'planCode',
+          label: '计划单号',
+          align: 'center',
+          showOverflowTooltip: true,
+          slot: 'planCode',
+          minWidth: 140
+        },
+        {
+          prop: 'planName',
+          label: '保养名称',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 120
+        },
+        {
+          prop: 'executeGroupName',
+          label: '保养部门',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 120
+        },
+        {
+          prop: 'executeUserName',
+          label: '保养人员',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'ruleName',
+          label: '规则名称',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'createTime',
+          label: '工单生成时间',
+          // sortable: true,
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 170
+        },
+        {
+          prop: 'acceptTime',
+          label: '开工时间',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'finishTime',
+          label: '报工时间',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          columnKey: 'orderHour',
+          label: '实际工时(分钟)',
+          align: 'center',
+          resizable: false,
+          showOverflowTooltip: true,
+          minWidth: 120,
+          formatter: (row) => {
+            if (row.finishTime && row.acceptTime) {
+              return parseInt(
+                (new Date(row.finishTime).getTime() -
+                  new Date(row.acceptTime).getTime()) /
+                  60000
+              );
             }
-          },
-          {
-            columnKey: 'action',
-            label: '操作',
-            width: 150,
-            align: 'center',
-            resizable: false,
-            slot: 'action',
-            showOverflowTooltip: true
           }
-        ],
-        // 加载状态
-        loading: false,
-        pageType: 'add',
-        dialogTitle: '',
-        isBindPlan: false
-      };
-    },
-    computed: {},
-    methods: {
-      /* 表格数据源 */
-      datasource({ page, limit, where, order }) {
-        where.type = 2;
-        return workPage({ pageNum: page, size: limit, ...where });
-      },
-      async changeEnable(row) {
-        const res = await putRoles(row);
-        if (res.code == 0) {
-          this.$message({
-            type: 'success',
-            message: '修改成功',
-            customClass: 'ele-message-border'
-          });
-          this.reload();
-        }
-      },
-      /* 刷新表格 */
-      reload(where) {
-        this.$refs.table.reload({ page: 1, where });
-      },
-
-      goDetail({ id }) {
-        this.$router.push({
-          path: '/maintenance/equipment/workOrder/details',
-          query: {
-            id
+        },
+        {
+          prop: 'orderStatus',
+          label: '状态',
+          align: 'center',
+          showOverflowTooltip: true,
+          formatter: (row) => {
+            return {
+              0: '待接收',
+              1: '已接收',
+              2: '执行中',
+              3: '已完成'
+            }[row.orderStatus];
+          }
+        },
+        {
+          prop: 'executeResult',
+          label: '执行结果',
+          align: 'center',
+          showOverflowTooltip: true,
+          formatter(row) {
+            return { 0: '缺陷', 1: '正常' }[row.isAbnormal];
           }
+        },
+        {
+          columnKey: 'action',
+          label: '操作',
+          width: 240,
+          align: 'center',
+          resizable: false,
+          slot: 'action',
+          showOverflowTooltip: true
+        }
+      ],
+      // 加载状态
+      loading: false,
+      pageType: 'add',
+      dialogTitle: '',
+      isBindPlan: false
+    };
+  },
+  computed: {},
+  methods: {
+    /* 表格数据源 */
+    datasource({ page, limit, where, order }) {
+      where.type = 2;
+      return workPage({ pageNum: page, size: limit, ...where });
+    },
+    async changeEnable(row) {
+      const res = await putRoles(row);
+      if (res.code == 0) {
+        this.$message({
+          type: 'success',
+          message: '修改成功',
+          customClass: 'ele-message-border'
         });
-      },
-      // 转派
-      toRedeploy(row) {
-        this.$refs.redeployOtherRef.open(row);
-      },
-      // 报工
-      toSigningUpWork(row) {
-        this.$refs.signingUpWorkRef.open(row);
+        this.reload();
       }
+    },
+    /* 刷新表格 */
+    reload(where) {
+      this.$refs.table.reload({ page: 1, where });
+    },
+    // 添加备品备件
+    async addSpareItems(row) {
+      let data = await getWordOrderDetail(row.id);
+      data['sparePartsApplyList'] = data.deviceList.map((item) => {
+        return {
+          deviceName: item.substance.name,
+          fixCode: item.substance.fixCode,
+          deviceCode: item.substance.code
+        };
+      });
+
+      this.$refs.edit.open(data, 'add');
+    },
+    goDetail({ id }) {
+      this.$router.push({
+        path: '/maintenance/equipment/workOrder/details',
+        query: {
+          id
+        }
+      });
+    },
+    // 转派
+    toRedeploy(row) {
+      this.$refs.redeployOtherRef.open(row);
+    },
+    // 报工
+    toSigningUpWork(row) {
+      this.$refs.signingUpWorkRef.open(row);
     }
-  };
+  }
+};
 </script>
 
 <style lang="scss" scoped></style>

+ 7 - 0
src/views/maintenance/patrol/workOrder/details.vue

@@ -275,6 +275,8 @@
             </div> -->
           </div>
         </div>
+        <HeaderTitle title="备品备件申请单" size="16px"></HeaderTitle>
+       <editd :id="infoData.id" />
 
         <!-- 巡点检、缺陷设备报修记录 -->
         <!-- <div class="repair_notes">
@@ -318,7 +320,12 @@
 <script>
   import dictMixins from '@/mixins/dictMixins';
   import { getWordOrderDetail } from '@/api/maintenance/patrol_maintenance';
+  import editd from '@/views/sparePartsApply/components/editd';
+
   export default {
+    components:{
+      editd
+    },
     mixins: [dictMixins],
     data() {
       return {

+ 216 - 186
src/views/maintenance/patrol/workOrder/index.vue

@@ -17,6 +17,14 @@
         </template>
         <!-- 操作列 -->
         <template v-slot:action="{ row }">
+          <el-link
+            type="primary"
+            :underline="false"
+            icon="el-icon-truck"
+            @click="addSpareItems(row)"
+          >
+            申请备品备件
+          </el-link>
           <el-link
             v-if="row.orderStatus !== 3 && row.orderStatus !== 4"
             type="primary"
@@ -44,202 +52,224 @@
     <redeployOther ref="redeployOtherRef" @refresh="reload" />
     <!-- 报工弹框 -->
     <signingUpWork ref="signingUpWorkRef" @refresh="reload" />
+    <edit @refresh="reload" ref="edit" />
   </div>
 </template>
 
 <script>
-  import WorkSearch from './components/work-search.vue';
-  import redeployOther from '@/views/maintenance/components/redeployOther.vue';
-  import signingUpWork from '@/views/maintenance/components/signingUpWork.vue';
-  import { getWorkOrderPage } from '@/api/maintenance/patrol_maintenance';
-  import dictMixins from '@/mixins/dictMixins';
-  export default {
-    components: {
-      WorkSearch,
-      redeployOther,
-      signingUpWork
-    },
-    mixins: [dictMixins],
-    data() {
-      return {
-        // 表格列配置
-        columns: [
-          {
-            columnKey: 'index',
-            label: '序号',
-            type: 'index',
-            width: 55,
-            align: 'center',
-            showOverflowTooltip: true,
-            fixed: 'left'
-          },
-          {
-            columnKey: 'code',
-            slot: 'code',
-            prop: 'code',
-            label: '工单单号',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 140
-          },
-          {
-            prop: 'planCode',
-            label: '计划单号',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 140
-          },
-          {
-            prop: 'planName',
-            label: '巡点检名称',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 120
-          },
-          {
-            prop: 'executeGroupName',
-            label: '巡点检部门',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 120
-          },
-          {
-            prop: 'executeUserName',
-            label: '巡点检人员',
-            align: 'center',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'ruleName',
-            label: '规则名称',
-            align: 'center',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'createTime',
-            label: '工单生成时间',
-            align: 'center',
-            // sortable: true,
-            showOverflowTooltip: true,
-            width: 170
-          },
-          {
-            prop: 'acceptTime',
-            label: '开工时间',
-            align: 'center',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'finishTime',
-            label: '报工时间',
-            align: 'center',
-            showOverflowTooltip: true
-          },
-          {
-            columnKey: 'orderHour',
-            label: '实际工时(分钟)',
-            align: 'center',
-            resizable: false,
-            showOverflowTooltip: true,
-            minWidth: 120,
-            formatter: (row) => {
-              if (row.finishTime && row.acceptTime) {
-                return parseInt(
-                  (new Date(row.finishTime).getTime() -
-                    new Date(row.acceptTime).getTime()) /
-                    60000
-                );
-              }
-            }
-          },
-          {
-            prop: 'orderStatus',
-            label: '状态',
-            align: 'center',
-            showOverflowTooltip: true,
-            formatter: (row) => {
-              return {
-                0: '待接收',
-                1: '已接收',
-                2: '执行中',
-                3: '已完成'
-              }[row.orderStatus];
-            }
-          },
-          {
-            prop: 'acceptanceStatus',
-            label: '执行结果',
-            align: 'center',
-            showOverflowTooltip: true,
-            formatter(row) {
-              return { 0: '缺陷', 1: '正常' }[row.isAbnormal];
+import edit from '@/views/sparePartsApply/components/edit';
+import WorkSearch from './components/work-search.vue';
+import redeployOther from '@/views/maintenance/components/redeployOther.vue';
+import signingUpWork from '@/views/maintenance/components/signingUpWork.vue';
+import {
+  getWorkOrderPage,
+  getWordOrderDetail
+} from '@/api/maintenance/patrol_maintenance';
+
+import dictMixins from '@/mixins/dictMixins';
+export default {
+  components: {
+    WorkSearch,
+    redeployOther,
+    signingUpWork,
+    edit
+  },
+  mixins: [dictMixins],
+  data() {
+    return {
+      // 表格列配置
+      columns: [
+        {
+          columnKey: 'index',
+          label: '序号',
+          type: 'index',
+          width: 55,
+          align: 'center',
+          showOverflowTooltip: true,
+          fixed: 'left'
+        },
+        {
+          columnKey: 'code',
+          slot: 'code',
+          prop: 'code',
+          label: '工单单号',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 140
+        },
+        {
+          prop: 'planCode',
+          label: '计划单号',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 140
+        },
+        {
+          prop: 'planName',
+          label: '巡点检名称',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 120
+        },
+        {
+          prop: 'executeGroupName',
+          label: '巡点检部门',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 120
+        },
+        {
+          prop: 'executeUserName',
+          label: '巡点检人员',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'ruleName',
+          label: '规则名称',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'createTime',
+          label: '工单生成时间',
+          align: 'center',
+          // sortable: true,
+          showOverflowTooltip: true,
+          width: 170
+        },
+        {
+          prop: 'acceptTime',
+          label: '开工时间',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'finishTime',
+          label: '报工时间',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          columnKey: 'orderHour',
+          label: '实际工时(分钟)',
+          align: 'center',
+          resizable: false,
+          showOverflowTooltip: true,
+          minWidth: 120,
+          formatter: (row) => {
+            if (row.finishTime && row.acceptTime) {
+              return parseInt(
+                (new Date(row.finishTime).getTime() -
+                  new Date(row.acceptTime).getTime()) /
+                  60000
+              );
             }
-          },
-          {
-            columnKey: 'action',
-            label: '操作',
-            width: 150,
-            align: 'center',
-            resizable: false,
-            slot: 'action',
-            showOverflowTooltip: true
           }
-        ],
-        // 加载状态
-        loading: false,
-        pageType: 'add',
-        dialogTitle: '',
-        isBindPlan: false
-      };
-    },
-    created() {
-      this.requestDict('巡点检工单状态');
-    },
-    computed: {},
-    methods: {
-      /* 表格数据源 */
-      datasource({ page, limit, where, order }) {
-        return getWorkOrderPage({
-          pageNum: page,
-          size: limit,
-          ...where,
-          type: 1
-        });
-      },
-      async changeEnable(row) {
-        const res = await putRoles(row);
-        if (res.code == 0) {
-          this.$message({
-            type: 'success',
-            message: '修改成功',
-            customClass: 'ele-message-border'
-          });
-          this.reload();
-        }
-      },
-      /* 刷新表格 */
-      reload(where) {
-        this.$refs.table.reload({ page: 1, where });
-      },
-
-      goDetail({ id }) {
-        this.$router.push({
-          path: '/maintenance/patrol/workOrder/details',
-          query: {
-            id
+        },
+        {
+          prop: 'orderStatus',
+          label: '状态',
+          align: 'center',
+          showOverflowTooltip: true,
+          formatter: (row) => {
+            return {
+              0: '待接收',
+              1: '已接收',
+              2: '执行中',
+              3: '已完成'
+            }[row.orderStatus];
+          }
+        },
+        {
+          prop: 'acceptanceStatus',
+          label: '执行结果',
+          align: 'center',
+          showOverflowTooltip: true,
+          formatter(row) {
+            return { 0: '缺陷', 1: '正常' }[row.isAbnormal];
           }
+        },
+        {
+          columnKey: 'action',
+          label: '操作',
+          width: 240,
+          align: 'center',
+          resizable: false,
+          slot: 'action',
+          showOverflowTooltip: true
+        }
+      ],
+      // 加载状态
+      loading: false,
+      pageType: 'add',
+      dialogTitle: '',
+      isBindPlan: false
+    };
+  },
+  created() {
+    this.requestDict('巡点检工单状态');
+  },
+  computed: {},
+  methods: {
+    /* 表格数据源 */
+    datasource({ page, limit, where, order }) {
+      return getWorkOrderPage({
+        pageNum: page,
+        size: limit,
+        ...where,
+        type: 1
+      });
+    },
+    async changeEnable(row) {
+      const res = await putRoles(row);
+      if (res.code == 0) {
+        this.$message({
+          type: 'success',
+          message: '修改成功',
+          customClass: 'ele-message-border'
         });
-      },
-      // 转派
-      toRedeploy(row) {
-        this.$refs.redeployOtherRef.open(row);
-      },
-      // 报工
-      toSigningUpWork(row) {
-        this.$refs.signingUpWorkRef.open(row);
+        this.reload();
       }
+    },
+    /* 刷新表格 */
+    reload(where) {
+      this.$refs.table.reload({ page: 1, where });
+    },
+    // this.form.deviceName = row.substanceDetailVO.name;
+    //       this.form.fixCode = row.substanceDetailVO.fixCode;
+    //       this.form.deviceCode = row.substanceDetailVO.codeNumber;
+    // 添加备品备件
+    async addSpareItems(row) {
+      let data = await getWordOrderDetail(row.id);
+      data['sparePartsApplyList']=data.deviceList.map(item=>{
+        return  {
+          deviceName:item.substance.name,
+          fixCode:item.substance.fixCode,
+          deviceCode:item.substance.code,
+        }
+      })
+ 
+      this.$refs.edit.open(data, 'add');
+    },
+    goDetail({ id }) {
+      this.$router.push({
+        path: '/maintenance/patrol/workOrder/details',
+        query: {
+          id
+        }
+      });
+    },
+    // 转派
+    toRedeploy(row) {
+      this.$refs.redeployOtherRef.open(row);
+    },
+    // 报工
+    toSigningUpWork(row) {
+      this.$refs.signingUpWorkRef.open(row);
     }
-  };
+  }
+};
 </script>
 
 <style lang="scss" scoped></style>

+ 6 - 1
src/views/maintenance/repair/components/RepairDetailsDialog.vue

@@ -159,6 +159,9 @@
           </el-col>
         </el-row>
       </el-tab-pane>
+      <el-tab-pane label="备品备件申请单" name="sparePartsApply">
+       <editd :id="workOrderInfo.id" />
+      </el-tab-pane>
     </el-tabs>
 
     <el-tabs v-model="detailsTabsActiveName" type="border-card" v-else>
@@ -305,6 +308,7 @@
           :repairInfoLogList="repairInfoLogs"
           v-if="tabLabel === '维修信息'"
         />
+        
       </el-tab-pane>
     </el-tabs>
     <div class="btnbox" v-if="row.isshow">
@@ -355,10 +359,11 @@
   import { getRepairById } from '@/api/maintenance/repair_report';
   import { getWorkOrderDetail } from '@/api/maintenance/repair';
   import dictMixins from '@/mixins/dictMixins';
+  import editd from '@/views/sparePartsApply/components/editd';
   export default {
     mixins: [dictMixins],
     props: {},
-    components: { RepairNotesTab, WorkOrderTab },
+    components: { RepairNotesTab, WorkOrderTab,editd },
     data() {
       return {
         errorLoading: false,

+ 28 - 27
src/views/maintenance/repair/workOrder/index.vue

@@ -28,7 +28,7 @@
         <!-- 操作列 -->
         <template v-slot:action="{ row }">
           <el-link
-            v-if="row.orderStatus !== 3 && row.orderStatus !== 4"
+  
             type="primary"
             :underline="false"
             icon="el-icon-truck"
@@ -74,20 +74,23 @@
         </template>
       </ele-pro-table>
     </el-card>
+    <!-- <el-dialog :visible.sync="visible" width="20vw">
+      <el-form label-width="100px">
+     
+      ></el-form>
 
+      <div slot="footer">
+        <el-button type="primary" @click="spareItems">确定</el-button>
+        <el-button @click="visible = false">关闭</el-button>
+      </div>
+    </el-dialog> -->
     <RepairDetailsDialog ref="detailsDialogRef" />
     <!-- 报工弹窗 -->
     <RepairReportingWork ref="repairReportingWorkRef" @refresh="reload" />
     <!-- 转派弹窗 -->
     <redeployOther ref="redeployOtherRef" @refresh="reload" />
     <!-- 备件弹窗 -->
-    <AssetsDialog
-      ref="assetsDialogRef"
-      title="备品备件"
-      :warehousingMaterialList="selectionList"
-      :assetType="6"
-      @detailData="detailData"
-    />
+    <edit @refresh="reload" ref="edit" />
     <!-- <AddSpareDialog
       ref="addSpareDialogRef"
       :selectedSpare="selectedSpare"
@@ -100,15 +103,20 @@
 import { workorderStatus, resultStatus } from '@/utils/dict/operationManage';
 import WorkorderSearch from './components/workorder-search.vue';
 import AddSpareDialog from '@/components/addSpareDialog';
-import AssetsDialog from './components/AssetsDialog.vue';
+import edit from '@/views/sparePartsApply/components/edit';
 import RepairReportingWork from '../components/repairReportingWork.vue';
 import RepairDetailsDialog from '../components/RepairDetailsDialog.vue';
 import redeployOther from '@/views/maintenance/components/redeployOther.vue';
-import { getWorkOrderList, applySpareParts } from '@/api/maintenance/repair';
+import {
+  getWorkOrderList,
+  applySpareParts,
+  save
+} from '@/api/maintenance/repair';
 import outin from '@/api/maintenance/outin';
 import { getToken } from '@/utils/token-util';
 import { download } from '@/utils/file';
 import { API_BASE_URL } from '@/config/setting';
+
 import axios from 'axios';
 export default {
   components: {
@@ -117,7 +125,7 @@ export default {
     redeployOther,
     AddSpareDialog,
     RepairReportingWork,
-    AssetsDialog
+    edit
   },
   data() {
     return {
@@ -129,6 +137,7 @@ export default {
       materialCodeReqList: [],
       selectionList: [],
       wlParams: {},
+      visible: false,
       materialObj: {},
       // 表格列配置
       columns: [
@@ -269,8 +278,13 @@ export default {
       loading: false,
       pageType: 'add',
       dialogTitle: '',
-      isBindPlan: false
+      isBindPlan: false,
+      warehouseList: [],
+      warehouseId: ''
     };
+  },
+  created() {
+ 
   },
   methods: {
     downLoadOrder(row) {
@@ -347,22 +361,9 @@ export default {
     },
     // 添加备品备件
     addSpareItems(row) {
-      this.currentRow = row;
-      this.$refs.assetsDialogRef.open();
-
-      // this.$refs.addSpareDialogRef.open();
-      // if (!this.clickedTreeNode) {
-      //   return this.$message.warning('请选择设备分类!');
-      // }
-      // this.$refs.addSpareDialogRef.open();
-      // if (this.planRuleEquiList[this.currentEquItemIndex]['sparePart']) {
-      //   this.selectedSpare =
-      //     this.planRuleEquiList[this.currentEquItemIndex]['sparePart'];
-      // } else {
-      //   this.selectedSpare = [];
-      // }
-      // console.log('this.selectedSpare',this.selectedSpare)
+      this.$refs.edit.open(row,'add');
     },
+
     /* 表格数据源 */
     datasource({ page, limit, where, order }) {
       return getWorkOrderList({

+ 301 - 187
src/views/maintenance/repair/workOrder/components/AssetsDialog.vue → src/views/sparePartsApply/components/AssetsDialog.vue

@@ -1,7 +1,25 @@
 <template>
-  <el-dialog :visible.sync="visible" title="物品信息" width="80vw">
-    <el-form :model="searchForm" label-width="100px">
+  <el-dialog
+    :visible.sync="visible1"
+    :close-on-click-modal="true"
+    :close-on-press-escape="false"
+    append-to-body
+    width="80vw"
+  >
+    <el-form :model="searchForm" label-width="100px" >
       <el-row>
+        <el-col :span="6">
+          <el-form-item label="仓库名称:">
+            <el-select v-model="searchForm.warehouseId"  style="width: 100%">
+              <el-option
+                v-for="item in warehouseList"
+                :key="item.id"
+                :value="item.id"
+                :label="item.name"
+              ></el-option> </el-select
+          ></el-form-item>
+        </el-col>
+
         <el-col :span="6">
           <el-form-item label="列表维度:" prop="dimension">
             <template>
@@ -135,8 +153,8 @@
             label="规格"
             :show-overflow-tooltip="true"
           ></el-table-column>
-          <el-table-column
-            v-if="dimension == 1"
+          <!-- <el-table-column
+       
             label="出库数量"
             type="index"
             width="100"
@@ -149,9 +167,9 @@
                 @input="handleInput(row, $event)"
               ></el-input>
             </template>
-          </el-table-column>
+          </el-table-column> -->
           <el-table-column
-            v-else
+          v-if="dimension == 3"
             prop="batchNo"
             label="批次号"
             key="batchNo"
@@ -239,6 +257,20 @@
             :show-overflow-tooltip="true"
           ></el-table-column>
         </el-table>
+        <ele-pro-table
+          ref="table"
+          :columns="columns"
+          :datasource="tableList"
+          :selection.sync="selection"
+          row-key="id"
+          height="20vh"
+          :needPage="false"
+        >
+          <template v-slot:toolbar>
+            <el-button type="primary" size="small" @click="add">添加</el-button>
+            <el-button size="small" @click="del">移除</el-button></template
+          >
+        </ele-pro-table>
         <div style="text-align: right; padding: 10px">
           <el-pagination
             background
@@ -263,197 +295,279 @@
 </template>
 
 <script>
-  import storageApi from '@/api/warehouseManagement';
-  import AssetTree from './assetTree.vue';
-  export default {
-    components: { AssetTree },
-    props: {
-      treeIds: { type: Array, default: () => [] }
-    },
-    data() {
-      return {
-        isShowTable: true,
-        qualityResultOption: [
-          {
-            value: 0,
-            label: '合格'
-          },
-          {
-            value: 1,
-            label: '不合格'
-          }
-        ],
-        qualityStatusOption: [
-          {
-            value: 1,
-            label: '已质检'
-          },
-          {
-            value: 0,
-            label: '未质检'
-          }
-        ],
-        visible: false,
-        tableData: [],
-        total: 0,
-        categoryLevelId: '',
-        searchForm: {
-          categoryCode: '',
-          categoryName: '',
-          batchNo: '',
-          brandNum: '',
-          engrave: '',
-          barcodes: '',
-          categoryLevelId: '',
-          pageNum: 1,
-          size: 20
+import storageApi from '@/api/warehouseManagement';
+import AssetTree from './assetTree.vue';
+import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
+
+export default {
+  components: { AssetTree },
+  props: {
+    treeIds: { type: Array, default: () => [] }
+  },
+  data() {
+    return {
+      isShowTable: true,
+      qualityResultOption: [
+        {
+          value: 0,
+          label: '合格'
         },
-        selectionList: [],
-        materialType: '',
-        warehouseList: [],
-        dimension: '1'
-      };
-    },
-    created() {},
-    methods: {
-      getRowKeys(row) {
-        return row.id;
-      },
-      // 出库数量限制
-      handleInput(row, value) {
-        if (row.outboundNum <= row.measureQuantity) {
-          return (row.outboundNum = value.replace(/^(0+)|[^\d]+/g, ''));
-        } else {
-          row.outboundNum = row.measureQuantity;
+        {
+          value: 1,
+          label: '不合格'
         }
-      },
-      // 切换维度
-      changeDimensionHandler(e) {
-        this.searchForm.pageNum = 1;
-        this.selectionList = [];
-        this.$refs.multipleTable.clearSelection();
-        this.changeDimension(e);
-      },
-      async changeDimension(e) {
-        this.dimension = e;
-        if (this.dimension == 1) {
-          // 物品维度
-          const data = await storageApi.getProductList(this.searchForm);
-          this.tableData = data.list;
-          this.total = data.count;
-        } else if (this.dimension == 2) {
-          // 批次维度
-          const data = await storageApi.getBatchList(this.searchForm);
-          this.tableData = data.list;
-          this.total = data.count;
-        } else if (this.dimension == 4) {
-          // 物料维度
-          const data = await storageApi.getMaterialList(this.searchForm);
-          this.tableData = data.list;
-          this.total = data.count;
-        } else {
-          // 包装维度
-          const data = await storageApi.getPackingList(this.searchForm);
-          this.tableData = data.list;
-          this.total = data.count;
+      ],
+      qualityStatusOption: [
+        {
+          value: 1,
+          label: '已质检'
+        },
+        {
+          value: 0,
+          label: '未质检'
         }
-        console.log(this.tableData);
+      ],
+      visible1: false,
+      tableData: [],
+      total: 0,
+      categoryLevelId: '',
+      warehouseList:[],
+      searchForm: {
+        categoryCode: '',
+        categoryName: '',
+        batchNo: '',
+        brandNum: '',
+        engrave: '',
+        barcodes: '',
+        categoryLevelId: '',
+        warehouseId: '',
+        pageNum: 1,
+        size: 20
       },
-      open() {
-        this.visible = true;
-        this.$nextTick(() => {
-          this.$refs.treeList.getTreeData().then((data) => {
-            this.handleNodeClick(data);
-          });
+      selectionList: [],
+      materialType: '',
+      warehouseList: [],
+      dimension: '1',
+      selection: [],
+      tableList: [],
+      columns: [
+        {
+          columnKey: 'selection',
+          type: 'selection',
+          width: 45,
+          align: 'center',
+          fixed: 'left'
+        },
+        {
+          columnKey: 'index',
+          label: '序号',
+          type: 'index',
+          width: 55,
+          align: 'center',
+          showOverflowTooltip: true,
+          fixed: 'left'
+        },
+
+        {
+          prop: 'categoryCode',
+          label: '物品编码',
+          align: 'center'
+        },
+        {
+          prop: 'categoryName',
+          label: '物品名称',
+          align: 'center'
+        },
+
+        {
+          prop: 'categoryModel',
+          label: '型号',
+          align: 'center'
+        },
+        {
+          prop: 'specification',
+          label: '规格',
+          align: 'center'
+        },
+        {
+          prop: 'level',
+          label: '级别',
+          align: 'center'
+        },
+        {
+          prop: 'measureQuantity',
+          label: '库存',
+          align: 'center'
+        },   {
+          prop: 'measureUnit',
+          label: '计量单位',
+          align: 'center'
+        },
+      
+        {
+          prop: 'warehouseName',
+          label: '仓库',
+          align: 'center'
+        },
+      ]
+    };
+  },
+  created() {
+    warehouseDefinition.list({}).then((res) => {
+      this.warehouseList = res;
+    });
+
+  },
+  methods: {
+    getRowKeys(row) {
+      return row.id;
+    },
+
+    // 切换维度
+    changeDimensionHandler(e) {
+      this.searchForm.pageNum = 1;
+      this.selectionList = [];
+      this.$refs.multipleTable.clearSelection();
+      this.changeDimension(e);
+    },
+    async changeDimension(e) {
+      this.dimension = e;
+      if (this.dimension == 1) {
+        // 物品维度
+        const data = await storageApi.getProductList(this.searchForm);
+        this.tableData = data.list;
+        this.total = data.count;
+      } else if (this.dimension == 2) {
+        // 批次维度
+        const data = await storageApi.getBatchList(this.searchForm);
+        this.tableData = data.list;
+        this.total = data.count;
+      } else if (this.dimension == 4) {
+        // 物料维度
+        const data = await storageApi.getMaterialList(this.searchForm);
+        this.tableData = data.list;
+        this.total = data.count;
+      } else {
+        // 包装维度
+        const data = await storageApi.getPackingList(this.searchForm);
+        this.tableData = data.list;
+        this.total = data.count;
+      }
+      console.log(this.tableData);
+    },
+    open(tableList) {
+      this.visible1 = true;
+      this.tableList = JSON.parse(JSON.stringify(tableList));
+      this.$nextTick(() => {
+        console.log(this.$refs, 'this.$refs.treeList');
+        this.$refs.treeList.getTreeData().then((data) => {
+          this.handleNodeClick(data);
         });
-      },
-      async confirm() {
-        if (!this.selectionList.length) {
-          this.$message.error('请至少选择一条数据!');
-          return;
-        }
-        if (this.dimension == 1) {
-          let boolen = this.selectionList.every((item) => item.outboundNum > 0);
-          if (!boolen) {
-            this.$message.error('请输入出库数量!');
-            return;
-          }
-        }
-        console.log(this.selectionList);
-        let data = null;
-        if (this.dimension != 1) {
-          data = await storageApi.getHierarchyList({
-            ids: this.selectionList.map((item) => item.id).join(','),
-            type: this.dimension
-          });
-        } else {
-          data = await storageApi.getHierarchyFifo({
-            type: this.dimension,
-            builders: this.selectionList.map((item) => {
-              return {
-                categoryId: item.categoryId,
-                num: item.outboundNum
-              };
-            })
-          });
-        }
-        console.log('data-------------------', data);
-        this.$emit('detailData', data, this.dimension);
-        this.cancel();
-      },
-      cancel() {
-        this.selectionList = [];
-        this.$refs.multipleTable.clearSelection();
-        this.visible = false;
-      },
-      handleSelectionChange(val) {
-        this.selectionList = val;
-      },
-      handleNodeClick(data) {
-        console.log(data);
-        this.categoryLevelId = data.id;
-        this.searchForm.categoryLevelId = data.id;
-        this.doSearch();
-      },
-      handleCurrentChange() {
-        this.changeDimension(this.dimension);
-      },
-      reset() {
-        this.searchForm = {
-          categoryCode: '',
-          categoryName: '',
-          batchNo: '',
-          brandNum: '',
-          engrave: '',
-          barcodes: '',
-          categoryLevelId: this.categoryLevelId,
-          pageNum: 1,
-          size: 20
-        };
-        this.doSearch();
-      },
-      doSearch() {
-        this.searchForm.pageNum = 1;
-        this.changeDimension(this.dimension);
-      },
-      handleSizeChange() {
-        this.searchForm.pageNum = 1;
-        this.changeDimension(this.dimension, 'page');
+      });
+    },
+    async confirm() {
+      this.$emit('choose', this.tableList, this.dimension);
+      this.cancel();
+    },
+    async add() {
+      if (!this.selectionList.length) {
+        this.$message.error('请至少选择一条数据!');
+        return;
       }
+      // if (this.dimension == 1) {
+      //   let boolen = this.selectionList.every((item) => item.outboundNum > 0);
+      //   if (!boolen) {
+      //     this.$message.error('请输入出库数量!');
+      //     return;
+      //   }
+      // }
+      // let data = null;
+      // if (this.dimension != 1) {
+      //   data = await storageApi.getHierarchyList({
+      //     ids: this.selectionList.map((item) => item.id).join(','),
+      //     type: this.dimension
+      //   });
+      // } else {
+      //   data = await storageApi.getHierarchyFifo({
+      //     type: this.dimension,
+      //     builders: this.selectionList.map((item) => {
+      //       return {
+      //         categoryId: item.categoryId,
+      //         num: item.outboundNum || item.measureQuantity
+      //       };
+      //     })
+      //   });
+      // }
+
+      this.selectionList = this.selectionList.filter((item) => {
+        if(item.warehouseList.length>0){
+          item['warehouseId']=item.warehouseList[0].warehouse_id
+          item['warehouseName']=item.warehouseList[0].warehouse_name
+        }
+        return !this.tableList
+          .map((item) => item.categoryCode)
+          .includes(item.categoryCode);
+      });
+      this.tableList.push(...this.selectionList);
+    },
+    del() {
+      let ids = this.selection.map((item) => item.id);
+      this.tableList = this.tableList.filter((item) => !ids.includes(item.id));
+    },
+    cancel() {
+      this.selectionList = [];
+      this.$refs.multipleTable.clearSelection();
+      this.visible1 = false;
+    },
+    handleSelectionChange(val) {
+      this.selectionList = val;
+    },
+    handleNodeClick(data) {
+      console.log(data);
+      this.categoryLevelId = data.id;
+      this.searchForm.categoryLevelId = data.id;
+      this.doSearch();
+    },
+    handleCurrentChange() {
+      this.changeDimension(this.dimension);
+    },
+    reset() {
+      this.searchForm = {
+        categoryCode: '',
+        categoryName: '',
+        batchNo: '',
+        brandNum: '',
+        engrave: '',
+        barcodes: '',
+        categoryLevelId: this.categoryLevelId,
+        pageNum: 1,
+        warehouseId: '',
+        size: 20
+      };
+      this.doSearch();
+    },
+    doSearch() {
+      this.searchForm.pageNum = 1;
+      this.changeDimension(this.dimension);
+    },
+    handleSizeChange() {
+      this.searchForm.pageNum = 1;
+      this.changeDimension(this.dimension, 'page');
     }
-  };
+  }
+};
 </script>
 
 <style lang="scss" scoped>
-  .el-dialog__wrapper {
-    ::v-deep .el-aside {
-      background-color: #fff !important;
-      border: 1px solid #ccc;
-    }
+.el-dialog__wrapper {
+  ::v-deep .el-aside {
+    background-color: #fff !important;
+    border: 1px solid #ccc;
   }
+}
 
-  .wrapper-assets {
-    max-height: 53vh;
-    overflow: auto;
-  }
+.wrapper-assets {
+  max-height: 53vh;
+  overflow: auto;
+}
 </style>

+ 0 - 0
src/views/maintenance/repair/workOrder/components/assetTree.vue → src/views/sparePartsApply/components/assetTree.vue


+ 374 - 0
src/views/sparePartsApply/components/edit.vue

@@ -0,0 +1,374 @@
+<template>
+  <ele-modal :visible.sync="visible" :title="title" width="60vw" append-to-body>
+    <headerTitle title="基本信息" style="margin-top: 15px"></headerTitle>
+    <el-form
+      ref="form"
+      :model="form"
+      :rules="rules"
+      label-width="100px"
+      class="create-form"
+    >
+      <el-row :gutter="15">
+        <el-col v-bind="styleResponsive ? { lg: 8, md: 12 } : { span: 8 }">
+          <el-form-item label="编码:" prop="code">
+            <el-input v-model="form.code" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { lg: 8, md: 12 } : { span: 8 }">
+          <el-form-item label="工单编码:" prop="repairCode">
+            <el-input v-model="form.repairCode" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { lg: 8, md: 12 } : { span: 8 }">
+          <el-form-item label="工单名称:" prop="repairName">
+            <el-input v-model="form.repairName" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { lg: 8, md: 12 } : { span: 8 }">
+          <el-form-item label="设备名称:" prop="deviceName">
+            <el-input
+              v-model="form.deviceName"
+              disabled
+              v-if="sparePartsApplyList.length == 0"
+            />
+            <el-select
+              v-model="form.deviceName"
+              style="width: 100%"
+              placeholder="请选择"
+              v-else
+            >
+              <el-option
+                v-for="item in sparePartsApplyList"
+                :key="item.deviceCode"
+                :label="item.deviceName"
+                :value="item.deviceName"
+                @click.native="deviceChange(item)"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+
+        <el-col v-bind="styleResponsive ? { lg: 8, md: 12 } : { span: 8 }">
+          <el-form-item label="固资编码:" prop="fixCode">
+            <el-input v-model="form.fixCode" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { lg: 8, md: 12 } : { span: 8 }">
+          <el-form-item label="设备编号:" prop="deviceCode">
+            <el-input v-model="form.deviceCode" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { lg: 8, md: 12 } : { span: 8 }">
+          <el-form-item label="领用部门:" prop="useDeptName">
+            <el-input v-model="form.useDeptName" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { lg: 8, md: 12 } : { span: 8 }">
+          <el-form-item label="领用人:" prop="userName">
+            <el-input v-model="form.userName" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { lg: 8, md: 12 } : { span: 8 }">
+          <el-form-item label="使用时间:" prop="usageTime">
+            <el-date-picker
+              style="width: 100%"
+              v-model="form.usageTime"
+              type="date"
+              placeholder="选择"
+              :disabled="type == 'detail'"
+              value-format="yyyy-MM-dd"
+            >
+            </el-date-picker>
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { lg: 24, md: 24 } : { span: 16 }">
+          <el-form-item label="用途:" prop="purpose">
+            <el-input
+              v-model="form.purpose"
+              type="textarea"
+              :rows="2"
+              :disabled="type == 'detail'"
+            />
+          </el-form-item>
+        </el-col> </el-row
+    ></el-form>
+    <headerTitle title="备品备件信息" style="margin-top: 15px"></headerTitle>
+    <ele-pro-table
+      ref="table"
+      :columns="columns"
+      :datasource="tableList"
+      row-key="id"
+      height="20vh"
+      :needPage="false"
+    >
+      <template v-slot:toolbar>
+        <div class="add-product" @click="addEquipment" v-if="type != 'detail'">
+          <i class="el-icon-circle-plus-outline"></i>
+        </div>
+      </template>
+
+      <template v-slot:totalCount="{ row, $index }" v-if="type == 'add'">
+        <el-input
+          type="number"
+          placeholder="请输入"
+          v-model="row.totalCount"
+          @input="handleInput(row, $index)"
+        />
+      </template>
+      <template v-slot:action="{ row }">
+        <el-popconfirm
+          v-if="type != 'detail'"
+          class="ele-action"
+          title="确定要删除吗?"
+          @confirm="del(row.id)"
+        >
+          <template v-slot:reference>
+            <el-link type="danger" :underline="false" icon="el-icon-delete">
+              删除
+            </el-link>
+          </template>
+        </el-popconfirm>
+      </template>
+    </ele-pro-table>
+
+    <template v-slot:footer v-if="type != 'detail'">
+      <el-button @click="cancel">取消</el-button>
+      <!-- <el-button type="primary" @click="save" :loading="loading">
+        保存
+      </el-button> -->
+      <el-button type="primary" @click="save" :loading="loading">
+        提交
+      </el-button>
+    </template>
+
+    <!-- 选择产品 -->
+    <AssetsDialog ref="equipmentRefs" :assetType="6" @choose="confirmChoose">
+    </AssetsDialog>
+  </ele-modal>
+</template>
+
+<script>
+import AssetsDialog from './AssetsDialog.vue';
+import { save } from '@/api/maintenance/repair';
+import { detailsId } from '@/api/sparePartsApply/index.js';
+
+export default {
+  components: {
+    AssetsDialog
+  },
+  data() {
+    return {
+      visible: false,
+      loading: false,
+      title: '备品备件申请单',
+      type: '',
+      form: {
+        name: '',
+        repairId: '', //维修工单id
+        repairCode: '',
+        code: '',
+        repairName: '',
+        deviceName: '',
+        fixCode: '',
+        deviceCode: '',
+        type: '4', //类型
+        status: '1', //状态
+        purpose: '',
+        userId: '', //使用人id
+        userName: '',
+        useDeptId: '', //使用部门
+        useDeptName: '',
+        warehouseId: '',
+        usageTime: '', //使用时间 //详情信息
+        detailList: []
+      },
+      rules: {
+        deviceName: [{ required: true, message: '请选择', trigger: 'change' }]
+      },
+      sparePartsApplyList: [],
+      tableList: [],
+      columns: []
+    };
+  },
+
+  computed: {
+    // 是否开启响应式布局
+    styleResponsive() {
+      return this.$store.state.theme.styleResponsive;
+    }
+  },
+  created() {},
+  methods: {
+    // 出库数量限制
+    handleInput(row, index) {
+      console.log(row.measureQuantity, 'row.measureQuantity');
+      console.log(row.totalCount, 'row.outboundNum');
+
+      if (row.totalCount > row.measureQuantity) {
+        console.log(index, 'index');
+
+        this.$set(this.tableList[index], 'totalCount', row.measureQuantity);
+        // row.outboundNum = row.measureQuantity;
+      }
+    },
+    deviceChange(item) {
+      this.form.fixCode = item.fixCode;
+      this.form.deviceCode = item.deviceCode;
+    },
+    async open(row, type) {
+      this.type = type;
+      this.columns = [
+        {
+          columnKey: 'index',
+          label: '序号',
+          type: 'index',
+          width: 55,
+          align: 'center',
+          showOverflowTooltip: true,
+          fixed: 'left'
+        },
+
+        {
+          prop: 'categoryCode',
+          label: '物品编码',
+          align: 'center'
+        },
+        {
+          prop: 'categoryName',
+          label: '物品名称',
+          align: 'center'
+        },
+
+        {
+          prop: 'categoryModel',
+          label: '型号',
+          align: 'center'
+        },
+        {
+          prop: 'specification',
+          label: '规格',
+          align: 'center'
+        },
+        {
+          prop: 'level',
+          label: '级别',
+          align: 'center'
+        },
+        {
+          prop: 'totalCount',
+          label: '数量',
+          align: 'center',
+          slot: 'totalCount'
+        },
+        {
+          prop: 'measureQuantity',
+          label: '库存',
+          align: 'center',
+          show: type == 'add'
+        },
+        {
+          prop: 'measureUnit',
+          label: '计量单位',
+          align: 'center'
+        },
+        {
+          prop: 'warehouseName',
+          label: '仓库',
+          align: 'center'
+        },
+        {
+          columnKey: 'action',
+          label: '操作',
+          width: 140,
+          align: 'center',
+          resizable: false,
+          fixed: 'right',
+          slot: 'action',
+          showOverflowTooltip: true
+        }
+      ];
+      if (type == 'add') {
+        this.form.repairCode = row.code;
+        this.form.repairName = row.planName;
+        this.form.repairId = row.id;
+        if (!row.sparePartsApplyList) {
+          this.form.deviceName = row.substanceDetailVO.name;
+          this.form.fixCode = row.substanceDetailVO.fixCode;
+          this.form.deviceCode = row.substanceDetailVO.codeNumber;
+        } else {
+          this.sparePartsApplyList = row.sparePartsApplyList;
+        }
+      } else {
+        const data = await detailsId(row.id);
+        this.form = data;
+        this.tableList = data.detailList;
+      }
+
+      this.visible = true;
+    },
+    del(id) {
+      this.tableList = this.tableList.filter((item) => item.id != id);
+    },
+    cancel() {
+      this.visible = false;
+    },
+
+    addEquipment() {
+      this.$refs.equipmentRefs.open(this.tableList);
+    },
+    /* 保存编辑 */
+    async save() {
+      if (!this.form.deviceName) {
+        this.$message.error('请选择设备!');
+        return;
+      }
+      if (this.tableList.length == 0) {
+        this.$message.error('请选择备品备件!');
+        return;
+      }
+      let boolen = this.tableList.every((item) => item.totalCount > 0);
+      if (!boolen) {
+        this.$message.error('请输入出库数量!');
+        return;
+      }
+      this.form.detailList = this.tableList;
+
+      save(this.form)
+        .then((res) => {
+          this.loading = false;
+          this.$message.success('成功');
+          this.cancel();
+          this.$emit('refresh');
+        })
+        .catch((e) => {
+          this.loading = false;
+        });
+    },
+
+    // 确定选择
+    confirmChoose(data) {
+      this.tableList = JSON.parse(JSON.stringify(data));
+    }
+  }
+};
+</script>
+<style lang="scss" scoped>
+.basic-details-title {
+  margin: 10px 0;
+}
+.title {
+  font-size: 16px;
+  line-height: 45px;
+}
+.add-product {
+  width: 100%;
+  display: flex;
+  align-items: center;
+  // justify-content: flex-end;
+  font-size: 30px;
+  color: #1890ff;
+  margin: 10px 0;
+  cursor: pointer;
+}
+</style>

+ 211 - 0
src/views/sparePartsApply/components/editd.vue

@@ -0,0 +1,211 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never" v-loading="loading" >
+      
+      <!-- 数据表格 -->
+      <ele-pro-table ref="table" :columns="columns" :datasource="tableList" :needPage="false" :toolbar="false" >
+        <template v-slot:totalCount="{ row }">
+          {{ row.totalCount }} {{ row.measuringUnit }}
+        </template>
+
+        <template v-slot:totalPackage="{ row }">
+          {{ row.totalPackage }}
+        </template>
+
+        <template v-slot:totalWeight="{ row }">
+          {{ row.totalWeight }} {{ row.weightUnit }}
+        </template>
+
+        <template v-slot:approvalStatus="{ row }">
+          <span :class="{ 'ele-text-danger': row.approvalStatus == 2 }">
+            {{ statusFormatter(row.approvalStatus) }}
+          </span>
+        </template>
+
+        <template v-slot:action="{ row }">
+          <el-link type="primary" :underline="false" @click="open(row,'detail')">
+            详情
+          </el-link>
+        </template>
+      </ele-pro-table>
+    </el-card>
+
+    <edit ref="edit"></edit>
+  </div>
+</template>
+
+<script>
+import edit from './edit';
+import { details } from '@/api/maintenance/repair';
+
+
+export default {
+  props:{
+    id:''
+  },
+  components: {
+   edit
+  },
+  data() {
+    return {
+      loading: false,
+      tableList:[],
+      outputSceneState: [
+        { code: 1, label: '退供出库' },
+        { code: 2, label: '调拨出库' },
+        { code: 3, label: '销售出库' },
+        { code: 4, label: '领用出库' },
+        { code: 5, label: '报废出库' },
+        { code: 6, label: '外协出库' },
+        { code: 7, label: '委外出库' },
+        { code: 8, label: '受托退货出库' },
+        { code: 9, label: '仓库委外出库' },
+        { code: 10, label: '采购退货出库' },
+        { code: 11, label: '自选领用出库' },
+        { code: 12, label: '配料出库' }
+      ],
+      statusOpt: [
+        { label: '未提交', value: 0 },
+        { label: '审核中', value: 1 },
+        { label: '审核通过', value: 2 },
+        { label: '审核不通过', value: 3 }
+      ]
+    };
+  },
+  computed: {
+    // 表格列配置
+    columns() {
+      return [
+        {
+          columnKey: 'index',
+          label: '序号',
+          type: 'index',
+          width: 55,
+          align: 'center',
+          showOverflowTooltip: true,
+          fixed: 'left'
+        },
+        {
+          prop: 'code',
+          label: '编码',
+          align: 'center',
+          minWidth: 110
+        },
+        {
+          prop: 'repairCode',
+          label: '工单编码',
+          align: 'center',
+          minWidth: 110
+        },
+        {
+          prop: 'repairName',
+          label: '工单名称',
+          align: 'center',
+          minWidth: 110
+        },
+        {
+          prop: 'deviceName',
+          label: '设备名称',
+          align: 'center',
+          minWidth: 110
+        },
+        {
+          prop: 'fixCode',
+          label: '固资编码',
+          align: 'center',
+          minWidth: 110
+        },
+        {
+          prop: 'deviceCode',
+          label: '设备编码',
+          align: 'center',
+          minWidth: 110
+        },
+        {
+          prop: 'useDeptName',
+          label: '领用部门',
+          align: 'center',
+          minWidth: 110
+        },
+        {
+          prop: 'userName',
+          label: '领用人',
+          align: 'center',
+          minWidth: 110
+        },
+        {
+          prop: 'usageTime',
+          label: '领用时间',
+          align: 'center',
+          minWidth: 110
+        },
+        {
+          prop: 'purpose',
+          label: '用途',
+          align: 'center',
+          minWidth: 110
+        },
+
+        {
+          prop: 'type',
+          label: '出库场景',
+          align: 'center',
+          formatter: (row, column, cellValue) => {
+            return this.outputSceneState.find(item=>item.code==cellValue)?.label
+
+          }
+        },
+        {
+          prop: 'approvalUserName',
+          label: '审核人',
+          align: 'center'
+        },
+        {
+          slot: 'approvalStatus',
+          label: '状态',
+          align: 'center'
+        },
+
+        {
+          columnKey: 'action',
+          label: '操作',
+          width: 120,
+          align: 'center',
+          resizable: false,
+          fixed: 'right',
+          slot: 'action',
+          showOverflowTooltip: true
+        }
+      ];
+    }
+  },
+  watch:{
+    id(val){
+      if(val){
+         this.getValue()
+      }
+
+    }
+  }, 
+ created() {
+
+  },
+  methods: {
+   async getValue(){
+   const data= await details(this.id);
+   console.log(data,'data')
+   this.tableList=data
+    },
+    statusFormatter(status) {
+      const obj = this.statusOpt.find((i) => i.value == status);
+      return obj && obj.label;
+    },
+   
+    open(row,type) {
+      this.$refs.edit.open(row,type);
+    },
+
+  }
+};
+</script>
+

+ 1 - 1
src/views/sparePartsApply/components/search.vue

@@ -4,7 +4,7 @@
     <el-row :gutter="15">
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
         <el-form-item label="工单编码:">
-          <el-input clearable v-model="where.workOrderCode" placeholder="请输入"/>
+          <el-input    clearable v-model="where.workOrderCode" placeholder="请输入"/>
         </el-form-item>
       </el-col>
 

+ 68 - 42
src/views/sparePartsApply/index.vue

@@ -22,28 +22,29 @@
             {{ statusFormatter(row.approvalStatus) }}
           </span>
         </template>
-
+        <template v-slot:detailList="{ row }">
+          {{ row.detailList.map(item=>item.categoryName).toString() }}
+        </template>
         <template v-slot:action="{ row }">
-          <el-link type="primary" :underline="false" @click="details(row)">
+          <el-link type="primary" :underline="false" @click="open(row,'detail')">
             详情
           </el-link>
         </template>
       </ele-pro-table>
     </el-card>
 
-    <tgDetails ref="tgDetailsRefs"></tgDetails>
+    <edit ref="edit"></edit>
   </div>
 </template>
 
 <script>
 import { getList } from '@/api/sparePartsApply/index.js';
+import edit from './components/edit';
 
 import search from './components/search.vue';
-import tgDetails from './components/tgDetails.vue';
 export default {
   components: {
-    search,
-    tgDetails
+    search,edit
   },
   data() {
     return {
@@ -86,54 +87,85 @@ export default {
         {
           prop: 'code',
           label: '编码',
+          showOverflowTooltip: true,
           align: 'center',
           minWidth: 110
         },
         {
-          prop: 'workOrderCode',
+          prop: 'repairCode',
+          showOverflowTooltip: true,
           label: '工单编码',
           align: 'center',
           minWidth: 110
         },
         {
-          prop: 'warehouseName',
-          label: '仓库名称	',
-          align: 'center'
+          prop: 'repairName',
+          showOverflowTooltip: true,
+          label: '工单名称',
+          align: 'center',
+          minWidth: 110
         },
-
         {
-          prop: 'categoryLevelName',
-          label: '物品分类',
-          align: 'center'
+          prop: 'deviceName',
+          showOverflowTooltip: true,
+          label: '设备名称',
+          align: 'center',
+          minWidth: 110
         },
         {
-          prop: 'categoryName',
-          label: '名称',
-          align: 'center'
+          prop: 'fixCode',
+          showOverflowTooltip: true,
+          label: '固资编码',
+          align: 'center',
+          minWidth: 110
         },
-        { label: '型号', prop: 'modelType', width: '150' },
-        { label: '规格', prop: 'specification', width: '150' },
-        { label: '牌号', prop: 'brandNum', width: '50' },
         {
-          slot: 'totalCount',
-          label: '总数量',
-          align: 'center'
+          prop: 'deviceCode',
+          showOverflowTooltip: true,
+          label: '设备编码',
+          align: 'center',
+          minWidth: 110
         },
-
         {
-          slot: 'totalPackage',
-          label: '总包装',
-          align: 'center'
+          label: '物品名称',
+          align: 'center',
+          showOverflowTooltip: true,
+          slot:'detailList',
+          minWidth: 150
         },
-
         {
-          slot: 'totalWeight',
-          label: '总重量',
-          align: 'center'
+          prop: 'useDeptName',
+          showOverflowTooltip: true,
+          label: '领用部门',
+          align: 'center',
+          minWidth: 110
+        },
+        {
+          prop: 'userName',
+          showOverflowTooltip: true,
+          label: '领用人',
+          align: 'center',
+          minWidth: 110
         },
+        {
+          prop: 'usageTime',
+          label: '领用时间',
+          showOverflowTooltip: true,
+          align: 'center',
+          minWidth: 110
+        },
+        {
+          prop: 'purpose',
+          showOverflowTooltip: true,
+          label: '用途',
+          align: 'center',
+          minWidth: 110
+        },
+
         {
           prop: 'type',
-          label: '出库类型',
+          label: '出库场景',
+          showOverflowTooltip: true,
           align: 'center',
           formatter: (row, column, cellValue) => {
             return this.outputSceneState.find(item=>item.code==cellValue)?.label
@@ -143,18 +175,12 @@ export default {
         {
           prop: 'approvalUserName',
           label: '审核人',
-          align: 'center'
-        },
-
-        {
-          prop: 'createTime',
-          label: '创建时间',
-          align: 'center',
           showOverflowTooltip: true,
-          minWidth: 110
+          align: 'center'
         },
         {
           slot: 'approvalStatus',
+          showOverflowTooltip: true,
           label: '状态',
           align: 'center'
         },
@@ -187,8 +213,8 @@ export default {
       });
     },
 
-    details(row) {
-      this.$refs.tgDetailsRefs.open(row);
+    open(row,type) {
+      this.$refs.edit.open(row,type);
     },
 
     /* 刷新表格 */