Browse Source

bug修复

huang_an 1 năm trước cách đây
mục cha
commit
f5beb9b6c9

+ 1 - 4
src/components/AssetDialog/categoryDialog.vue

@@ -24,9 +24,8 @@
       <el-button type="primary" @click="doSearch">搜索</el-button>
       <el-button type="primary" @click="reset">重置</el-button>
     </div>
-    <el-row style="height: 80vh">
+    <el-row style="height: 70vh">
       <el-col class="tree-col" :span="6">
-        <div class="table-add" style="margin-left: 10px"></div>
         <AssetTree
           @handleNodeClick="handleNodeClick"
           @setRootId="setRootId"
@@ -50,8 +49,6 @@
           :data="tableData"
           tooltip-effect="dark"
           v-loading="tableLoading"
-          style="width: 100%; overflow: auto"
-          height="80vh"
           border
           @select-all="onSelectAll"
           @selection-change="selectItem"

+ 5 - 5
src/views/ledgerAssets/components/basicInfo.vue

@@ -3,7 +3,6 @@
   <div class="baseinfo-container" style="padding: 0">
     <div class="basic-details-title border-none">
       <headerTitle title="基本信息" style="margin-top: 15px"></headerTitle>
-
     </div>
     <el-descriptions
       :label-style="labelStyle"
@@ -17,7 +16,7 @@
         {{ idata.categoryLevelPath }}
       </el-descriptions-item>
       <el-descriptions-item>
-        <template slot="label"> 编码 </template>
+        <template slot="label"> 物品编码 </template>
         {{ idata.code }}
       </el-descriptions-item>
       <el-descriptions-item>
@@ -101,6 +100,7 @@
         } else {
           this.idata = data;
         }
