Przeglądaj źródła

解决冲突提交

LAPTOP-16IUEB3P\Lenovo 3 lat temu
rodzic
commit
a4d57f8266

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

@@ -0,0 +1,34 @@
+import request from '@/utils/request';
+
+// 分页
+export async function getPage (data) {
+  const res = await request.get('/eam/repairrequest/page', { params: data });
+  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);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+// 修改
+export async function update (data) {
+  const res = await request.post('/eam/repairrequest/update', data);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+// 详情
+export async function getById (id) {
+  const res = await request.get(`/eam/repairrequest/getById/${id}`);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 209 - 0
src/components/AssetDialog/categoryDialog.vue

@@ -0,0 +1,209 @@
+<!-- 物品信息表 -->
+<template>
+  <el-dialog
+    :title="`添加${typeName}`"
+    :visible.sync="dialogVisible"
+    width="70%"
+    :before-close="handleClose"
+    append-to-body
+  >
+    <div class="search_wrapper">
+      <el-input
+        size="small"
+        v-model="searchParams.code"
+        class="search_input"
+        placeholder="请输入编码"
+      ></el-input>
+      <el-button type="primary" size="small" @click="doSearch">搜索</el-button>
+    </div>
+    <el-row style="height: 80vh">
+      <el-col class="tree-col" :span="6">
+        <div class="table-add" style="margin-left: 10px"></div>
+        <AssetTree
+          @handleNodeClick="handleNodeClick"
+          @setRootId="setRootId"
+          :type="type"
+          :paramsType="'type'"
+          ref="treeList"
+        />
+      </el-col>
+      <el-col :span="18">
+        <el-table
+          ref="dialogMultipleTable"
+          :data="tableData"
+          tooltip-effect="dark"
+          v-loading="tableLoading"
+          style="width: 100%; overflow: auto"
+          height="80vh"
+          border
+          @select="pickSpareData"
+          @select-all="pickSpareData"
+          :header-cell-style="{ background: '#F0F3F3' }"
+        >
+          <el-table-column prop="assetCode" label="物品编码"></el-table-column>
+          <el-table-column prop="assetName" label="物品名称"></el-table-column>
+          <el-table-column
+            :prop="item.prop"
+            :label="item.label"
+            v-for="(item, index) in tableHeader"
+            :key="index"
+          >
+            <template slot-scope="{ row }">
+              <template v-if="item.formatter">{{
+                item.formatter(row)
+              }}</template>
+              <template v-else>{{ row[item.prop] }}</template>
+            </template></el-table-column
+          >
+
+          <el-table-column type="selection" width="55"> </el-table-column>
+        </el-table>
+      </el-col>
+    </el-row>
+
+    <div slot="footer" class="dialog-footer">
+      <el-button size="small" @click="submit" type="primary">提 交</el-button>
+      <el-button size="small" @click="handleClose">关 闭</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+  import AssetTree from '@/components/AssetTree';
+  import { getList as getCategoryList } from '@/api/classifyManage/itemInformation';
+  import { tableHeader } from '@/utils/category.js';
+  import dictMixins from '@/mixins/dictMixins';
+  export default {
+    components: {
+      // CommonTree,
+      AssetTree
+    },
+    mixins: [dictMixins],
+    props: {
+      // 类型
+      type: {
+        type: Array,
+        default: () => []
+      },
+      // 反显列表
+      memoList: {
+        type: Array,
+        default: () => []
+      }
+    },
+    data () {
+      return {
+        dialogVisible: false,
+        searchParams: {
+          code: '',
+          page: 1,
+          size: 99999
+        },
+        tableLoading: false,
+        tableData: [],
+        currentTreeData: {},
+        selectionList: [],
+        rootId: null
+      };
+    },
+    created () {
+      this.requestDict('类型用途');
+    },
+    computed: {
+      typeName () {
+        return this.getDictValue('类型用途', this.type);
+      },
+      tableHeader () {
+        return tableHeader(this.type);
+      }
+    },
+    methods: {
+      open () {
+        this.selectionList = [];
+        this.dialogVisible = true;
+      },
+
+      async doSearch () {
+        const params = {
+          categoryLevelId: this.currentTreeData.id,
+          rootCategoryLevelId: this.rootId,
+          code: this.searchParams.code
+        };
+        this._getClassificationList(params);
+      },
+
+      // 获取根节点id
+      setRootId (id) {
+        this.rootId = id;
+      },
+
+      // 树结构点击事件
+      async handleNodeClick (data, node) {
+        this.currentTreeData = data;
+        this._getClassificationList(data);
+      },
+      // 获取添物品信息表格数据
+      async _getClassificationList (data) {
+        this.tableLoading = true;
+        let params = {
+          page: 1,
+          size: 99999,
+          categoryLevelId: this.currentTreeData.id
+        };
+        const res = await getCategoryList(params);
+        console.log('res', res);
+        this.tableLoading = false;
+        if (res.list.length) {
+          this.tableData = res.list;
+          // 切换树节点时回显添加了的备品备件
+          this.$nextTick(() => {
+            this.memoList.map((item) => {
+              this.tableData.forEach((c) => {
+                if (item.id === c.id) {
+                  this.$refs.dialogMultipleTable.toggleRowSelection(c, true);
+                }
+              });
+            });
+          });
+        } else {
+          this.tableData = [];
+        }
+      },
+      // 备件单选框选择时事件
+      pickSpareData (data) {
+        this.selectionList = data;
+      },
+
+      // 关闭弹窗
+      handleClose () {
+        this.$refs.dialogMultipleTable.clearSelection();
+        this.dialogVisible = false;
+      },
+
+      async submit () {
+        this.$emit('success', this.selectionList);
+        this.handleClose();
+        //   this.form.exportList = this.selectionList
+        //   this.$forceUpdate()
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .tree-col {
+    border: 1px solid #e6ebf5;
+    margin-right: 10px;
+    width: 20%;
+    padding: 0 !important;
+    height: 100%;
+    overflow: auto;
+  }
+  .search_wrapper {
+    margin-bottom: 10px;
+    .search_input {
+      width: 200px;
+      margin-right: 10px;
+    }
+  }
+</style>

+ 1 - 0
src/components/AssetDialog/instanceDialog.vue

@@ -0,0 +1 @@
+<!-- 物品信息表--实例 -->

+ 1 - 0
src/components/Dict/DictSelection.vue

@@ -2,6 +2,7 @@
   <el-select
     v-model="selectVal"
     filterable
+    clearable
     style="width: 100%"
     v-bind="$attrs"
     v-on="$listeners"

+ 2 - 0
src/enum/dict.js

@@ -15,6 +15,8 @@ export default {
   运维计划状态: 'plan_status',
   紧急程度: 'urgent_type',
   委外单状态: 'extrinsic_state',
+  报修来源: 'repair_origin',
+  报修状态: 'report_repair_status',
   告警级别: 'warning_level',
   告警方式: 'warning_style',
   告警触发条件: 'warning_conditions',

+ 82 - 0
src/utils/category.js

@@ -0,0 +1,82 @@
+export const tableHeader = (type) => {
+  switch (+type) {
+    case 3:
+      return [{ label: '牌号', prop: 'brandNum' }];
+    case 8:
+      return [
+        { label: '型号', prop: 'modelType' },
+        { label: '规格', prop: 'specification' }
+      ];
+    case 4:
+      return [
+        { label: '牌号', prop: 'brandNum' },
+        { label: '型号', prop: 'modelType' }
+      ];
+    case 5: //'周转车'
+      return [
+        { label: '规格', prop: 'specification' },
+        {
+          label: '材质',
+          prop: 'texture',
+          formatter (row) {
+            if (!row?.extendField) return '';
+            const extendField = JSON.parse(row.extendField);
+            return extendField.texture;
+          }
+        },
+        {
+          label: '长宽高',
+          prop: '',
+          formatter (row) {
+            if (!row?.extendField) return '';
+            const extendField = JSON.parse(row.extendField);
+            return `${extendField.length || '-'}*${extendField.width || '-'}*${
+              extendField.high || '-'
+            }`;
+          }
+        }
+      ];
+    case 2: //'舟皿'
+      return [
+        { label: '规格', prop: 'specification' },
+        { label: '型号', prop: 'modelType' },
+        {
+          label: '长宽高',
+          prop: '',
+          formatter (row) {
+            if (!row?.extendField) return '';
+            const extendField = JSON.parse(row.extendField);
+            return `${extendField.length || '-'}*${extendField.width || '-'}*${
+              extendField.high || '-'
+            }`;
+          }
+        }
+      ];
+    case 1: //'设备'
+      return [
+        { label: '型号', prop: 'modelType' },
+        { label: '规格', prop: 'specification' }
+      ];
+    case 6: //'模具'
+      return [
+        { label: '牌号', prop: 'brandNum' },
+        { label: '型号', prop: 'modelType' },
+        {
+          label: '收缩系数',
+          prop: '',
+          formatter (row) {
+            if (!row?.extendField) return '';
+            const extendField = JSON.parse(row.extendField);
+            return extendField.shrinkageCoefficient;
+          }
+        }
+      ];
+    case 7: //'备品备件'
+      return [
+        { label: '规格', prop: 'specification' },
+        { label: '型号', prop: 'modelType' }
+      ];
+  }
+
+  return [];
+};

+ 425 - 436
src/views/maintenance/equipment/plan/details.vue

@@ -1,77 +1,47 @@
 <template>
+  <!-- 保养计划审批 -->
   <div class="page" v-loading="pageLoading">
     <el-form label-width="130px">
-<!--      <div class="page-title">
-        <div class="page-title-div">
-          <el-page-header @back="$router.go(-1)" content="计划详情">
-          </el-page-header>
-        </div>
-      </div> -->
-      <!-- tab切换 -->
-<!--      <div class="switch">
-        <div class="switch_left">
-          <ul>
-            <li :class="{ active: num == 1 }" @click="tab(1)">详情</li>
-          </ul>
-        </div>
-        <div class="switch_right">
-          <div class="head_btn">
-          </div>
-        </div>
-      </div> -->
-
-      <div class="content-detail" v-show="num == 1">
+      <div class="content-detail">
         <div class="basic-details">
           <HeaderTitle title="基本信息" size="16px"></HeaderTitle>
           <el-row>
             <el-col :span="12">
               <el-col :span="12">
                 <el-form-item label="计划单号">
-                  <span> {{ data.planCode }} </span>
+                  <span> {{ data.code }} </span>
                 </el-form-item>
               </el-col>
-
               <el-col :span="12">
                 <el-form-item label="保养名称">
-                  <span> {{ data.planName }} </span>
+                  <span> {{ data.name }} </span>
                 </el-form-item>
               </el-col>
               <el-col :span="12">
                 <el-form-item label="保养部门">
-                  <span> {{ data.executorDeptName }} </span>
+                  <!-- <span> {{ data.executorDeptName }} </span> -->
                 </el-form-item>
               </el-col>
               <el-col :span="12">
                 <el-form-item label="保养人员">
-                  <span> {{ data.executorName }} </span>
+                  <!-- <span> {{ data.executorName }} </span> -->
                 </el-form-item>
               </el-col>
               <el-col :span="12">
                 <el-form-item label="计划完成时长">
-                  <span> {{ data.duration?data.duration+'分钟':'' }} </span>
-                </el-form-item>
-              </el-col>
-              <!-- <el-col :span="12">
-                <el-form-item label="计划开始时间">
-                  <span> {{ data.createTime }} </span>
+                  <span v-if="data.duration >= 0">{{ data.duration }}分钟</span>
                 </el-form-item>
               </el-col>
-              <el-col :span="12">
-                <el-form-item label="计划结束时间">
-                  <span> {{ data.planFinishTime }} </span>
-                </el-form-item>
-              </el-col> -->
               <el-col :span="12">
                 <el-form-item label="设备分类">
-                  <span> {{ data.bizTypeName }} </span>
+                  <span> {{ data.categoryLevelName }} </span>
                 </el-form-item>
               </el-col>
               <el-col :span="12">
                 <el-form-item label="规则名称">
-                  <span> {{ data.ruleName }} </span>
+                  <span> {{ data.ruleInfo && data.ruleInfo.name }} </span>
                 </el-form-item>
               </el-col>
-
               <el-col :span="12">
                 <el-form-item label="创建人">
                   <span> {{ data.createUserName }} </span>
@@ -79,7 +49,7 @@
               </el-col>
               <el-col :span="12">
                 <el-form-item label="创建部门">
-                  <span> {{ data.createOrgName }} </span>
+                  <!-- <span> {{ data.createOrgName }} </span> -->
                 </el-form-item>
               </el-col>
               <el-col :span="12">
@@ -99,81 +69,100 @@
           </el-row>
         </div>
 
-        <!-- 巡点检、保养设备 -->
+        <!-- 保养、保养设备 -->
         <div class="maintain_equipment_info">
-          <div class="maintain_equipment_info_title">
-            <span>保养设备</span>
-          </div>
+          <HeaderTitle title="保养设备" size="16px"></HeaderTitle>
           <div class="maintain_equipment_info_content">
             <div
               class="equipment_item"
-              v-for="item in data.planEquiList"
+              v-for="item in data.planDeviceList"
               :key="item.id"
             >
-              <div class="equipment_info">
+              <div class="equipment_info" v-if="item.substance">
                 <div class="item_info">
                   <span class="item_label">设备编码</span>
-                  <span class="item_value">{{ item.equiCode }}</span>
+                  <span class="item_value">{{ item.substance.code }}</span>
                 </div>
                 <div class="item_info">
                   <span class="item_label">设备名称</span>
-                  <span class="item_value">{{ item.equiName }}</span>
+                  <span class="item_value">{{ item.substance.name }}</span>
                 </div>
                 <div class="item_info">
                   <span class="item_label">设备型号</span>
-                  <span class="item_value">{{ item.equiModel }}</span>
+                  <span class="item_value">{{ item.substance.model }}</span>
                 </div>
                 <div class="item_info">
                   <span class="item_label">设备位置</span>
-                  <span class="item_value">{{ item.equiLocation }}</span>
+                  <span class="item_value">{{
+                    item.substance.positionNames
+                  }}</span>
                 </div>
               </div>
               <p>操作事项</p>
               <div class="matter_info">
-                <el-table :data="item.itemList" border>
+                <el-table :data="item.workItems" border>
                   <el-table-column label="序号" align="center" width="80">
                     <template slot-scope="scope">
                       <span>{{ scope.$index + 1 }}</span>
                     </template>
                   </el-table-column>
-                  <el-table-column label="事项" prop="name" />
+                  <el-table-column label="事项" prop="item" />
                   <el-table-column label="内容" prop="content" />
-                  <el-table-column label="标准" prop="norm" />
+                  <el-table-column label="标准" prop="standard" />
                 </el-table>
               </div>
               <p>备品备件</p>
               <div class="matter_info">
-                <el-table :data="item.sparePartsApplyRespList" border>
+                <el-table :data="item.sparePart" border>
                   <el-table-column label="序号" align="center" width="80">
                     <template slot-scope="scope">
                       <span>{{ scope.$index + 1 }}</span>
                     </template>
                   </el-table-column>
-                  <el-table-column label="备件名称" align="center" prop="informationName">
+                  <el-table-column
+                    label="备件名称"
+                    align="center"
+                    prop="categoryName"
+                  >
                   </el-table-column>
-                  <el-table-column label="规格型号" align="center" prop="modelType">
+                  <el-table-column
+                    label="规格型号"
+                    align="center"
+                    prop="modelType"
+                  >
+                    <template slot-scope="{ row }">
+                      {{ row.specification }}/{{ row.model }}
+                    </template>
                   </el-table-column>
-                  <el-table-column label="所需数量" align="center" prop="num">
+                  <el-table-column
+                    label="所需数量"
+                    align="center"
+                    prop="needNum"
+                  >
                   </el-table-column>
-                  <el-table-column label="单位" align="center" prop="measuringUnit">
+                  <el-table-column label="单位" align="center" prop="unit">
                   </el-table-column>
                 </el-table>
               </div>
             </div>
           </div>
         </div>
-        <!-- 巡点检、审批信息 -->
+        <!-- 保养、审批信息 -->
         <div class="examine_info">
-					<HeaderTitle title="审批信息" size="16px"></HeaderTitle>
+          <HeaderTitle title="审批信息" size="16px"></HeaderTitle>
           <div class="item_row">
             <div class="item_info">
               <span class="item_label border_top">审批结果</span>
-              <span class="item_value" v-if="data.auditResult == 0">驳回</span>
-              <span class="item_value" v-if="data.auditResult == 1">通过</span>
+              <span class="item_value" v-if="data.approvalResult == 0"
+                >驳回</span
+              >
+              <span class="item_value" v-if="data.approvalResult == 1"
+                >通过</span
+              >
             </div>
             <div class="item_info border_top">
               <span class="item_label">审批人</span>
-              <span class="item_value">{{ data.verifyUserName }}</span>
+              <!-- <span class="item_value">{{ data.verifyUserName }}</span> -->
             </div>
             <div class="item_info border_right border_top">
               <span class="item_label">审批时间</span>
@@ -188,9 +177,9 @@
             </div>
           </div>
         </div>
-        <!-- 巡点检、执行信息 -->
+        <!-- 保养、执行信息 -->
         <div class="execute_info">
-					<HeaderTitle title="执行信息" size="16px"></HeaderTitle>
+          <HeaderTitle title="执行信息" size="16px"></HeaderTitle>
           <el-table :data="data.planWorkOrderList">
             <el-table-column label="序号" align="center" width="60">
               <template slot-scope="scope">
@@ -201,7 +190,6 @@
               label="工单编号"
               align="center"
               prop="workOrderCode"
-              width="150"
             />
             <el-table-column label="状态" align="center">
               <template slot-scope="scope">
@@ -221,22 +209,27 @@
             <!-- <el-table-column
               label="开始时间"
               align="center"
-              prop="createTime"
+              prop="acceptTime"
             />
-			<el-table-column
+            <el-table-column
               label="完成时间"
               align="center"
               prop="finishTime"
             />
-			<el-table-column
+            <el-table-column
               label="计划工时"
               align="center"
               prop="planManhour"
-            />-->
+            />
+            <el-table-column
+              label="实际工时"
+              align="center"
+              prop="practicalManhour"
+            /> -->
             <el-table-column
               label="开始时间"
               align="center"
-              prop="createTime"
+              prop="acceptTime"
               width="160"
             >
               <template slot-scope="scope">
@@ -282,7 +275,7 @@
           >
           <!-- <el-button class="cancel-btn">关闭</el-button> -->
         </div>
-        <div class="textbox" v-if="showtext">
+        <div class="textbox" v-if="showtext" ref="rejectContent">
           <el-input
             type="textarea"
             placeholder="请输入驳回原因"
@@ -292,424 +285,420 @@
             show-word-limit
           >
           </el-input>
-          <div style="margin-top: 10px" class="textbtnbox">
+          <div class="textbtnbox">
             <el-button size="small" round @click="cancelreject">取消</el-button>
             <el-button size="small" round @click="surereject">提交</el-button>
           </div>
         </div>
       </div>
     </el-form>
-
-    <!-- 打印内容 style="display:none"-->
-    <!-- 	<div id="printHtml" >
-		<div>
-			<div class="top-title">基本信息</div>
-			<div>
-				<div>
-           <div></div><div></div><div></div>
-
-        </div>
-			</div>
-		</div>
-	</div> -->
   </div>
 </template>
+
 <script>
-// import printJs from 'print-js'
-// import { getDetail, sendAudit , getSparePartsApplyDetail } from '@/api/stockManagement/stocking'
-// import { useDictLabel, patrolMatterStatus } from '@/utils/dict/index'
-export default {
-  data () {
-    return {
-      num: 1,
-      pageLoading: false,
-      infoData: {
-        type: '',
-        area: { province: {}, area: {}, city: {} },
-        mgrOrg: {},
-        manager: {}
-      },
-      dialogVisible: false,
-      data: {},
-      typeValue: null,
-      contract_type: [],
-      status: [
-        {
-          value: true,
-          label: '失效'
+  // import { getDetail, sendAudit } from '@/api/stockManagement/stocking'
+  // import { useDictLabel, patrolMatterStatus } from '@/utils/dict/index'
+  import { getById } from '@/api/maintenance/patrol_maintenance';
+  export default {
+    data () {
+      return {
+        num: 1,
+        infoData: {
+          type: '',
+          area: { province: {}, area: {}, city: {} },
+          mgrOrg: {},
+          manager: {}
         },
-        {
-          value: false,
-          label: '生效'
-        }
-      ],
-      ruleItem: [],
-      cause: '',
-      showtext: false
-    }
-  },
-  async created () {
-    // this.getInfo()
-  },
-  methods: {
-    // getStatus: useDictLabel(patrolMatterStatus),
-    delete () {},
-    // 点击切换事件
-    tab (index) {
-      this.num = index
+        dialogVisible: false,
+        data: {},
+        pageLoading: false,
+        typeValue: null,
+        contract_type: [],
+        cycleOptObj: {
+          1: '时/次',
+          2: '天/次',
+          //3: '周/次',
+          4: '月/次',
+          5: '年/次',
+          11: '次/天',
+          //12: '次/周',
+          13: '次/月',
+          14: '次/年'
+        },
+        status: [
+          {
+            value: true,
+            label: '失效'
+          },
+          {
+            value: false,
+            label: '生效'
+          }
+        ],
+        ruleItem: [],
+        cause: '',
+        showtext: false
+      };
     },
-    // 表格数据
-    async getInfo () {
-      try {
-        this.pageLoading = true
-        let res = await getDetail({ id: this.$route.query.id })
-        if (res?.success) {
-          this.data = res.data
-          this.data.planEquiList = this.data.planEquiList.filter(
-            item => item.itemList && item.itemList.length > 0
-          )
-        }
-        this.pageLoading = false
-      } catch (error) {
-        this.pageLoading = false
-      }
+    async created () {
+      this.getInfo();
     },
-
-
-    //通过按钮事件
-    pass () {
-      let params = {
-        id: this.$route.query.id,
-        checked: true,
-        myHandleId: this.$route.query.dbid,
-        handleType: 0,
-        type: 2,
-        cause: ''
-      }
-      sendAudit(params).then(res => {
-        if (res.success) {
-          this.$message.success('审批通过!')
-          this.$router.back()
+    methods: {
+      // getStatus: useDictLabel(patrolMatterStatus),
+      delete () {},
+      // 点击切换事件
+      tab (index) {
+        this.num = index;
+      },
+      // 表格数据
+      async getInfo () {
+        let res = await getById(this.$route.query.id).catch(() => {
+          this.pageLoading = false;
+        });
+        if (res?.data) {
+          this.data = res.data;
+          this.data.planEquiList = this.data.planEquiList.filter(
+            (item) => item.itemList && item.itemList.length > 0
+          );
         }
-      })
-    },
-    //驳回按钮事件
-    reject () {
-      this.showtext = true
-      let bodyscrollHeight = document.body.scrollHeight;
-      this.$nextTick(()=>{
-           document.documentElement.scrollTop = bodyscrollHeight
-      })
-    },
-    cancelreject () {
-      this.showtext = false
-    },
-    surereject () {
-      if (!this.cause) {
-        this.$message.info('请填写驳回原因!')
-      } else {
+        this.pageLoading = false;
+      },
+      //通过按钮事件
+      pass () {
         let params = {
           id: this.$route.query.id,
-          checked: false,
+          checked: true,
           myHandleId: this.$route.query.dbid,
-          handleType: 0,
+          cause: '',
           type: 2,
-          cause: this.cause
-        }
-        sendAudit(params).then(res => {
+          handleType: 0
+        };
+        sendAudit(params).then((res) => {
           if (res.success) {
-            this.$message.success('审批驳回!')
-            this.$router.back()
+            this.$message.success('审批通过!');
+            this.$router.back();
           }
-        })
+        });
+      },
+      //驳回按钮事件
+      reject () {
+        this.showtext = true;
+        let bodyscrollHeight = document.body.scrollHeight;
+        this.$nextTick(() => {
+          document.documentElement.scrollTop = bodyscrollHeight;
+        });
+      },
+      cancelreject () {
+        this.showtext = false;
+        this.cause = '';
+      },
+      surereject () {
+        if (!this.cause) {
+          this.$message.info('请填写驳回原因!');
+        } else {
+          let params = {
+            id: this.$route.query.id,
+            checked: false,
+            myHandleId: this.$route.query.dbid,
+            cause: this.cause,
+            type: 2,
+            handleType: 0
+          };
+          sendAudit(params).then((res) => {
+            if (res.success) {
+              this.$message.success('驳回成功!');
+              this.$router.back();
+            }
+          });
+        }
       }
     }
-  }
-}
+  };
 </script>
 
 <style lang="scss" scoped>
-// @import '@/assets/css/oaa.scss';
-.page {
-  padding: 10px;
-}
-.page-title {
-  background: #fff;
-  font-size: 18px;
-  padding: 6px 20px;
-  font-weight: 500;
-  .page-title-div {
-    margin: 5px 0;
-    height: 30px;
-    line-height: 30px;
-    border-bottom: 1px solid #eaeefb;
-    position: relative;
-    .title-div-no {
-      margin-left: 10px;
-      font-weight: 400;
-      color: #909090;
-      font-size: 14px;
+  // @import '@/assets/css/oaa.scss';
+  .page {
+    padding: 10px;
+  }
+  .page-title {
+    background: #fff;
+    font-size: 18px;
+    padding: 6px 20px;
+    font-weight: 500;
+    .page-title-div {
+      margin: 5px 0;
+      height: 30px;
+      line-height: 30px;
+      border-bottom: 1px solid #eaeefb;
+      .title-div-no {
+        margin-left: 10px;
+        font-weight: 400;
+        color: #909090;
+        font-size: 14px;
+      }
     }
   }
-}
-.page-data {
-  padding-top: 10px;
-}
-.content-detail {
-  background: #fff;
-  padding: 20px;
-}
-.flows {
-  .flow-left {
-    width: 156px;
-    height: 70px;
-    border: 1px dashed #ccc;
-    padding: 10px;
+  .page-data {
+    padding-top: 10px;
   }
-  .row {
-    margin-top: 13px;
+  .content-detail {
+    background: #fff;
+    padding: 20px;
   }
-}
-.basic-details-title {
-  margin-bottom: 12px;
-  margin-top: 20px;
-  border-bottom: 1px solid #157a2c;
-  padding-bottom: 8px;
-  display: flex;
-  justify-content: space-between;
-}
-.basic-details-title .border-span {
-  height: 18px;
-  font-size: 16px;
-  border-left: 4px solid #157a2c;
-  padding-left: 8px;
-
-  font-weight: 500;
-}
-.examine_info {
-  margin-bottom: 30px;
-  .examine_info_title {
-    border-bottom: 1px solid #157a2c;
-    padding-bottom: 3px;
-    margin-bottom: 20px;
-    > span {
-      display: inline-block;
-      line-height: 16px;
-      border-left: 6px solid #157a2c;
-      padding-left: 6px;
+  .flows {
+    .flow-left {
+      width: 156px;
+      height: 70px;
+      border: 1px dashed #ccc;
+      padding: 10px;
+    }
+    .row {
+      margin-top: 13px;
     }
   }
-  .item_row {
+  .basic-details-title {
+    margin-bottom: 12px;
+    margin-top: 20px;
+    border-bottom: 1px solid #1890ff;
+    padding-bottom: 8px;
     display: flex;
-    flex-wrap: wrap;
-    font-size: 14px;
-    padding: 0 15px;
-    box-sizing: border-box;
-    .item_info {
-      width: 33.33%;
-      height: 24px;
-      line-height: 24px;
-      display: flex;
-      &.border_right {
-        border-right: 1px solid #f2f2f2;
-      }
-      &.border_top {
-        border-top: 1px solid #f2f2f2;
-      }
-      &.reason {
-        width: 100%;
-      }
-      .item_label {
-        width: 90px;
-        text-align: center;
-        background-color: #f2f2f2;
-        font-weight: 700;
+    justify-content: space-between;
+  }
+  .basic-details-title .border-span {
+    height: 18px;
+    font-size: 16px;
+    border-left: 4px solid #1890ff;
+    padding-left: 8px;
+
+    font-weight: 500;
+  }
+  .heade-right {
+    // float: right;
+    .heade-right-content {
+      margin-right: 12px;
+      font-size: 14px;
+      display: inline-block;
+      .content-key {
+        color: #3e3e3e;
+        margin-right: 12px;
+        font-weight: 500;
       }
-      .item_value {
-        border-bottom: 1px solid #f2f2f2;
-        flex: 1;
-        padding-left: 5px;
+      .content-value {
+        color: #000;
       }
     }
   }
-}
-.heade-right {
-  // float: right;
-  .heade-right-content {
-    margin-right: 12px;
+  .list-title {
     font-size: 14px;
+    color: #3e3e3e;
+    margin: 10px 0px;
+  }
+  .goods {
+    background: #a30014;
+    border: 1px solid #a30014;
+  }
+  .details-title {
     display: inline-block;
-    .content-key {
-      color: #3e3e3e;
-      margin-right: 12px;
-      font-weight: 500;
-    }
-    .content-value {
-      color: #000;
-    }
+    color: #6e6e6e;
+    font-size: 14px;
+    font-weight: bold;
+    margin-right: 13px;
+    width: 70px;
+    text-align: right;
   }
-}
-.execute_info {
-  .execute_info_title {
-    border-bottom: 1px solid #157a2c;
-    padding-bottom: 3px;
-    margin-bottom: 20px;
-    > span {
-      display: inline-block;
-      line-height: 16px;
-      border-left: 6px solid #157a2c;
-      padding-left: 6px;
-    }
+  .details-con {
+    color: #3e3e3e;
+    font-size: 14px;
+  }
+  .detailed-tab {
+    margin-left: 10px;
+    margin-top: 10px;
   }
-  ::v-deep .el-table th.el-table__cell {
-    background-color: #f2f2f2;
+  ::v-deep .el-form-item--medium .el-form-item__label {
+    color: #6e6e6e;
+    font-size: 14px;
+    font-weight: bold;
   }
-  ::v-deep .el-table .el-table__cell {
-    padding: 5px 0;
+  .warehouse {
+    display: block;
+    border-bottom: 1px solid #eaeefb;
+    padding: 10px 0;
   }
-}
-.list-title {
-  font-size: 14px;
-  color: #3e3e3e;
-  margin: 10px 0px;
-}
-.goods {
-  background: #a30014;
-  border: 1px solid #a30014;
-}
-.details-title {
-  display: inline-block;
-  color: #6e6e6e;
-  font-size: 14px;
-  font-weight: bold;
-  margin-right: 13px;
-  width: 70px;
-  text-align: right;
-}
-.details-con {
-  color: #3e3e3e;
-  font-size: 14px;
-}
-.detailed-tab {
-  margin-left: 10px;
-  margin-top: 10px;
-}
-::v-deep .el-form-item--medium .el-form-item__label {
-  color: #6e6e6e;
-  font-size: 14px;
-  font-weight: bold;
-}
-.warehouse {
-  display: block;
-  border-bottom: 1px solid #eaeefb;
-  padding: 10px 0;
-}
-.box-card {
-  .store-box {
-    width: 80%;
-    .store-box-span {
-      display: inline-block;
-      font-size: 14px;
-      height: 50px;
-      width: 50px;
-      text-align: center;
-      line-height: 50px;
-      color: #fff;
-      margin: 2px;
+  .box-card {
+    .store-box {
+      width: 80%;
+      .store-box-span {
+        display: inline-block;
+        font-size: 14px;
+        height: 50px;
+        width: 50px;
+        text-align: center;
+        line-height: 50px;
+        color: #fff;
+        margin: 2px;
+      }
     }
   }
-}
-.vacant {
-  background: #3196fb;
-}
-.inUse {
-  background: #157a2c;
-}
-.invalid {
-  background: #cccccc;
-}
-.full {
-  background: #cc3300;
-}
+  .vacant {
+    background: #3196fb;
+  }
+  .inUse {
+    background: #157a2c;
+  }
+  .invalid {
+    background: #cccccc;
+  }
+  .full {
+    background: #cc3300;
+  }
 
-.maintain_equipment_info {
-  .maintain_equipment_info_title {
-    border-bottom: 1px solid #157a2c;
-    padding-bottom: 3px;
-    margin-bottom: 20px;
-    > span {
-      display: inline-block;
-      line-height: 16px;
-      border-left: 6px solid #157a2c;
-      padding-left: 6px;
+  .maintain_equipment_info {
+    .maintain_equipment_info_title {
+      border-bottom: 1px solid #1890ff;
+      padding-bottom: 3px;
+      margin-bottom: 20px;
+      > span {
+        display: inline-block;
+        line-height: 16px;
+        border-left: 6px solid #1890ff;
+        padding-left: 6px;
+      }
     }
-  }
-  .maintain_equipment_info_content {
-    padding: 0 30px;
-    .equipment_item {
-      border: 1px solid #ccc;
-      font-size: 14px;
-      padding: 15px;
-      margin-bottom: 30px;
-      .equipment_info {
-        display: flex;
-        flex-wrap: wrap;
-        border: 1px solid #ddd;
-        .item_info {
-          width: 33.33%;
-          height: 24px;
-          line-height: 24px;
+    .maintain_equipment_info_content {
+      padding: 0 30px;
+      .equipment_item {
+        border: 1px solid #ccc;
+        font-size: 14px;
+        padding: 15px;
+        margin-bottom: 30px;
+        .equipment_info {
           display: flex;
-          .item_label {
-            width: 90px;
-            text-align: center;
-            background-color: #f2f2f2;
-            font-weight: 700;
-          }
-          .item_value {
-            border-bottom: 1px solid #f2f2f2;
-            flex: 1;
-            padding-left: 5px;
-          }
-          &:last-child {
-            width: 100%;
+          flex-wrap: wrap;
+          border: 1px solid #ddd;
+          .item_info {
+            width: 33.33%;
+            height: 24px;
+            line-height: 24px;
+            display: flex;
+            .item_label {
+              width: 90px;
+              text-align: center;
+              background-color: #f2f2f2;
+              font-weight: 700;
+            }
             .item_value {
-              border: 0;
+              border-bottom: 1px solid #f2f2f2;
+              flex: 1;
+              padding-left: 5px;
+            }
+            &:last-child {
+              width: 100%;
+              .item_value {
+                border: 0;
+              }
+            }
+          }
+        }
+        > p {
+          margin-top: 20px;
+          color: #797979;
+        }
+        .matter_info {
+          ::v-deep .el-table {
+            th.el-table__cell {
+              background-color: #f2f2f2;
+              padding: 0;
+            }
+            td.el-table__cell {
+              padding: 0;
             }
           }
         }
       }
-      > p {
-        margin-top: 20px;
-        color: #797979;
+    }
+  }
+  .examine_info {
+    margin-bottom: 30px;
+    .examine_info_title {
+      border-bottom: 1px solid #1890ff;
+      padding-bottom: 3px;
+      margin-bottom: 20px;
+      > span {
+        display: inline-block;
+        line-height: 16px;
+        border-left: 6px solid #1890ff;
+        padding-left: 6px;
       }
-      .matter_info {
-        ::v-deep .el-table {
-          th.el-table__cell {
-            background-color: #f2f2f2;
-            padding: 0;
-          }
-          td.el-table__cell {
-            padding: 0;
-          }
+    }
+    .item_row {
+      display: flex;
+      flex-wrap: wrap;
+      font-size: 14px;
+      padding: 0 15px;
+      box-sizing: border-box;
+      .item_info {
+        width: 33.33%;
+        height: 24px;
+        line-height: 24px;
+        display: flex;
+        &.border_right {
+          border-right: 1px solid #f2f2f2;
+        }
+        &.border_top {
+          border-top: 1px solid #f2f2f2;
+        }
+        &.reason {
+          width: 100%;
+        }
+        .item_label {
+          width: 90px;
+          text-align: center;
+          background-color: #f2f2f2;
+          font-weight: 700;
+        }
+        .item_value {
+          border-bottom: 1px solid #f2f2f2;
+          flex: 1;
+          padding-left: 5px;
         }
       }
     }
   }
-}
-.btnbox {
-  display: flex;
-  justify-content: center;
-  margin-top: 10px;
-}
-::v-deep .el-button {
-  padding: 10px 20px;
-  margin-right: 10px;
-}
-.textbox {
-  margin-top: 10px;
-}
-.head_btn {
-  margin: -5px 10px 0 0;
-}
+  .execute_info {
+    .execute_info_title {
+      border-bottom: 1px solid #1890ff;
+      padding-bottom: 3px;
+      margin-bottom: 20px;
+      > span {
+        display: inline-block;
+        line-height: 16px;
+        border-left: 6px solid #1890ff;
+        padding-left: 6px;
+      }
+    }
+    ::v-deep .el-table th.el-table__cell {
+      background-color: #f2f2f2;
+    }
+    ::v-deep .el-table .el-table__cell {
+      padding: 5px 0;
+    }
+  }
+  .btnbox {
+    display: flex;
+    justify-content: center;
+    margin-top: 10px;
+  }
+  ::v-deep .el-button {
+    padding: 10px 20px;
+    margin-right: 10px;
+  }
+  .textbox {
+    margin-top: 10px;
+  }
+  .textbtnbox {
+    margin-top: 10px;
+    display: flex;
+    justify-content: center;
+  }
 </style>

+ 7 - 5
src/views/maintenance/patrol/plan/details.vue

@@ -90,22 +90,24 @@
               v-for="item in data.planDeviceList"
               :key="item.id"
             >
-              <div class="equipment_info">
+              <div class="equipment_info" v-if="item.substance">
                 <div class="item_info">
                   <span class="item_label">设备编码</span>
-                  <span class="item_value">{{ item.equiCode }}</span>
+                  <span class="item_value">{{ item.substance.code }}</span>
                 </div>
                 <div class="item_info">
                   <span class="item_label">设备名称</span>
-                  <span class="item_value">{{ item.equiName }}</span>
+                  <span class="item_value">{{ item.substance.name }}</span>
                 </div>
                 <div class="item_info">
                   <span class="item_label">设备型号</span>
-                  <span class="item_value">{{ item.equiModel }}</span>
+                  <span class="item_value">{{ item.substance.model }}</span>
                 </div>
                 <div class="item_info">
                   <span class="item_label">设备位置</span>
-                  <span class="item_value">{{ item.equiLocation }}</span>
+                  <span class="item_value">{{
+                    item.substance.positionNames
+                  }}</span>
                 </div>
               </div>
               <p>操作事项</p>

+ 240 - 240
src/views/maintenance/repair/repairNotes/components/addDialog.vue

@@ -106,7 +106,7 @@
         <el-row>
           <el-col :span="12">
             <el-form-item label="接收人部门:" prop="recipient">
-<!--              <selectTree
+              <!--              <selectTree
                 class="form-ipt"
                 style="width: 100%"
                 ref="tree"
@@ -169,7 +169,7 @@
           </el-col>
           <el-col :span="24">
             <el-form-item label="图片:" prop="repairsImg">
-            <!--  <SelectUpload
+              <!--  <SelectUpload
                 multiple
                 ref="selectUploadRef"
                 @getImgs="getImgs"
@@ -188,267 +188,267 @@
       <el-button type="primary" size="small" @click="submitAdd">提交</el-button>
       <el-button size="small" @click="handleClose">关闭</el-button>
     </div>
-    <EquipmentDialog ref="equipmentDialogRef" @submit="selectedEquipment" />
+    <CategoryDialog
+      ref="equipmentDialogRef"
+      @success="selectedEquipment"
+      type="1"
+    />
   </el-dialog>
 </template>
 
 <script>
-// import repair from '@/api/maintenance/repair/repair'
-// import { geDeptTree, geUserlist } from '@/api/maintenance/repair/repair'
-import EquipmentDialog from './EquipmentDialog.vue'
-// import SelectUpload from '@/components/selectUpload'
-// import { getRuleNo } from '@/utils'
-// import selectTree from '@/components/selectTree'
-// import user from '@/api/main/user'
-// import { getNewinfo } from '@/api/stockManagement/stocking'
+  import CategoryDialog from '@/components/AssetDialog/categoryDialog';
 
-export default {
-  props: {
-    dialogTitle: {
-      type: String,
-      default: '新增报修记录'
+  export default {
+    props: {
+      dialogTitle: {
+        type: String,
+        default: '新增报修记录'
+      },
+      deviceInfo: {
+        type: Object,
+        default: {}
+      },
+      infoData: {
+        type: Object,
+        default: {}
+      }
     },
-    deviceInfo: {
-      type: Object,
-      default: {}
+    components: {
+      CategoryDialog
+      // SelectUpload, selectTree
     },
-    infoData: {
-      type: Object,
-      default: {}
-    }
-  },
-  components: { EquipmentDialog,
-    // SelectUpload, selectTree
-  },
-  watch: {
-    infoData (val) {
-      console.log('vall', val)
-      this.selectedEquipment(val)
-      // this.addForm = JSON.parse(JSON.stringify(val))
-      // console.log(' this.addForm', this.addForm)
-      if (val.repairsImg) {
-        this.initData = val.repairsImg.split(',').map(item => {
-          return {
-            name: item.substring('/download/'.length),
-            url: item
-          }
-        })
-      }
+    watch: {
+      infoData (val) {
+        console.log('vall', val);
+        this.selectedEquipment(val);
+        // this.addForm = JSON.parse(JSON.stringify(val))
+        // console.log(' this.addForm', this.addForm)
+        if (val.repairsImg) {
+          this.initData = val.repairsImg.split(',').map((item) => {
+            return {
+              name: item.substring('/download/'.length),
+              url: item
+            };
+          });
+        }
 
-      if (val.receiveUser) {
-        const recipient = JSON.parse(val.receiveUser).map(item => {
-          return item.receiveUserId + ',' + item.receiveUserName
-        })
-        this.$set(this.addForm, 'recipient', recipient)
-      }
+        if (val.receiveUser) {
+          const recipient = JSON.parse(val.receiveUser).map((item) => {
+            return item.receiveUserId + ',' + item.receiveUserName;
+          });
+          this.$set(this.addForm, 'recipient', recipient);
+        }
 
-      this.$set(this.addForm, 'expectedTime', val.expectedTime)
-      this.$set(this.addForm, 'repairsDescription', val.repairsDescription)
-      this.$nextTick(() => {
-        this.recipientDep = val.repairsDeptCode
-        this.getUserList(this.recipientDep)
-      })
-    },
-    deviceInfo (val) {
-      this.deviceData = val
-    }
-  },
-  data () {
-    return {
-      addRepairNotesDialog: false,
-      addForm: {
-        // repairsCode: getRuleNo('BX'), // 报修记录编号
-        equiCode: '', // 设备编码
-        equiName: '', // 设备名称
-        fixedAssetCode: '', // 固定资产编码
-        equiModel: '', // 规格型号
-        ownerDeptCode: '', // 权属部门code
-        ownerDeptName: '', // 权属部门名称
-        expectedTime: '', // 期望完成时间
-        recipient: [], // 接收人集合
-        repairsDescription: '', // 故障描述
-        repairsImg: '' // 图片
-        // repairsVideo: '' // 视频
+        this.$set(this.addForm, 'expectedTime', val.expectedTime);
+        this.$set(this.addForm, 'repairsDescription', val.repairsDescription);
+        this.$nextTick(() => {
+          this.recipientDep = val.repairsDeptCode;
+          this.getUserList(this.recipientDep);
+        });
       },
-      initData: [],
-      recipientDep: '', // 接收人部门
-      deptName: '', //接收人部门名称
-      recipientDepList: [], // 接收人部门列表
-      recipientList: [], // 接收人
-      addFormRules: {},
-      deviceData: {
-        ownerName: '', // 权属人
-        ownerPhone: '', // 权属部门电话
-        equiLocation: '' // 设备位置
-      }
-    }
-  },
-  created () {
-    // this.getrecipientDep()
-  },
-  methods: {
-    handleClose () {
-      // this.$refs.selectUploadRef.clearUploadFiles()
-      this.initData = []
-      this.addRepairNotesDialog = false
-      this.recipientDep = ''
-      this.addForm = {
-        // repairsCode: getRuleNo('BX'), // 报修记录编号
-        equiTypeId: '', // 设备分类ID
-        equiTypeName: '', // 	设备分类名称
-        equiCode: '', // 设备编码
-        equiName: '', // 设备名称
-        fixedAssetCode: '', // 固定资产编码
-        equiModel: '', // 规格型号
-        ownerDeptCode: '', // 权属部门code
-        ownerDeptName: '', // 权属部门名称
-        expectedTime: '', // 期望完成时间
-        repairsDescription: '', // 故障描述
-        repairsImg: '' // 图片
-        // repairsVideo: '' // 视频
-      }
-      this.deviceData = {
-        ownerName: '', // 权属人
-        ownerPhone: '', // 权属人电话
-        equiLocation: '' // 设备位置
+      deviceInfo (val) {
+        this.deviceData = val;
       }
     },
-    // 打开选择设备弹窗
-    selectEquipment () {
-      this.$refs.equipmentDialogRef.equipmentdialog = true
+    data () {
+      return {
+        addRepairNotesDialog: false,
+        addForm: {
+          // repairsCode: getRuleNo('BX'), // 报修记录编号
+          equiCode: '', // 设备编码
+          equiName: '', // 设备名称
+          fixedAssetCode: '', // 固定资产编码
+          equiModel: '', // 规格型号
+          ownerDeptCode: '', // 权属部门code
+          ownerDeptName: '', // 权属部门名称
+          expectedTime: '', // 期望完成时间
+          recipient: [], // 接收人集合
+          repairsDescription: '', // 故障描述
+          repairsImg: '' // 图片
+          // repairsVideo: '' // 视频
+        },
+        initData: [],
+        recipientDep: '', // 接收人部门
+        deptName: '', //接收人部门名称
+        recipientDepList: [], // 接收人部门列表
+        recipientList: [], // 接收人
+        addFormRules: {},
+        deviceData: {
+          ownerName: '', // 权属人
+          ownerPhone: '', // 权属部门电话
+          equiLocation: '' // 设备位置
+        }
+      };
     },
-    // 上传图片
-    getImgs (list) {
-      this.addForm.repairsImg = list.map(item => item.accessUrl).join(',')
-      console.log('上传的图片:', this.addForm.repairsImg)
+    created () {
+      // this.getrecipientDep()
     },
+    methods: {
+      handleClose () {
+        // this.$refs.selectUploadRef.clearUploadFiles()
+        this.initData = [];
+        this.addRepairNotesDialog = false;
+        this.recipientDep = '';
+        this.addForm = {
+          // repairsCode: getRuleNo('BX'), // 报修记录编号
+          equiTypeId: '', // 设备分类ID
+          equiTypeName: '', // 	设备分类名称
+          equiCode: '', // 设备编码
+          equiName: '', // 设备名称
+          fixedAssetCode: '', // 固定资产编码
+          equiModel: '', // 规格型号
+          ownerDeptCode: '', // 权属部门code
+          ownerDeptName: '', // 权属部门名称
+          expectedTime: '', // 期望完成时间
+          repairsDescription: '', // 故障描述
+          repairsImg: '' // 图片
+          // repairsVideo: '' // 视频
+        };
+        this.deviceData = {
+          ownerName: '', // 权属人
+          ownerPhone: '', // 权属人电话
+          equiLocation: '' // 设备位置
+        };
+      },
+      // 打开选择设备弹窗
+      selectEquipment () {
+        this.$refs.equipmentDialogRef.open();
+      },
+      // 上传图片
+      getImgs (list) {
+        this.addForm.repairsImg = list.map((item) => item.accessUrl).join(',');
+        console.log('上传的图片:', this.addForm.repairsImg);
+      },
 
-    // 获取接收人列表
-    getUserList (deptCode) {
-      let par = {
-        deptCode,
-        page: 1,
-        size: 999999
-      }
-      geUserlist(par).then(res => {
-        this.recipientList = res.data.items
-      })
-    },
+      // 获取接收人列表
+      getUserList (deptCode) {
+        let par = {
+          deptCode,
+          page: 1,
+          size: 999999
+        };
+        geUserlist(par).then((res) => {
+          this.recipientList = res.data.items;
+        });
+      },
 
-    // 选择的设备
-    selectedEquipment (row) {
-      // console.log('选择的设备信息',row)
-      getNewinfo({ code: row.code }).then(res => {
-        if (res.success) {
-          console.log('选择的设备信息res', res.data)
-          let info = res.data.information
-          this.addForm.equiTypeId = res.data.assetType // 设备分类id
-          this.addForm.equiId = res.data.id // 设备id
-          this.addForm.equiName = res.data.assetName // 设备名称
-          this.addForm.equiCode = res.data.assetCode // 设备编码
-          this.addForm.fixedAssetCode = res.data.fixAssetCode // 固定资产编码
-          this.addForm.ownerDeptName = res.data.ownershipDeptName // 权属部门名称
-          this.deviceData.ownerPhone = res.data.ownershipUserMobile // 权属人电话
-          this.deviceData.ownerName = res.data.ownershipUserName // 权属人
+      // 选择的设备
+      selectedEquipment (row) {
+        // console.log('选择的设备信息',row)
+        getNewinfo({ code: row.code }).then((res) => {
+          if (res.success) {
+            console.log('选择的设备信息res', res.data);
+            let info = res.data.information;
+            this.addForm.equiTypeId = res.data.assetType; // 设备分类id
+            this.addForm.equiId = res.data.id; // 设备id
+            this.addForm.equiName = res.data.assetName; // 设备名称
+            this.addForm.equiCode = res.data.assetCode; // 设备编码
+            this.addForm.fixedAssetCode = res.data.fixAssetCode; // 固定资产编码
+            this.addForm.ownerDeptName = res.data.ownershipDeptName; // 权属部门名称
+            this.deviceData.ownerPhone = res.data.ownershipUserMobile; // 权属人电话
+            this.deviceData.ownerName = res.data.ownershipUserName; // 权属人
 
-          const model = info.modelType ? info.modelType : ''
-          const specification = info.specification
-            ? info.specification + '|'
-            : info.modelType
-            ? '|'
-            : ''
-          this.addForm.equiModel = specification + model // 规格型号
+            const model = info.modelType ? info.modelType : '';
+            const specification = info.specification
+              ? info.specification + '|'
+              : info.modelType
+              ? '|'
+              : '';
+            this.addForm.equiModel = specification + model; // 规格型号
 
-          const factoryName = res.data.factoryName
-            ? res.data.factoryName + '-'
-            : ''
-          const workshopName = res.data.workshopName
-            ? res.data.workshopName + '-'
-            : ''
-          const lineName = res.data.lineName ? res.data.lineName + '-' : ''
-          const detailLocation = res.data.detailLocation
-            ? res.data.detailLocation
-            : ''
-          this.deviceData.equiLocation =
-            factoryName + workshopName + lineName + detailLocation // 设备位置
-        }
-      })
-      // this.addForm['equiTypeName'] = row.equiTypeName // 设备分类名称
-      // this.deviceData.equiLocation =  row.positionFarm // 设备位置
-    },
-    // 提交新增
-    submitAdd () {
-      if (!this.addForm.equiCode) {
-        return this.$message.warning('请选择报修设备!')
-      }
-      let msg = '新增成功!'
-      // 编辑
-      if (this.addForm.id) {
-        delete this.addForm.repairInfoLogs
-        msg = '修改成功!'
-      }
-      if (this.addForm.recipient) {
-        this.addForm['receiveUserList'] = this.addForm.recipient.map(item => {
-          return {
-            receiveUserId: item.split(',')[0],
-            receiveUserName: item.split(',')[1],
-            deptName: this.deptName
+            const factoryName = res.data.factoryName
+              ? res.data.factoryName + '-'
+              : '';
+            const workshopName = res.data.workshopName
+              ? res.data.workshopName + '-'
+              : '';
+            const lineName = res.data.lineName ? res.data.lineName + '-' : '';
+            const detailLocation = res.data.detailLocation
+              ? res.data.detailLocation
+              : '';
+            this.deviceData.equiLocation =
+              factoryName + workshopName + lineName + detailLocation; // 设备位置
           }
-        })
-      }
-      let form = JSON.parse(JSON.stringify(this.addForm))
+        });
+        // this.addForm['equiTypeName'] = row.equiTypeName // 设备分类名称
+        // this.deviceData.equiLocation =  row.positionFarm // 设备位置
+      },
+      // 提交新增
+      submitAdd () {
+        if (!this.addForm.equiCode) {
+          return this.$message.warning('请选择报修设备!');
+        }
+        let msg = '新增成功!';
+        // 编辑
+        if (this.addForm.id) {
+          delete this.addForm.repairInfoLogs;
+          msg = '修改成功!';
+        }
+        if (this.addForm.recipient) {
+          this.addForm['receiveUserList'] = this.addForm.recipient.map(
+            (item) => {
+              return {
+                receiveUserId: item.split(',')[0],
+                receiveUserName: item.split(',')[1],
+                deptName: this.deptName
+              };
+            }
+          );
+        }
+        let form = JSON.parse(JSON.stringify(this.addForm));
 
-      if (this.infoData.id) {
-        form.id = this.infoData.id
-      }
-      delete form.recipient
-      delete form.receiveUser
-      delete form.source
-      delete form.sourceCode
-      form.ownerPhone = this.deviceData.ownerPhone
-      form.ownerPhone = this.deviceData.ownerName
-      form.equiLocation = this.deviceData.equiLocation
-      repair
-        .saveOrEditInfo(form)
-        .then(res => {
-          this.handleClose()
-          this.$message.success(msg)
-          this.$emit('refresh')
-        })
-        .catch(() => {})
-    },
-    // 获取接收人部门
-    getrecipientDep () {
-      geDeptTree().then(res => {
-        console.log('asdasd', res)
-        this.recipientDepList = res.data
-      })
-    },
-    nodeClick (info) {
-      //部门
-      this.recipientDep = info.code
-      this.deptName = info.name
-      this.getUserList(this.recipientDep)
-    },
-    // 如果没先选接受部门,则提示
-    focusRecipient () {
-      if (!this.recipientDep) {
-        this.$message.warning('请选择接收人部门')
+        if (this.infoData.id) {
+          form.id = this.infoData.id;
+        }
+        delete form.recipient;
+        delete form.receiveUser;
+        delete form.source;
+        delete form.sourceCode;
+        form.ownerPhone = this.deviceData.ownerPhone;
+        form.ownerPhone = this.deviceData.ownerName;
+        form.equiLocation = this.deviceData.equiLocation;
+        repair
+          .saveOrEditInfo(form)
+          .then((res) => {
+            this.handleClose();
+            this.$message.success(msg);
+            this.$emit('refresh');
+          })
+          .catch(() => {});
+      },
+      // 获取接收人部门
+      getrecipientDep () {
+        geDeptTree().then((res) => {
+          console.log('asdasd', res);
+          this.recipientDepList = res.data;
+        });
+      },
+      nodeClick (info) {
+        //部门
+        this.recipientDep = info.code;
+        this.deptName = info.name;
+        this.getUserList(this.recipientDep);
+      },
+      // 如果没先选接受部门,则提示
+      focusRecipient () {
+        if (!this.recipientDep) {
+          this.$message.warning('请选择接收人部门');
+        }
       }
     }
-  }
-}
+  };
 </script>
 
 <style lang="scss" scoped>
-.dialog_top {
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
-  margin-bottom: 10px;
-}
-.btns {
-  text-align: right;
-  margin: 10px 0;
-}
+  .dialog_top {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    margin-bottom: 10px;
+  }
+  .btns {
+    text-align: right;
+    margin: 10px 0;
+  }
 </style>

+ 57 - 47
src/views/maintenance/repair/repairNotes/components/notes-search.vue

@@ -11,22 +11,15 @@
         <el-form-item label="来源编码:">
           <el-input clearable v-model="where.code" placeholder="请输入" />
         </el-form-item>
-		<el-form-item label="报修时间:">
-			<el-date-picker
-				v-model="where.time"
-				type="daterange"
-				range-separator="至"
-				start-placeholder="开始日期"
-				end-placeholder="结束日期"
-				value-format="yyyy-MM-dd HH:mm:ss"
-				:default-time="['00:00:00', '23:59:59']"
-				>
-			</el-date-picker>
-		</el-form-item>
       </el-col>
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
-        <el-form-item label="来源类型:">
-          <DictSelection dictName="报修记录来源类型" clearable  v-model="where.type" > </DictSelection>
+        <el-form-item label="来源:">
+          <DictSelection dictName="报修来源" v-model="where.code" />
+        </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.code" placeholder="请输入" />
         </el-form-item>
       </el-col>
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
@@ -35,25 +28,43 @@
         </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.texture" placeholder="请输入" />
-		 </el-form-item>
-		<div class="ele-form-actions">
-			<el-button
-				type="primary"
-				icon="el-icon-search"
-				class="ele-btn-icon"
-				@click="search"
-				size="small"
-			>
-				查询
-			</el-button>
-			 <el-button @click="reset"
-				 icon="el-icon-refresh-left"
-				 size="small"
-				 type="primary"
-			 >重置</el-button>
-		</div>
+        <el-form-item label="状态:">
+          <DictSelection dictName="报修状态" v-model="where.code" />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="报修时间:">
+          <el-date-picker
+            v-model="where.time"
+            type="daterange"
+            range-separator="至"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            value-format="yyyy-MM-dd HH:mm:ss"
+            :default-time="['00:00:00', '23:59:59']"
+          >
+          </el-date-picker>
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 12, md: 24 } : { span: 12 }">
+        <div class="ele-form-actions">
+          <el-button
+            type="primary"
+            icon="el-icon-search"
+            class="ele-btn-icon"
+            @click="search"
+            size="small"
+          >
+            查询
+          </el-button>
+          <el-button
+            @click="reset"
+            icon="el-icon-refresh-left"
+            size="small"
+            type="primary"
+            >重置</el-button
+          >
+        </div>
       </el-col>
     </el-row>
   </el-form>
@@ -68,31 +79,30 @@
       const defaultWhere = {
         name: '',
         code: '',
-        fixCode:'',
-        ownershipGroupId:''
+        fixCode: '',
+        ownershipGroupId: ''
       };
       return {
         // 表单数据
         where: { ...defaultWhere },
-        treeData:[]
+        treeData: []
       };
     },
     computed: {
       // 是否开启响应式布局
-      styleResponsive() {
+      styleResponsive () {
         return this.$store.state.theme.styleResponsive;
       }
     },
-    created(){
-    },
+    created () {},
     methods: {
       /* 搜索 */
-      search() {
+      search () {
         console.log(this.where);
         this.$emit('search', this.where);
       },
       /*  重置 */
-      reset() {
+      reset () {
         this.where = { ...this.defaultWhere };
         this.search();
       }
@@ -100,9 +110,9 @@
   };
 </script>
 <style lang="scss" scoped>
-    .ele-form-actions{
-		display:flex;
-		align-items: center;
-		justify-content: flex-end;
-	}
-</style>
+  .ele-form-actions {
+    display: flex;
+    align-items: center;
+    justify-content: flex-end;
+  }
+</style>

+ 169 - 210
src/views/maintenance/repair/repairNotes/index.vue

@@ -1,36 +1,35 @@
 <template>
   <div class="ele-body">
-     <el-card shadow="never" v-loading="loading">
-	   <notes-search @search="reload">
-	   </notes-search>
-	   <!-- 数据表格 -->
-	   <ele-pro-table
-	     ref="table"
-	     :columns="columns"
-	     :datasource="datasource"
-	     cache-key="systemRoleTable"
-	   >
-	     <!-- 表头工具栏 -->
-	     <template v-slot:toolbar>
-	       <el-button
-	         size="small"
-	         type="primary"
-	         icon="el-icon-plus"
-	         class="ele-btn-icon"
-	         @click="openEdit()"
-	       >
-	         新建
-	       </el-button>
-		   <el-button
-		     size="small"
-		     type="primary"
-		     class="ele-btn-icon"
-		     @click="goDetail({id:12})"
-		   >
-		     详情
-		   </el-button>
-	     </template>
-<!-- 	     <template v-slot:enable="{ row }">
+    <el-card shadow="never" v-loading="loading">
+      <notes-search @search="reload"> </notes-search>
+      <!-- 数据表格 -->
+      <ele-pro-table
+        ref="table"
+        :columns="columns"
+        :datasource="datasource"
+        cache-key="systemRoleTable"
+      >
+        <!-- 表头工具栏 -->
+        <template v-slot:toolbar>
+          <el-button
+            size="small"
+            type="primary"
+            icon="el-icon-plus"
+            class="ele-btn-icon"
+            @click="openEdit()"
+          >
+            新建
+          </el-button>
+          <el-button
+            size="small"
+            type="primary"
+            class="ele-btn-icon"
+            @click="goDetail({ id: 12 })"
+          >
+            详情
+          </el-button>
+        </template>
+        <!-- 	     <template v-slot:enable="{ row }">
 	       <el-switch
 	         v-model="row.enable"
 	         active-color="#13ce66"
@@ -41,40 +40,21 @@
 	       >
 	       </el-switch>
 	     </template> -->
-	     <!-- 操作列 -->
-	     <template v-slot:action="{ row }">
-			 <el-link
-			   type="primary"
-			   :underline="false"
-			   icon="el-icon-truck"
-			   @click="appoint(row)"
-			 >
-			   委外
-			 </el-link>
-	       <el-link
-	         type="primary"
-	         :underline="false"
-	         icon="el-icon-edit"
-	         @click="openEdit(row)"
-	       >
-	         编辑
-	       </el-link>
-		   <el-popconfirm
-		     class="ele-action"
-		     title="确认撤销这条报修记录吗?"
-		     @confirm="cancel(row)"
-		   >
-		     <template v-slot:reference>
-		       <el-link type="danger" :underline="false" icon="el-icon-delete">
-		         撤销
-		       </el-link>
-		     </template>
-		   </el-popconfirm>
-	     </template>
-	   </ele-pro-table>
-     </el-card>
-	 
-	 <!-- 新建或编辑弹窗 -->
+        <!-- 操作列 -->
+        <template v-slot:action="{ row }">
+          <el-link
+            type="primary"
+            :underline="false"
+            icon="el-icon-edit"
+            @click="openEdit(row)"
+          >
+            撤回
+          </el-link>
+        </template>
+      </ele-pro-table>
+    </el-card>
+
+    <!-- 新建或编辑弹窗 -->
     <AddDialog
       ref="addDialogRef"
       :dialogTitle="addDialogTitle"
@@ -82,142 +62,134 @@
       :infoData="infoData"
       @refresh="reload"
     />
-	
-	<DetailsDialog
-	  ref="detailsDialogRef"
-	  :dialogTitle="detailsDialogTitle"
-	  :infoData="infoData"
-	  :repairInfoLogs="repairInfoLogs"
-	/>
-	<!-- 委外弹窗 -->
-	<EntrustDialog ref="entDialogRef" @refresh="reload" />
+
+    <DetailsDialog
+      ref="detailsDialogRef"
+      :dialogTitle="detailsDialogTitle"
+      :infoData="infoData"
+      :repairInfoLogs="repairInfoLogs"
+    />
   </div>
 </template>
 
 <script>
+  import { getPage } from '@/api/maintenance/repair';
   // import AddPatrolPlanDialog from '@/components/addPatrolPlanDialog'
   import NotesSearch from './components/notes-search.vue';
   import AddDialog from './components/addDialog.vue';
-  import { pageRoles } from '@/api/system/role';
-  import DetailsDialog from '../components/RepairDetailsDialog.vue'
-  import EntrustDialog from "./components/entrustDialog.vue";
+  import DetailsDialog from '../components/RepairDetailsDialog.vue';
   export default {
     components: {
       NotesSearch,
-	  AddDialog,
-	  DetailsDialog,
-	  EntrustDialog
-	    // AddPatrolPlanDialog
+      AddDialog,
+      DetailsDialog
+      // AddPatrolPlanDialog
     },
     data () {
       return {
-		// 表格列配置
-		columns: [
-		  {
-		    columnKey: 'index',
-		    label: '序号',
-		    type: 'index',
-		    width: 55,
-		    align: 'center',
-		    showOverflowTooltip: true,
-		    fixed: 'left'
-		  },
-		  {
-		    prop: 'code',
-		    label: '计划单号',
-		    align: 'center',	
-		    showOverflowTooltip: true,
-		    minWidth: 110
-		  },
-		  {
-		    prop: 'groupId',
-		    label: '计划名称',
-		    align: 'center',
-		    showOverflowTooltip: true,
-		    minWidth: 110
-		  },
-		  {
-		    prop: 'enable',
-		    label: '计划规则',
-		    align: 'center',	
-		    showOverflowTooltip: true,
-		    slot: 'enable',
-		    minWidth: 110
-		  },
-		  {
-		    prop: 'name',
-		    label: '设备分类',
-		    align: 'center',	
-		    showOverflowTooltip: true,
-		    minWidth: 110
-		  },
-		  {
-		    prop: 'cycle',
-		    label: '设备性质',
-		    align: 'center',	
-		    showOverflowTooltip: true,
-		    minWidth: 110
-		  },
-			{
-			  prop: 'auto',
-			  label: '状态',
-			  align: 'center',	
-			  showOverflowTooltip: true,
-			  minWidth: 110
-			},
-			{
-			  prop: 'status',
-			  label: '审批人',
-			  align: 'center',	
-			  showOverflowTooltip: true,
-			  minWidth: 110
-			},
-		  {
-		    prop: 'creater',
-		    label: '创建人',
-		    align: 'center',	
-		    showOverflowTooltip: true,
-		    minWidth: 110
-		  },
-		  {
-		    prop: 'createTime',
-		    label: '生成时间',
-		    align: 'center',
-		    showOverflowTooltip: true,
-		    minWidth: 110,
-		    formatter: (_row, _column, cellValue) => {
-		      return this.$util.toDateString(cellValue);
-		    }
-		  },
-		  {
-		    columnKey: 'action',
-		    label: '操作',
-		    width: 200,
-		    align: 'center',
-		    resizable: false,
-		    slot: 'action',
-		    showOverflowTooltip: true
-		  }
-		],
+        // 表格列配置
+        columns: [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'code',
+            label: '报修记录编码',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'deviceId',
+            label: '设备编码',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'enable',
+            label: '设备名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'sourceType',
+            label: '报修类型',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'sourceType',
+            label: '来源',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'sourceCode',
+            label: '来源编码',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'status',
+            label: '状态',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'requestUserId',
+            label: '报修人',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'createTime',
+            label: '报修时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (_row, _column, cellValue) => {
+              return this.$util.toDateString(cellValue);
+            }
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 230,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            showOverflowTooltip: true
+          }
+        ],
         // 加载状态
         loading: false,
         infoData: {},
         repairInfoLogs: [],
         addDialogTitle: '新增报修记录',
         detailsDialogTitle: '报修记录详情',
-        deviceInfo: {}, //设备信息
-		
+        deviceInfo: {} //设备信息
       };
     },
-    computed: {
-
-    },
+    computed: {},
     methods: {
       /* 表格数据源 */
-      datasource({ page, limit, where, order }) {
-        return pageRoles({ pageNum: page, size: limit, ...where });
+      datasource ({ page, limit, where, order }) {
+        return getPage({ pageNum: page, size: limit, ...where });
       },
-      async changeEnable(row) {
+      async changeEnable (row) {
         const res = await putRoles(row);
         if (res.code == 0) {
           this.$message({
@@ -229,42 +201,29 @@
         }
       },
       /* 刷新表格 */
-      reload(where) {
+      reload (where) {
         this.$refs.table.reload({ page: 1, where });
       },
-	  
-	  openEdit(row){
-		  this.addDialogTitle = '新增报修记录'
-		  this.$refs.addDialogRef.addRepairNotesDialog = true
-	  },
-	  
-	  goDetail(row){
-		  row.tabLabel = '维修信息'
-		  row.title = '报修记录详情'
-		  row.workOrderCode = row.id
-		  this.$refs.detailsDialogRef.init(row)
-		  // this.$router.push({
-		  //   path: '/maintenance/patrol/plan/details',
-		  //   // query: {
-		  //   //   id
-		  //   // }
-		  // })
-	  },
-	  
-	  // 委外
-	  appoint(row) {
-	     this.$refs.entDialogRef.init(row);
-	  },
-	  
-	  // 撤销
-	  cancel(row){
-		  
-	  }
-	  
+
+      openEdit (row) {
+        this.addDialogTitle = '新增报修记录';
+        this.$refs.addDialogRef.addRepairNotesDialog = true;
+      },
+
+      goDetail (row) {
+        row.tabLabel = '维修信息';
+        row.title = '报修记录详情';
+        row.workOrderCode = row.id;
+        this.$refs.detailsDialogRef.init(row);
+        // this.$router.push({
+        //   path: '/maintenance/patrol/plan/details',
+        //   // query: {
+        //   //   id
+        //   // }
+        // })
+      }
     }
   };
 </script>
 
-<style lang="scss" scoped>
-
-</style>
+<style lang="scss" scoped></style>