+        console.log(this.idata, 'iiiiiiiiiiiiiiiiiiiiiiiiiiiiii');
       },
       async getDepUser(id, depId) {
         let res = await getUserPage({
@@ -116,9 +116,9 @@
 </script>
 
 <style lang="scss" scoped>
-:deep(.el-descriptions-item__label.is-bordered-label) {
-  color: #606266;
-}
+  :deep(.el-descriptions-item__label.is-bordered-label) {
+    color: #606266;
+  }
   .baseinfo-container {
     background-color: #fff;
     padding: 0px 20px 20px;

+ 3 - 3
src/views/ledgerAssets/components/details/inventory.vue

@@ -39,9 +39,9 @@
           :page-sizes="[10, 20, 50, 100]"
           :page-size.sync="size"
           :current-page.sync="page"
-          @current-change="_getRepairRecord"
-          @size-change="_getRepairRecord"
         >
+          <!-- @current-change="_getRepairRecord"
+          @size-change="_getRepairRecord" -->
         </el-pagination>
       </div>
     </div>
@@ -68,7 +68,7 @@
       };
     },
     created() {
-      this._getRepairRecord();
+      // this._getRepairRecord();
     },
     methods: {
       // async _getRepairRecord () {

+ 165 - 50
src/views/ledgerAssets/components/details/malfunction.vue

@@ -4,7 +4,7 @@
     <div class="basic-details" id="mould">
       <el-form label-width="120px">
         <el-row>
-          <el-col :md="6" :sm="8" :xs="8">
+          <el-col :span="8">
             <el-form-item label="报修记录单号">
               <el-input
                 v-model="searchForm.repairsCode"
@@ -12,7 +12,7 @@
                 size="small"
               ></el-input> </el-form-item
           ></el-col>
-          <el-col :md="6" :sm="8" :xs="8">
+          <el-col :span="8">
             <el-form-item label="来源编码">
               <el-input
                 v-model="searchForm.sourceCode"
@@ -20,7 +20,7 @@
                 size="small"
               ></el-input> </el-form-item
           ></el-col>
-          <el-col :md="6" :sm="8" :xs="8">
+          <el-col :span="8">
             <el-form-item label="报修人">
               <el-input
                 v-model="searchForm.repairsPerson"
@@ -28,7 +28,7 @@
                 size="small"
               ></el-input> </el-form-item
           ></el-col>
-          <el-col :md="12" :sm="16" :xs="16">
+          <el-col :span="8">
             <el-form-item label="报修时间">
               <el-date-picker
                 class="form-input"
@@ -40,11 +40,12 @@
                 end-placeholder="结束日期"
                 value-format="yyyy-MM-dd HH:mm:ss"
                 :default-time="['00:00:00', '23:59:59']"
+                style="width: 100%"
               >
               </el-date-picker> </el-form-item
           ></el-col>
 
-          <el-col :md="6" :sm="8" :xs="8">
+          <el-col :span="8">
             <el-form-item label="来源">
               <el-select
                 filterable
@@ -61,7 +62,7 @@
               </el-select> </el-form-item
           ></el-col>
 
-          <el-col :md="6" :sm="16" :xs="16" style="text-align: right">
+          <el-col :span="8" style="text-align: right">
             <el-button icon="el-icon-refresh-left" size="small" @click="rest"
               >重置</el-button
             >
@@ -75,48 +76,22 @@
           >
         </el-row>
       </el-form>
-      <el-table
+      <!-- <el-table
+        :columns="columns"
         :data="tableData"
         border
         tooltip-effect="dark"
         style="width: 100%"
         :header-cell-style="{ background: '#F0F3F3', border: 'none' }"
       >
-        <el-table-column
-          width="80px"
-          label="序号"
-          type="index"
-          :index="indexMethod"
-        >
-          <!-- <template slot-scope="{ $index }">
-            {{ $tableIndex($index, page, size) }}
-          </template> -->
-        </el-table-column>
-        <el-table-column prop="repairsCode" label="报修记录单号">
-          <template slot-scope="scope">
-            <div class="repairsCode" @click="jumpDetails(scope.row)">
-              {{ scope.row.repairsCode }}
-            </div>
-          </template>
-        </el-table-column>
-        <el-table-column prop="source.desc" label="来源" />
-        <el-table-column prop="repairsPerson" label="报修类型">
-          <template slot-scope="{ row }">
-            {{ row.source.code == 3 ? '自动报修' : '手动报修' }}
-          </template>
-        </el-table-column>
-        <el-table-column prop="sourceCode" label="来源编码" />
-
-        <el-table-column prop="repairsPerson" label="报修人" />
-        <el-table-column prop="createTime" label="报修时间" />
-        <el-table-column prop="acceptTime" label="维修工单编号">
-          <template slot-scope="scope">
-            {{ setAcceptTime(scope.row.acceptTime) }}
-          </template>
-        </el-table-column>
-        <!-- <el-table-column prop="finishTime" label="验收人" /> -->
-        <el-table-column prop="finishTime" label="验收时间" />
-      </el-table>
+      </el-table> -->
+      <ele-pro-table
+        ref="table"
+        :columns="columns"
+        :datasource="tableData"
+        cache-key="systemRoleTable"
+      >
+      </ele-pro-table>
       <div
         class="zw-table-footer"
         style="display: flex; justify-content: flex-end"
@@ -141,17 +116,155 @@
 <script>
   // import mixins from '../mixins/index'
   import pagenation from '@/components/Pagination';
-  // import { getGzgetPage } from "@/api/ledgerAssets/equipment";
+  import { getWorkOrderList } from '@/api/maintenance/repair';
+  import { workorderStatus, resultStatus } from '@/utils/dict/operationManage';
   // import DetailsDialog from "@/views/feature/maintenance/repair/RepairDetailsDialog.vue";
   export default {
     // mixins: [mixins],
-    props: ['code'],
+    props: {
+      id: {
+        typeof: String,
+        default: ''
+      }
+    },
     // DetailsDialog
     components: { pagenation },
     data() {
       return {
         informationId: '',
         tableData: [],
+        columns: [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'code',
+            slot: 'code',
+            label: '工单编号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 150
+          },
+          {
+            prop: 'planCode',
+            // label: '关联单号',
+            label: '计划单号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'planName',
+            label: '维修名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'substanceDetailVO.name',
+            label: '设备名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'substanceDetailVO.fixCode',
+            label: '固资编码',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'substanceDetailVO.codeNumber',
+            label: '设备编号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'executeUserName',
+            label: '执行人',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'assistsName',
+            label: '辅助人',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+
+          {
+            prop: 'acceptTime',
+            label: '开始时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'finishTime',
+            label: '结束时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'planFinishTime',
+            label: '计划完成时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            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 workorderStatus.filter(
+                (item) => item.code == row.orderStatus
+              )[0].label;
+            }
+          },
+          {
+            prop: 'acceptanceStatus',
+            label: '执行结果',
+            align: 'center',
+            showOverflowTooltip: true,
+            formatter: (row) => {
+              return row.acceptanceStatus
+                ? resultStatus.filter(
+                    (item) => item.code == row.acceptanceStatus
+                  )[0].label
+                : '';
+            }
+          }
+        ],
         searchForm: {
           repairsCode: '',
           sourceCode: '',
@@ -161,7 +274,7 @@
         },
         pages: {
           page: 1,
-          size: 15
+          size: 10
         },
         total: 0,
         option: {
@@ -211,7 +324,9 @@
       },
       getdata() {
         let par = {
-          equiCode: this.code,
+          // equiCode: this.code,
+          deviceId: this.id,
+          type: 3,
           ...this.pages,
           ...this.searchForm
         };
@@ -219,10 +334,10 @@
           par.startTime = this.searchForm.date[0];
           par.endTime = this.searchForm.date[1];
         }
-
-        getGzgetPage(par).then((res) => {
-          this.tableData = res.data.records;
-          this.total = res.data.total;
+        console.log(par, 'param');
+        getWorkOrderList(par).then((res) => {
+          this.tableData = res.list;
+          this.total = res.size;
         });
       },
       search() {

+ 3 - 2
src/views/ledgerAssets/equipment/components/equipment-list.vue

@@ -444,11 +444,12 @@
         this.$refs.table.reload({ pageNum: 1, where: where });
       },
       // 跳转到详情页
-      details({ id }) {
+      details({ id, code }) {
         this.$router.push({
           path: '/ledgerAssets/equipment/detail',
           query: {
-            id
+            id,
+            code
           }
         });
       },

+ 3 - 3
src/views/ledgerAssets/equipment/components/equipment-search.vue

@@ -218,9 +218,9 @@
       },
       /* 搜索 */
       search() {
-        if (!this.where.endTime) {
-          this.where.endTime = '';
-        }
+        // if (!this.where.endTime) {
+        //   this.where.endTime = '';
+        // }
         this.$emit('search', this.where);
       },
       /*  重置 */

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

@@ -84,6 +84,7 @@
     created() {
       this.id = this.$route.query.id;
       this.code = this.$route.query.code;
+      console.log('routerouterouteroute', this.$route);
     }
   };
 </script>

+ 431 - 425
src/views/ledgerAssets/equipment/edit.vue

@@ -118,461 +118,467 @@
 </template>
 
 <script>
-import warehouseConfigVue from '../components/warehouseConfig.vue';
-import productInfoVue from '../components/productInfo.vue';
-import planVue from '../components/plan.vue';
-import qualityConfig from '../components/qualityConfig.vue';
-import footerVue from '../components/footer.vue';
-import documentInformation from '../components/documentInformation.vue';
-import equipmentTag from '../components/equipmentTag.vue';
-import basicInfoVue from '../components/basicInfo.vue';
-import DialogGoods from '../components/DialogGoods';
-import assetInformation from '../components/assetInformation.vue';
-import businessInformation from '../components/businessInformation.vue';
-import { getDetails } from '@/api/classifyManage/itemInformation';
-import {
-  saveOrEdit,
-  getAssetInfo,
-  getCode,
-  getAssetNum
-} from '@/api/ledgerAssets';
-const equipmentLabelJson = [
-  {
-    LJSB: '2', //老旧设备
-    SHSB: '2', //涉火设备
-    SHLJSB: '2', //涉火老旧设备
-    GZSB: '2', //关重设备
-    GJSB: '2', //关键设备
-    TZSB: '2', //特种设备
-    HBSB: '2', //环保设备
-    ZYSCSB: '2', //主要生产设备
-    FZSCSB: '2', //辅助生产设备
-    KYSB: '2' //科研设备
-  }
-];
-export default {
-  components: {
-    warehouseConfigVue,
-    productInfoVue,
-    planVue,
-    qualityConfig,
-    footerVue,
-    documentInformation,
-    DialogGoods,
-    assetInformation,
-    businessInformation,
-    basicInfoVue,
-    equipmentTag
-  },
-  props: {
-    showTitle: {
-      type: Boolean,
-      default: true
+  import warehouseConfigVue from '../components/warehouseConfig.vue';
+  import productInfoVue from '../components/productInfo.vue';
+  import planVue from '../components/plan.vue';
+  import qualityConfig from '../components/qualityConfig.vue';
+  import footerVue from '../components/footer.vue';
+  import documentInformation from '../components/documentInformation.vue';
+  import equipmentTag from '../components/equipmentTag.vue';
+  import basicInfoVue from '../components/basicInfo.vue';
+  import DialogGoods from '../components/DialogGoods';
+  import assetInformation from '../components/assetInformation.vue';
+  import businessInformation from '../components/businessInformation.vue';
+  import { getDetails } from '@/api/classifyManage/itemInformation';
+  import {
+    saveOrEdit,
+    getAssetInfo,
+    getCode,
+    getAssetNum
+  } from '@/api/ledgerAssets';
+  const equipmentLabelJson = [
+    {
+      LJSB: '2', //老旧设备
+      SHSB: '2', //涉火设备
+      SHLJSB: '2', //涉火老旧设备
+      GZSB: '2', //关重设备
+      GJSB: '2', //关键设备
+      TZSB: '2', //特种设备
+      HBSB: '2', //环保设备
+      ZYSCSB: '2', //主要生产设备
+      FZSCSB: '2', //辅助生产设备
+      KYSB: '2' //科研设备
     }
-  },
-  data() {
-    return {
-      labelStyle: {
-        width: '200px'
-      },
-      contentStyle: {
-        width: '400px'
-      },
-      isLink: true,
-      title: '新建设备信息',
-      pageType: 'add',
-      btnLoading: false,
-      // 设备主键id
-      id: '',
-      form: {
-        extInfoSelf: [],
-        // 基本信息
-        code: '',
-        name: '',
-        productTime: '',
-        workstation:'',
-        equipmentLabelJson
-      },
-      rules: {
-        name: [{ required: true, message: '请输入设备名称', trigger: 'blur' }],
-        code: [{ required: true, message: '请输入设备编码', trigger: 'blur' }]
-      },
-      // 基本信息
-      basicInfo: {},
-      positionInfo: {
-        // 详细地址
-        deviceDetailAddress: '',
-        // 请选择产线
-        lineCode: '',
-        lineName: '',
-        // 请选择车间
-        workshopCode: '',
-        workshopName: '',
-        // 请选择工厂
-        factoryCode: '',
-        factoryName: ''
-      },
-      // 图片
-      imageUrl: null,
-      // 文档信息
-      attUrl: {
-        operatingManual: {
-          value: [],
-          sort: 1
+  ];
+  export default {
+    components: {
+      warehouseConfigVue,
+      productInfoVue,
+      planVue,
+      qualityConfig,
+      footerVue,
+      documentInformation,
+      DialogGoods,
+      assetInformation,
+      businessInformation,
+      basicInfoVue,
+      equipmentTag
+    },
+    props: {
+      showTitle: {
+        type: Boolean,
+        default: true
+      }
+    },
+    data() {
+      return {
+        labelStyle: {
+          width: '200px'
         },
-        productionLicence: {
-          value: [],
-          sort: 2
+        contentStyle: {
+          width: '400px'
         },
-        explosionProofCertificate: {
-          value: [],
-          sort: 3
+        isLink: true,
+        title: '新建设备信息',
+        pageType: 'add',
+        btnLoading: false,
+        // 设备主键id
+        id: '',
+        form: {
+          extInfoSelf: [],
+          // 基本信息
+          code: '',
+          name: '',
+          productTime: '',
+          workstation: '',
+          equipmentLabelJson
         },
-        surveyReport: {
-          value: [],
-          sort: 4
+        rules: {
+          name: [
+            { required: true, message: '请输入设备名称', trigger: 'blur' }
+          ],
+          code: [{ required: true, message: '请输入设备编码', trigger: 'blur' }]
         },
-        inspectionCycleManual: {
-          value: [],
-          sort: 5
+        // 基本信息
+        basicInfo: {},
+        positionInfo: {
+          // 详细地址
+          deviceDetailAddress: '',
+          // 请选择产线
+          lineCode: '',
+          lineName: '',
+          // 请选择车间
+          workshopCode: '',
+          workshopName: '',
+          // 请选择工厂
+          factoryCode: '',
+          factoryName: ''
         },
-        informationDrawing: {
-          value: [],
-          sort: 6
+        // 图片
+        imageUrl: null,
+        // 文档信息
+        attUrl: {
+          operatingManual: {
+            value: [],
+            sort: 1
+          },
+          productionLicence: {
+            value: [],
+            sort: 2
+          },
+          explosionProofCertificate: {
+            value: [],
+            sort: 3
+          },
+          surveyReport: {
+            value: [],
+            sort: 4
+          },
+          inspectionCycleManual: {
+            value: [],
+            sort: 5
+          },
+          informationDrawing: {
+            value: [],
+            sort: 6
+          },
+          productCertificate: {
+            value: [],
+            sort: 7
+          }
         },
-        productCertificate: {
-          value: [],
-          sort: 7
-        }
-      },
-      // 是否开始物联
-      isIotEnable: '1',
-      // 物联ID
-      iotId: '',
-      // 回显过保时间
-      cbexpirationTime: '',
-      // 生命周期
-      sourceDICT: '',
-      // 网络状态
-      networkStatus: '',
-      id: ''
-    };
-  },
-  watch: {},
-  computed: {
-    // 过保时间
-    expirationTime() {
-      if (this.form.productTime && this.basicInfo.expirationDate) {
-        return this.setGbTime(
-          this.form.productTime,
-          this.basicInfo.expirationDate,
-          this.basicInfo.expirationDateUnit
-        );
-      } else {
-        return '';
-      }
-    }
-  },
-  async created() {
-    if (this.$route.query.id) {
-      this.pageType = 'edit';
-      this.id = this.$route.query.id;
-      await this.getInfo();
-      this.title = '编辑设备信息';
-      // this.getgys();
-      // await this._getWarehouseChildren();
-    } else {
-      this.pageType = 'add';
-      this.title = '新增设备信息';
-    }
-  },
-  methods: {
-    handlwpbm() {
-      this.$refs.DialogGoods.open('0', true);
+        // 是否开始物联
+        isIotEnable: '1',
+        // 物联ID
+        iotId: '',
+        // 回显过保时间
+        cbexpirationTime: '',
+        // 生命周期
+        sourceDICT: '',
+        // 网络状态
+        networkStatus: '',
+        id: ''
+      };
     },
-    async cbDialogGoods(data) {
-      let res = await getDetails(data.id);
-      if (!data.extInfoSelf) {
-        data.extInfoSelf = [];
-      }
-      // if (!data.workstation) {
-      //   data.workstation = {};
-      // }
-      if (!data.isPublic) {
-        data.isPublic = 0;
-      }
-      this.form = Object.assign({}, this.form, data);
-      console.log(this.form);
-
-      this.form.category = res;
-      this.basicInfo = data;
-      this.form.rootCategoryLevelId = this.basicInfo.categoryLevelPathId
-        .split(',')[0]
-        .replace('[', '');
-      this.form.categoryId = this.basicInfo.id;
-      this.form.name = this.basicInfo.name;
-      this.form.code = data.code; //Date.now(); //res.data[0].onlyCode;
-      this.initOtherMsg();
-    },
-    // 计算过保时间
-    setGbTime(basic, value, type) {
-      basic = Date.parse(basic);
-      let time;
-      switch (type) {
-        case 'minute':
-          time = value * 1000 * 60;
-          break;
-        case 'hour':
-          time = value * 1000 * 60 * 60;
-          break;
-        case 'day':
-          time = value * 1000 * 60 * 60 * 24;
-          break;
-        case 'month':
-          time = value * 1000 * 60 * 60 * 24 * 30;
-          break;
-        case 'year':
-          time = value * 1000 * 60 * 60 * 24 * 365;
-          break;
-        default:
-          break;
+    watch: {},
+    computed: {
+      // 过保时间
+      expirationTime() {
+        if (this.form.productTime && this.basicInfo.expirationDate) {
+          return this.setGbTime(
+            this.form.productTime,
+            this.basicInfo.expirationDate,
+            this.basicInfo.expirationDateUnit
+          );
+        } else {
+          return '';
+        }
       }
-
-      let num = basic + time;
-      return parseTime(num);
     },
-    // 添加自定义参数
-    addItem() {
-      if (this.form.extInfoSelf.length < 10) {
-        let item = { key: '', value: '' };
-        this.form.extInfoSelf.push(item);
+    async created() {
+      if (this.$route.query.id) {
+        this.pageType = 'edit';
+        this.id = this.$route.query.id;
+        await this.getInfo();
+        this.title = '编辑设备信息';
+        // this.getgys();
+        // await this._getWarehouseChildren();
       } else {
-        this.$message.warning('自定义参数最多添加10条');
+        this.pageType = 'add';
+        this.title = '新增设备信息';
       }
     },
-    // 删除自定义参数
-    delt(item, index) {
-      this.form.extInfoSelf.splice(index, 1);
-    },
-    // 提交
-    submit() {
-      if (JSON.stringify(this.basicInfo) === '{}' && this.pageType == 'add') {
-        return this.$message.error('请选择物品');
-      }
-      this.$refs.form.validate(async (valid) => {
-        if (valid) {
-          let par = {
-            //基本信息
-            ...this.form,
-            assetType: 1,
-            // 资产信息
-            positionIds: '1,1,1,1',
-            position: {
-              detailPosition: this.positionInfo.deviceDetailAddress,
-              pathIds: `${
-                this.positionInfo.factoryCode
-                  ? this.positionInfo.factoryCode + ','
-                  : ''
-              }${
-                this.positionInfo.workshopCode
-                  ? this.positionInfo.workshopCode + ','
-                  : ''
-              }${this.positionInfo.lineCode}`,
-              pathName: `${
-                this.positionInfo.factoryName
-                  ? this.positionInfo.factoryName + ','
-                  : ''
-              }${
-                this.positionInfo.workshopName
-                  ? this.positionInfo.workshopName + ','
-                  : ''
-              }${this.positionInfo.lineName}`,
-              type: '1',
-              num: 1
-            },
-            // 文档信息
-            attUrl: this.setWd() || [],
-            // 设备图片
-            imageUrl: this.imageUrl || {},
-            // 是否启用物联
-            isIotEnable: this.isIotEnable
-            // 扩展字段
-            // extInfoSelf: this.setKz()
-          };
-          par.deviceLocationName = par.location ? par.location.toString() : '';
-          par.extInfo = { ...this.form };
-          let obj = {};
-          par.extInfoSelf.forEach((item) => {
-            obj[item.key] = item.value;
-          });
-          // console.log('sasasasa', par);
-          // return;
-          par.extInfoSelf = obj;
-          if (this.pageType == 'edit') {
-            par.id = this.id;
-          } else {
-            // const batchNo = await getCode('lot_number_code');
-            // const res = await getAssetNum({
-            //   assetCode: par.code,
-            //   batchNum: batchNo,
-            //   num: 1
-            // });
-            // console.log(res);
-            // par.code = res.data.shift().onlyCode;
-            par.id = '';
-          }
-          this.btnLoading = true;
-          saveOrEdit(par)
-            .then((res) => {
-              this.$message.success('操作成功');
-              this.$router.go(-1);
-            })
-            .finally(() => {
-              this.btnLoading = false;
-            });
+    methods: {
+      handlwpbm() {
+        this.$refs.DialogGoods.open('0', true);
+      },
+      async cbDialogGoods(data) {
+        let res = await getDetails(data.id);
+        if (!data.extInfoSelf) {
+          data.extInfoSelf = [];
+        }
+        // if (!data.workstation) {
+        //   data.workstation = {};
+        // }
+        if (!data.isPublic) {
+          data.isPublic = 0;
+        }
+        this.form = Object.assign({}, this.form, data);
+        console.log(this.form);
+
+        this.form.category = res;
+        this.basicInfo = data;
+        console.log(data, 'data');
+        this.form.rootCategoryLevelId =
+          this.basicInfo.categoryLevelPathIdParent;
+        this.form.categoryId = this.basicInfo.id;
+        this.form.name = this.basicInfo.name;
+        this.form.code = data.code; //Date.now(); //res.data[0].onlyCode;
+        this.initOtherMsg();
+      },
+      // 计算过保时间
+      setGbTime(basic, value, type) {
+        basic = Date.parse(basic);
+        let time;
+        switch (type) {
+          case 'minute':
+            time = value * 1000 * 60;
+            break;
+          case 'hour':
+            time = value * 1000 * 60 * 60;
+            break;
+          case 'day':
+            time = value * 1000 * 60 * 60 * 24;
+            break;
+          case 'month':
+            time = value * 1000 * 60 * 60 * 24 * 30;
+            break;
+          case 'year':
+            time = value * 1000 * 60 * 60 * 24 * 365;
+            break;
+          default:
+            break;
+        }
+
+        let num = basic + time;
+        return parseTime(num);
+      },
+      // 添加自定义参数
+      addItem() {
+        if (this.form.extInfoSelf.length < 10) {
+          let item = { key: '', value: '' };
+          this.form.extInfoSelf.push(item);
         } else {
-          console.log('error submit!!');
-          return false;
+          this.$message.warning('自定义参数最多添加10条');
         }
-      });
-    },
-    // 处理扩展字段
-    setKz() {
-      return this.form.extInfoSelf || [];
-    },
-    // 处理文档信息
-    setWd() {
-      console.log(this.attUrl)
-      return Object.values(this.attUrl).map((item) => ({
-        value:item.value||[],
-        sort: item.sort
-      }));
-    },
-    // 获取设备详情
-    async getInfo() {
-      const data = await getAssetInfo(this.id);
-      // 扩展字段
-      data.extInfoSelf = data.extInfoSelf || [];
-      // 权属人相关信息
-      // if (!data.workstation) {
-      //   data.workstation = {};
-      // }
-      // 资产信息类型默认专用
-      if (!data.isPublic) {
-        data.isPublic = 0;
-      }
-      this.form = Object.assign({}, this.form, data);
-      console.log(this.form, 'dsadasd');
-      this.form.lifeCycle = this.form.lifeCycle + '';
-      this.form.location = data.deviceLocationName.split(',');
-      this.basicInfo = data;
-      this.cbexpirationTime = data.expirationTime;
-      this.sourceDICT = data.sourceDICT;
-      this.networkStatus = data.networkStatus;
-      this.positionInfo.deviceDetailAddress = data.deviceDetailAddress;
-      if (this.form.equipmentLabelJson.length == 0) {
-        this.form.equipmentLabelJson = equipmentLabelJson;
-      }
-      this.initOtherMsg();
-      // 设备图片
-      this.imageUrl = data.imageUrl;
-      // 物联参数
-      this.isIotEnable = data.isIotEnable;
-      this.iotId = data.iotId;
-    },
-    async initOtherMsg() {
-      // 基本信息
-      this.$refs.basicInfoVueRef.getDetailInfoAugr(this.form.category.category);
-      // 仓储配置
-      // this.$refs.warehouseConfigRef.getDetailInfoAugr(
-      //   this.form.category.categoryWms
-      // );
-      // 生产信息
-      // this.$refs.productInfoRef.getDetailInfoAugr(
-      //   this.form.category.categoryMes
-      // );
-      // 计划配置
-      // this.$refs.planRef.getDetailInfoAugr(this.form.category.categoryAps);
-      // 质量配置
-      // this.$refs.qualityConfigRef.getDetailInfoAugr(
-      //   this.form.category.categoryQms
-      // );
-      // 其他和关联信息
-      // this.$refs.footerVueRef.getDetailInfoAugr(this.form.category.category);
-      // 文档信息
-      if (this.form.attUrl && this.form.attUrl.length > 0) {
-        Object.keys(this.attUrl).forEach((n, index) => {
-          this.attUrl[n].value =this.form.attUrl[index].value||[]
+      },
+      // 删除自定义参数
+      delt(item, index) {
+        this.form.extInfoSelf.splice(index, 1);
+      },
+      // 提交
+      submit() {
+        if (JSON.stringify(this.basicInfo) === '{}' && this.pageType == 'add') {
+          return this.$message.error('请选择物品');
+        }
+        this.$refs.form.validate(async (valid) => {
+          if (valid) {
+            let par = {
+              //基本信息
+              ...this.form,
+              assetType: 1,
+              // 资产信息
+              positionIds: '1,1,1,1',
+              position: {
+                detailPosition: this.positionInfo.deviceDetailAddress,
+                pathIds: `${
+                  this.positionInfo.factoryCode
+                    ? this.positionInfo.factoryCode + ','
+                    : ''
+                }${
+                  this.positionInfo.workshopCode
+                    ? this.positionInfo.workshopCode + ','
+                    : ''
+                }${this.positionInfo.lineCode}`,
+                pathName: `${
+                  this.positionInfo.factoryName
+                    ? this.positionInfo.factoryName + ','
+                    : ''
+                }${
+                  this.positionInfo.workshopName
+                    ? this.positionInfo.workshopName + ','
+                    : ''
+                }${this.positionInfo.lineName}`,
+                type: '1',
+                num: 1
+              },
+              // 文档信息
+              attUrl: this.setWd() || [],
+              // 设备图片
+              imageUrl: this.imageUrl || {},
+              // 是否启用物联
+              isIotEnable: this.isIotEnable
+              // 扩展字段
+              // extInfoSelf: this.setKz()
+            };
+            par.deviceLocationName = par.location
+              ? par.location.toString()
+              : '';
+            par.extInfo = { ...this.form };
+            let obj = {};
+            par.extInfoSelf.forEach((item) => {
+              obj[item.key] = item.value;
+            });
+            // console.log('sasasasa', par);
+            // return;
+            par.extInfoSelf = obj;
+            if (this.pageType == 'edit') {
+              par.id = this.id;
+            } else {
+              // const batchNo = await getCode('lot_number_code');
+              // const res = await getAssetNum({
+              //   assetCode: par.code,
+              //   batchNum: batchNo,
+              //   num: 1
+              // });
+              // console.log(res);
+              // par.code = res.data.shift().onlyCode;
+              par.id = '';
+            }
+            this.btnLoading = true;
+            saveOrEdit(par)
+              .then((res) => {
+                this.$message.success('操作成功');
+                this.$router.go(-1);
+              })
+              .finally(() => {
+                this.btnLoading = false;
+              });
+          } else {
+            console.log('error submit!!');
+            return false;
+          }
         });
-        this.$refs.documentInformationRef.getDetailInfoAugr(this.attUrl);
-      }
-    },
-    // 设置标准产能
-    setbzcn(val) {
-      if (!val) {
-        return '';
+      },
+      // 处理扩展字段
+      setKz() {
+        return this.form.extInfoSelf || [];
+      },
+      // 处理文档信息
+      setWd() {
+        console.log(this.attUrl);
+        return Object.values(this.attUrl).map((item) => ({
+          value: item.value || [],
+          sort: item.sort
+        }));
+      },
+      // 获取设备详情
+      async getInfo() {
+        const data = await getAssetInfo(this.id);
+        // 扩展字段
+        data.extInfoSelf = data.extInfoSelf || [];
+        // 权属人相关信息
+        // if (!data.workstation) {
+        //   data.workstation = {};
+        // }
+        // 资产信息类型默认专用
+        if (!data.isPublic) {
+          data.isPublic = 0;
+        }
+        this.form = Object.assign({}, this.form, data);
+        console.log(this.form, 'dsadasdform');
+        this.form.lifeCycle = this.form.lifeCycle + '';
+        this.form.location = data.deviceLocationName.split(',');
+        this.basicInfo = data;
+        this.cbexpirationTime = data.expirationTime;
+        this.sourceDICT = data.sourceDICT;
+        this.networkStatus = data.networkStatus;
+        this.positionInfo.deviceDetailAddress = data.deviceDetailAddress;
+        if (this.form.equipmentLabelJson.length == 0) {
+          this.form.equipmentLabelJson = equipmentLabelJson;
+        }
+        this.initOtherMsg();
+        // 设备图片
+        this.imageUrl = data.imageUrl;
+        // 物联参数
+        this.isIotEnable = data.isIotEnable;
+        this.iotId = data.iotId;
+      },
+      async initOtherMsg() {
+        // 基本信息
+        this.$refs.basicInfoVueRef.getDetailInfoAugr(
+          this.form.category.category
+        );
+        // 仓储配置
+        // this.$refs.warehouseConfigRef.getDetailInfoAugr(
+        //   this.form.category.categoryWms
+        // );
+        // 生产信息
+        // this.$refs.productInfoRef.getDetailInfoAugr(
+        //   this.form.category.categoryMes
+        // );
+        // 计划配置
+        // this.$refs.planRef.getDetailInfoAugr(this.form.category.categoryAps);
+        // 质量配置
+        // this.$refs.qualityConfigRef.getDetailInfoAugr(
+        //   this.form.category.categoryQms
+        // );
+        // 其他和关联信息
+        // this.$refs.footerVueRef.getDetailInfoAugr(this.form.category.category);
+        // 文档信息
+        if (this.form.attUrl && this.form.attUrl.length > 0) {
+          Object.keys(this.attUrl).forEach((n, index) => {
+            this.attUrl[n].value = this.form.attUrl[index].value || [];
+          });
+          this.$refs.documentInformationRef.getDetailInfoAugr(this.attUrl);
+        }
+      },
+      // 设置标准产能
+      setbzcn(val) {
+        if (!val) {
+          return '';
+        }
+        let item = JSON.parse(val);
+        return item.standardCapacity || '';
       }
-      let item = JSON.parse(val);
-      return item.standardCapacity || '';
     }
-  }
-};
+  };
 </script>
 
 <style lang="scss" scoped>
-::v-deep .descriptions {
-  margin-bottom: 10px;
-}
-.baseinfo-container .basic-details-title {
-  font-size: 16px;
-  margin: 15px 0;
-}
-.upload-container {
-  display: flex;
-  justify-content: flex-start;
-  .file-list {
-    margin-left: 50px;
-    flex: 1;
+  ::v-deep .descriptions {
+    margin-bottom: 10px;
+  }
+  .baseinfo-container .basic-details-title {
+    font-size: 16px;
+    margin: 15px 0;
   }
-}
-.equipment-container {
-  .label-none {
-    .el-form-item__content {
-      margin-left: 0 !important;
+  .upload-container {
+    display: flex;
+    justify-content: flex-start;
+    .file-list {
+      margin-left: 50px;
+      flex: 1;
     }
   }
-}
-.sbwz {
-  .item {
-    width: 120px !important;
+  .equipment-container {
+    .label-none {
+      .el-form-item__content {
+        margin-left: 0 !important;
+      }
+    }
   }
-  .item + .item {
-    margin-left: 10px;
+  .sbwz {
+    .item {
+      width: 120px !important;
+    }
+    .item + .item {
+      margin-left: 10px;
+    }
+    .item-input {
+      width: 350px !important;
+    }
   }
-  .item-input {
-    width: 350px !important;
+  .input {
+    width: 100%;
   }
-}
-.input {
-  width: 100%;
-}
-.kzzd {
-  width: 500px;
-  .add-col {
-    display: flex;
-    .col-input {
-      & + .col-input {
+  .kzzd {
+    width: 500px;
+    .add-col {
+      display: flex;
+      .col-input {
+        & + .col-input {
+          margin-left: 10px;
+        }
+      }
+      .del {
         margin-left: 10px;
       }
     }
-    .del {
-      margin-left: 10px;
-    }
   }
-}
-::v-deep .el-descriptions {
-  .el-form-item {
-    margin-bottom: 0px;
+  ::v-deep .el-descriptions {
+    .el-form-item {
+      margin-bottom: 0px;
+    }
   }
-}
 </style>

+ 8 - 5
src/views/ledgerAssets/sparepart/components/sparepart-list.vue

@@ -111,7 +111,11 @@
   import printSr from '@/views/ledgerAssets/components/printSr';
   import printTg from '@/views/ledgerAssets/components/printTg';
   import { getByCode } from '@/api/system/dictionary-data';
-  import { businessStatus, networkStatus,sourceStatus } from '@/utils/dict/warehouse';
+  import {
+    businessStatus,
+    networkStatus,
+    sourceStatus
+  } from '@/utils/dict/warehouse';
   import SparepartSearch from './sparepart-search.vue';
   import { getAssetList, importCategorySparePart } from '@/api/ledgerAssets';
   import dictMixins from '@/mixins/dictMixins';
@@ -229,9 +233,8 @@
             label: '生命周期',
             showOverflowTooltip: true,
             minWidth: 110,
-            formatter:(_row)=>{
-              return sourceStatus[_row.lifeCycle]
-
+            formatter: (_row) => {
+              return sourceStatus[_row.lifeCycle];
             }
           },
           {
@@ -276,7 +279,7 @@
                   (item) => item.code == _row.status
                 )[0].label;
               } else {
-                return '空闲';
+                return '';
               }
             }
           },

+ 90 - 82
src/views/maintenance/delivery/plan/details.vue

@@ -20,7 +20,7 @@
             <el-col :span="12">
               <el-col :span="12">
                 <el-form-item label="计划单号">
-                  <span> {{ infoData.code }} </span>
+                  <span> {{ infoData?.code }} </span>
                 </el-form-item>
               </el-col>
               <el-col :span="12">
@@ -113,28 +113,28 @@
               <el-table-column label="设备编码" prop="name">
                 <template slot-scope="scope">
                   <div>
-                    <span>{{ scope.row.substance.code }}</span>
+                    <span>{{ scope.row.substance?.code }}</span>
                   </div>
                 </template>
               </el-table-column>
               <el-table-column label="编号" prop="norm">
                 <template slot-scope="scope">
                   <div>
-                    <span>{{ scope.row.substance.extInfo.codeNumber }}</span>
+                    <span>{{ scope.row.substance?.extInfo.codeNumber }}</span>
                   </div>
                 </template>
               </el-table-column>
               <el-table-column label="设备名称" prop="content">
                 <template slot-scope="scope">
                   <div>
-                    <span>{{ scope.row.substance.name }}</span>
+                    <span>{{ scope.row.substance?.name }}</span>
                   </div>
                 </template>
               </el-table-column>
               <el-table-column label="设备型号" prop="norm">
                 <template slot-scope="scope">
                   <div>
-                    <span>{{ scope.row.substance.model }}</span>
+                    <span>{{ scope.row.substance?.model }}</span>
                   </div>
                 </template>
               </el-table-column>
@@ -583,7 +583,7 @@
     data() {
       return {
         // 流程实例
-        id: undefined, // 流程实例的编号
+        id: '', // 流程实例的编号
         processInstance: {},
 
         // BPMN 数据
@@ -634,7 +634,8 @@
         showtext: false,
         infoData: {
           planDeviceList: [{}]
-        }
+        },
+        processInstanceLoading: false
       };
     },
     async created() {
@@ -661,81 +662,84 @@
       },
       /** 获得流程实例 */
       getDetail(id) {
-        // 获得流程实例相关
-        this.processInstanceLoading = true;
-        getProcessInstance(id).then((response) => {
-          if (!response) {
-            this.$message.error('查询不到流程信息!');
-            return;
-          }
-          // 设置流程信息
-          this.processInstance = response;
+        try {
+          // 获得流程实例相关
+          this.processInstanceLoading = true;
+          getProcessInstance(id).then((response) => {
+            if (!response) {
+              this.$message.error('查询不到流程信息!');
+              return;
+            }
+            // 设置流程信息
+            this.processInstance = response;
+            // 加载流程图
+            if (this.processInstance.processDefinition.id) {
+              getProcessDefinitionBpmnXML(
+                this.processInstance.processDefinition?.id
+              ).then((response) => {
+                this.bpmnXML = response;
+              });
+            }
+            // 加载活动列表
+            getActivityList({
+              processInstanceId: this.processInstance.id
+            }).then((response) => {
+              this.activityList = response;
+            });
 
-          // //将业务表单,注册为动态组件
-          // const path = this.processInstance.processDefinition.formCustomViewPath;
-          // Vue.component("async-biz-form-component", function (resolve) {
-          //   require([`@/views${path}`], resolve);
-          // });
-          // 加载流程图
-          getProcessDefinitionBpmnXML(
-            this.processInstance.processDefinition.id
-          ).then((response) => {
-            this.bpmnXML = response;
-          });
-          // 加载活动列表
-          getActivityList({
-            processInstanceId: this.processInstance.id
-          }).then((response) => {
-            console.log(response, 'response');
-            this.activityList = response;
+            // 取消加载中
+            this.processInstanceLoading = false;
           });
 
-          // 取消加载中
-          this.processInstanceLoading = false;
-        });
+          // 获得流程任务列表(审批记录)
+          this.tasksLoad = true;
+          getTaskListByProcessInstanceId(id).then((response) => {
+            // 审批记录
+            this.tasks = [];
+            // 移除已取消的审批
+            response.forEach((task) => {
+              if (task.result !== 4) {
+                this.tasks.push(task);
+              }
+            });
+            // 排序,将未完成的排在前面,已完成的排在后面;
+            this.tasks.sort((a, b) => {
+              // 有已完成的情况,按照完成时间倒序
+              if (a.endTime && b.endTime) {
+                return b.endTime - a.endTime;
+              } else if (a.endTime) {
+                return 1;
+              } else if (b.endTime) {
+                return -1;
+                // 都是未完成,按照创建时间倒序
+              } else {
+                return b.createTime - a.createTime;
+              }
+            });
 
-        // 获得流程任务列表(审批记录)
-        this.tasksLoad = true;
-        getTaskListByProcessInstanceId(id).then((response) => {
-          // 审批记录
-          this.tasks = [];
-          // 移除已取消的审批
-          response.forEach((task) => {
-            if (task.result !== 4) {
-              this.tasks.push(task);
-            }
-          });
-          // 排序,将未完成的排在前面,已完成的排在后面;
-          this.tasks.sort((a, b) => {
-            // 有已完成的情况,按照完成时间倒序
-            if (a.endTime && b.endTime) {
-              return b.endTime - a.endTime;
-            } else if (a.endTime) {
-              return 1;
-            } else if (b.endTime) {
-              return -1;
-              // 都是未完成,按照创建时间倒序
-            } else {
-              return b.createTime - a.createTime;
-            }
-          });
+            // 需要审核的记录
+            const userId = store.getters.userId;
+            this.tasks.forEach((task) => {
+              if (task.result !== 1 && task.result !== 6) {
+                // 只有待处理才需要
+                return;
+              }
+              if (!task.assigneeUser || task.assigneeUser.id !== userId) {
+                // 自己不是处理人
+                return;
+              }
+            });
 
-          // 需要审核的记录
-          const userId = store.getters.userId;
-          this.tasks.forEach((task) => {
-            if (task.result !== 1 && task.result !== 6) {
-              // 只有待处理才需要
-              return;
-            }
-            if (!task.assigneeUser || task.assigneeUser.id !== userId) {
-              // 自己不是处理人
-              return;
-            }
+            // 取消加载中
+            this.tasksLoad = false;
           });
-
-          // 取消加载中
+        } catch (error) {
+          console.error('Failed to fetch process details:', error);
+          this.$message.error('获取流程信息失败!');
+        } finally {
+          this.processInstanceLoading = false;
           this.tasksLoad = false;
-        });
+        }
       },
       // getStatus: useDictLabel(patrolMatterStatus),
       delete() {},
@@ -745,15 +749,19 @@
       },
       // 表格数据
       async getInfo() {
-        this.pageLoading = true;
-        const res = await getById(this.$route.query.id).catch(() => {
+        try {
+          this.pageLoading = true;
+          const res = await getById(this.$route.query.id);
+          if (res?.data) {
+            this.infoData = res.data;
+            console.log(this.infoData, 'this.infoData');
+            this.getDetail(this.infoData.processInstanceId);
+          }
+        } catch (error) {
+          console.error('Failed to fetch info:', error);
+        } finally {
           this.pageLoading = false;
-        });
-        if (res?.data) {
-          this.infoData = res.data;
-          this.getDetail(this.infoData.processInstanceId);
         }
-        this.pageLoading = false;
       },
       //通过按钮事件
       pass() {

+ 1 - 0
src/views/maintenance/delivery/plan/index.vue

@@ -117,6 +117,7 @@
     data() {
       return {
         addProgramRulesDialog: false,
+        dialogTitle: '',
         // 表格列配置
         columns: [
           {

+ 2 - 2
src/views/maintenance/equipment/workOrder/details.vue

@@ -276,7 +276,7 @@
           </div>
         </div>
         <HeaderTitle title="备品备件申请单" size="16px"></HeaderTitle>
-       <editd :id="infoData.id" />
+        <editd :id="infoData.id" v-if="infoData" />
         <!-- 巡点检、缺陷设备报修记录 -->
         <!-- <div class="repair_notes">
           <HeaderTitle title="缺陷设备报修记录" size="16px"></HeaderTitle>
@@ -323,7 +323,7 @@
 
   export default {
     mixins: [dictMixins],
-    components:{
+    components: {
       editd
     },
     data() {

+ 10 - 11
src/views/sparePartsApply/components/editd.vue

@@ -73,10 +73,9 @@
           { code: 12, label: '配料出库' }
         ],
         statusOpt: [
-          { label: '未提交', value: 0 },
-          { label: '审核中', value: 1 },
-          { label: '审核通过', value: 2 },
-          { label: '审核不通过', value: 3 }
+          { label: '审核中', value: 0 },
+          { label: '审核通过', value: 1 },
+          { label: '审核不通过', value: 2 }
         ]
       };
     },
@@ -130,13 +129,13 @@
             minWidth: 110
           },
           {
-            prop: 'useDeptName',
+            prop: 'receivingDeptName',
             label: '领用部门',
             align: 'center',
             minWidth: 110
           },
           {
-            prop: 'userName',
+            prop: 'recipientName',
             label: '领用人',
             align: 'center',
             minWidth: 110
@@ -164,11 +163,11 @@
               )?.label;
             }
           },
-          {
-            prop: 'approvalUserName',
-            label: '审核人',
-            align: 'center'
-          },
+          // {
+          //   prop: 'approvalUserName',
+          //   label: '审核人',
+          //   align: 'center'
+          // },
           {
             slot: 'approvalStatus',
             label: '状态',

+ 28 - 11
src/views/sparePartsApply/components/search.vue

@@ -104,18 +104,26 @@
     props: [],
     data() {
       // 默认表单数据
-      const defaultWhere = {
-        repairCode: '',
-        warehouseName: '',
-        deviceName: '',
-        categoryName: '',
-        deptIds: '',
-        useDeptId: '',
-        userId: ''
-      };
+      // const defaultWhere = {
+      //   repairCode: '',
+      //   warehouseName: '',
+      //   deviceName: '',
+      //   categoryName: '',
+      //   deptIds: '',
+      //   useDeptId: '',
+      //   userId: ''
+      // };
       return {
         // 表单数据
-        where: { ...defaultWhere },
+        where: {
+          repairCode: '',
+          warehouseName: '',
+          deviceName: '',
+          categoryName: '',
+          deptIds: '',
+          useDeptId: '',
+          userId: ''
+        },
         executorList: []
       };
     },
@@ -134,7 +142,16 @@
       },
       /*  重置 */
       reset() {
-        this.where = { ...this.defaultWhere };
+        this.where = {
+          repairCode: '',
+          warehouseName: '',
+          deviceName: '',
+          categoryName: '',
+          deptIds: '',
+          useDeptId: '',
+          userId: ''
+        };
+        this.executorList = [];
         this.search();
       },
       //选择部门(搜索)

+ 220 - 212
src/views/sparePartsApply/index.vue

@@ -41,8 +41,16 @@
           {{ row.totalWeight }} {{ row.weightUnit }}
         </template>
 
-        <template v-slot:status="{ row }">
-          {{row.status==0?'审核中':'审核通过'}}
+        <template v-slot:approvalStatus="{ row }">
+          {{
+            row.approvalStatus == 0
+              ? '审核中'
+              : row.approvalStatus == 1
+              ? '审核通过'
+              : row.approvalStatus == 2
+              ? '审核不通过'
+              : ''
+          }}
         </template>
         <template v-slot:detailList="{ row }">
           {{ row.detailList.map((item) => item.categoryName).toString() }}
@@ -64,222 +72,222 @@
 </template>
 
 <script>
-import { getList } from '@/api/sparePartsApply/index.js';
-import edit from './components/edit';
+  import { getList } from '@/api/sparePartsApply/index.js';
+  import edit from './components/edit';
 
-import search from './components/search.vue';
-export default {
-  components: {
-    search,
-    edit
-  },
-  data() {
-    return {
-      loading: false,
-      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: '编码',
-          showOverflowTooltip: true,
-          align: 'center',
-          minWidth: 150
-        },
-        {
-          prop: 'repairCode',
-          showOverflowTooltip: true,
-          label: '工单编码',
-          align: 'center',
-          minWidth: 150
-        },
-        {
-          prop: 'repairName',
-          showOverflowTooltip: true,
-          label: '工单名称',
-          align: 'center',
-          minWidth: 110
-        },
-        {
-          prop: 'deviceName',
-          showOverflowTooltip: true,
-          label: '设备名称',
-          align: 'center',
-          formatter: (row, column, cellValue) => {
-            return row.deviceList.map((item) => item.name).toString();
+  import search from './components/search.vue';
+  export default {
+    components: {
+      search,
+      edit
+    },
+    data() {
+      return {
+        loading: false,
+        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: '编码',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 150
+          },
+          {
+            prop: 'repairCode',
+            showOverflowTooltip: true,
+            label: '工单编码',
+            align: 'center',
+            minWidth: 150
+          },
+          {
+            prop: 'repairName',
+            showOverflowTooltip: true,
+            label: '工单名称',
+            align: 'center',
+            minWidth: 110
+          },
+          {
+            prop: 'deviceName',
+            showOverflowTooltip: true,
+            label: '设备名称',
+            align: 'center',
+            formatter: (row, column, cellValue) => {
+              return row.deviceList.map((item) => item.name).toString();
+            },
+            minWidth: 110
+          },
+          {
+            prop: 'fixCode',
+            showOverflowTooltip: true,
+            label: '固资编码',
+            align: 'center',
+            minWidth: 110,
+            formatter: (row, column, cellValue) => {
+              return row.deviceList
+                .filter((item) => item.fixCode)
+                .map((item) => item.fixCode)
+                .toString();
+            }
+          },
+          {
+            prop: 'deviceCode',
+            showOverflowTooltip: true,
+            label: '设备编码',
+            align: 'center',
+            minWidth: 110,
+            formatter: (row, column, cellValue) => {
+              return row.deviceList
+                .filter((item) => item.deviceCode)
+                .map((item) => item.deviceCode)
+                .toString();
+            }
+          },
+          {
+            label: '物品名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            slot: 'detailList',
+            minWidth: 150
+          },
+          {
+            prop: 'receivingDeptName',
+            showOverflowTooltip: true,
+            label: '领用部门',
+            align: 'center',
+            minWidth: 110
+          },
+          {
+            prop: 'recipientName',
+            showOverflowTooltip: true,
+            label: '领用人',
+            align: 'center',
+            minWidth: 110
+          },
+          {
+            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
           },
-          minWidth: 110
-        },
-        {
-          prop: 'fixCode',
-          showOverflowTooltip: true,
-          label: '固资编码',
-          align: 'center',
-          minWidth: 110,
-          formatter: (row, column, cellValue) => {
-            return row.deviceList
-              .filter((item) => item.fixCode)
-              .map((item) => item.fixCode)
-              .toString();
-          }
-        },
-        {
-          prop: 'deviceCode',
-          showOverflowTooltip: true,
-          label: '设备编码',
-          align: 'center',
-          minWidth: 110,
-          formatter: (row, column, cellValue) => {
-            return row.deviceList
-              .filter((item) => item.deviceCode)
-              .map((item) => item.deviceCode)
-              .toString();
-          }
-        },
-        {
-          label: '物品名称',
-          align: 'center',
-          showOverflowTooltip: true,
-          slot: 'detailList',
-          minWidth: 150
-        },
-        {
-          prop: 'receivingDeptName',
-          showOverflowTooltip: true,
-          label: '领用部门',
-          align: 'center',
-          minWidth: 110
-        },
-        {
-          prop: 'recipientName',
-          showOverflowTooltip: true,
-          label: '领用人',
-          align: 'center',
-          minWidth: 110
-        },
-        {
-          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: '出库场景',
-          showOverflowTooltip: true,
-          align: 'center',
-          formatter: (row, column, cellValue) => {
-            return this.outputSceneState.find((item) => item.code == cellValue)
-              ?.label;
-          }
-        },
-        {
-          prop: 'approvalUserName',
-          label: '审核人',
-          showOverflowTooltip: true,
-          align: 'center'
-        },
-        {
-          slot: 'status',
-          showOverflowTooltip: true,
-          label: '状态',
-          align: 'center'
-        },
+          {
+            prop: 'type',
+            label: '出库场景',
+            showOverflowTooltip: true,
+            align: 'center',
+            formatter: (row, column, cellValue) => {
+              return this.outputSceneState.find(
+                (item) => item.code == cellValue
+              )?.label;
+            }
+          },
+          // {
+          //   prop: 'approvalUserName',
+          //   label: '审核人',
+          //   showOverflowTooltip: true,
+          //   align: 'center'
+          // },
+          {
+            slot: 'approvalStatus',
+            showOverflowTooltip: true,
+            label: '状态',
+            align: 'center'
+          },
 
-        {
-          columnKey: 'action',
-          label: '操作',
-          width: 120,
-          align: 'center',
-          resizable: false,
-          fixed: 'right',
-          slot: 'action',
-          showOverflowTooltip: true
-        }
-      ];
-    }
-  },
-  created() {},
-  methods: {
-    statusFormatter(status) {
-      const obj = this.statusOpt.find((i) => i.value == status);
-      return obj && obj.label;
-    },
-    /* 表格数据源 */
-    datasource({ page, limit, where }) {
-      return getList({
-        pageNum: page,
-        size: limit,
-        ...where
-      });
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 120,
+            align: 'center',
+            resizable: false,
+            fixed: 'right',
+            slot: 'action',
+            showOverflowTooltip: true
+          }
+        ];
+      }
     },
+    created() {},
+    methods: {
+      statusFormatter(status) {
+        const obj = this.statusOpt.find((i) => i.value == status);
+        return obj && obj.label;
+      },
+      /* 表格数据源 */
+      datasource({ page, limit, where }) {
+        return getList({
+          pageNum: page,
+          size: limit,
+          ...where
+        });
+      },
 
-    open(row, type) {
-      this.$refs.edit.open(row, type);
-    },
+      open(row, type) {
+        this.$refs.edit.open(row, type);
+      },
 
-    /* 刷新表格 */
-    reload(where) {
-      this.$nextTick(() => {
-        this.$refs.table.reload({ page: 1, where });
-      });
+      /* 刷新表格 */
+      reload(where) {
+        this.$nextTick(() => {
+          this.$refs.table.reload({ page: 1, where });
+        });
+      }
     }
-  }
-};
+  };
 </script>
-