Explorar el Código

运维管理新增弹窗

LAPTOP-16IUEB3P\Lenovo hace 3 años
padre
commit
784c963244

+ 256 - 0
src/views/maintenance/repair/components/redeployOther.vue

@@ -0,0 +1,256 @@
+<template>
+  <el-dialog :visible.sync="visible" title="转派工单" width="60%">
+    <div class="sparepart-apply">
+      <div class="select-box">
+          <el-form  label-width="80px">
+              <el-row :gutter="40">
+                <el-col :span="10">
+                    <el-form-item label="工单单号">
+                        <el-input
+                          v-model="row.workOrderCode"
+                          size="small"
+                          disabled
+                        ></el-input>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="10">
+                    <el-form-item label="部门">
+						<deptSelect
+						  v-model="deptCode"
+						  @changeGroup="deptClick"
+						/>
+                      <!-- <selectTree
+                        ref="treeDept"
+                        class="form-input"
+                        :options="treeList"
+                        size="small"
+                        :props="{
+                          value: 'code',
+                          label: 'name',
+                          children: 'children',
+                        }"
+                        @getValue="deptClick"
+                      /> -->
+                    </el-form-item>
+                </el-col>
+                <el-col :span="10">
+                    <el-form-item label=""  label-width="10px">
+                      <el-input
+                        v-model="name"
+                        size="small"
+                        placeholder="搜索姓名"
+                      ></el-input>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="6">
+                  <el-form-item label=""  label-width="10px">
+                    <el-button
+                      @click="search"
+                      type="primary"
+                      icon="el-icon-search"
+                      size="small"
+                      >搜索</el-button>
+                    <el-button
+                      @click="reset"
+                      icon="el-icon-refresh-left"
+                      size="small"
+                      >重置</el-button>
+                  </el-form-item>
+                </el-col>
+              </el-row>
+          </el-form>
+      </div>
+
+      <div class="data-tab">
+        <el-table
+          :data="tableData"
+          tooltip-effect="dark"
+          style="width: 100%"
+          stripe
+          highlight-current-row
+          @current-change="handleChange"
+          :header-cell-style="{ background: '#EEEEEE', border: 'none' }"
+        >
+          <el-table-column width="80px" label="序号" type="index"  :index="indexMethod">
+          </el-table-column>
+          <el-table-column label="工号" prop="jobNumber" width="200px">
+          </el-table-column>
+          <el-table-column label="姓名" prop="name"></el-table-column>
+          <el-table-column label="电话" prop="phone"></el-table-column>
+          <el-table-column label="部门" prop="groupName" ></el-table-column>
+        </el-table>
+        <div class="zw-table-pagebar">
+          <el-pagination
+            background
+            layout="total, sizes, prev, pager, next, jumper"
+            :total="total"
+            :page-sizes="[15, 30, 50, 100, 500]"
+            :page-size.sync="pages.size"
+            :current-page.sync="pages.pageNum"
+            @current-change="handleCurrentChange"
+            @size-change="handleSizeChange"
+          >
+          </el-pagination>
+        </div>
+      </div>
+      <div slot="footer" class="footer">
+        <el-button @click="cancel">返回</el-button>
+        <el-button type="primary" @click="submit">提交</el-button>
+      </div>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+  import deptSelect from '@/components/CommomSelect/dept-select.vue';
+  import { getUserPage } from '@/api/system/organization';
+export default {
+  components: { deptSelect },
+  props: {
+    // sourceType: {
+    //   type: Number, //1,保养工单;2,维修工单
+    //   required: true
+    // }
+  },
+  data () {
+    return {
+      visible: false,
+      treeList:[],
+      pages: {
+        pageNum: 1,
+        size: 15
+      },
+      total: 0,
+      selectedRow: {},
+      deptCode:'',
+      executorDeptName:'',
+      name:'',
+      row: {},
+      tableData:[],
+
+    }
+  },
+  async created() {
+      this.getUserList()
+  },
+  methods: {
+    open (row) {
+      this.row = row
+      this.name = ''
+      this.deptCode = ''
+      this.executorDeptName = ''
+      this.selectedRow = {}
+      this.visible = true
+    },
+
+    //重置
+    reset() {
+      this.name = ''
+      this.search();
+    },
+    // 搜索
+    search() {
+       this.getUserList({name:this.name})
+    },
+
+    deptClick(data) {
+      if (data){
+		  const params = { groupId: data };
+		  this.getUserList(params);
+      }
+    },
+
+    // 获取审核人列表、巡点检人员
+    async getUserList (params) {
+        let data =  { ...this.pages , deptCode : this.deptCode }
+        // 如果传了参数就是获取巡点检人员数据
+        if (params) {
+          data = Object.assign(data, params)
+        }
+		const res = await getUserPage(data);
+		this.tableData = res.list
+		this.total  = res.count
+    },
+
+
+    // 表格选中行
+    handleChange (row) {
+      if(row){
+        this.selectedRow = row
+      }
+    },
+
+
+    handleCurrentChange () {
+      this.getUserList()
+    },
+    handleSizeChange () {
+      this.pages.pageNum = 1
+      this.getUserList()
+    },
+
+    // 实现分页序号连贯
+    indexMethod (index) {
+      index = index + 1 + (this.pages.pageNum - 1) * this.pages.size
+      return index
+    },
+
+    async submit () {
+      if(this.selectedRow.id){
+        let params = {
+           executorDeptCode:this.deptCode,
+           executorId:this.selectedRow.userId,
+           workOrderId:this.row.id,
+           executorDeptName:this.executorDeptName,
+           executorName:this.selectedRow.trueName
+         }
+          const res = await workOrderSend(params)
+          if(res.success){
+             this.$message.success(`该工单成功转派给${this.selectedRow.trueName}`)
+             this.visible = false
+             this.$emit('refresh')
+          }
+      }else{
+         return this.$message.warning('请选择转派人员')
+      }
+    },
+    cancel () {
+      this.visible = false
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.sparepart-apply {
+  min-height: 40vh;
+  .select-box {
+    margin-bottom: 10px;
+  }
+
+  .material-item + .material-item {
+    margin-top: 10px;
+  }
+}
+
+.flex-between {
+  display: flex;
+  justify-content: space-between;
+  padding-right: 20%;
+}
+
+.list-box {
+  max-height: 60vh;
+  overflow-y: auto;
+  overflow-x: hidden;
+}
+
+.footer {
+  padding: 10px;
+  text-align: right;
+  background: #fff;
+  display:flex;
+  align-items:center;
+  justify-content: center;
+}
+</style>

+ 25 - 4
src/views/maintenance/repair/maintenancePlan/index.vue

@@ -47,10 +47,21 @@
 	         type="primary"
 	         :underline="false"
 	         icon="el-icon-edit"
-	         @click="openEdit(row)"
+	         @click="toEdit(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>
@@ -153,7 +164,7 @@
 		  {
 		    columnKey: 'action',
 		    label: '操作',
-		    width: 230,
+		    width: 150,
 		    align: 'center',
 		    resizable: false,
 		    slot: 'action',
@@ -195,14 +206,24 @@
       },
 	  
 	  jumpAdd(){
+		  this.$router.push({
+			path: '/maintenance/repair/maintenancePlan/add'
+		  })
+	  },
+	  toEdit({id}){
 		  this.$router.push({
 		    path: '/maintenance/repair/maintenancePlan/add',
+		  	query: {id}
 		  })
 	  },
 	  
 	  goDetail(row){
 		  this.$refs.detailDialogRef.openDeatailDialog(row)
-	  }
+	  },
+		// 撤销
+		cancel(row){
+				  
+		}
 	  
     }
   };

+ 168 - 0
src/views/maintenance/repair/repairNotes/components/entrustDialog.vue

@@ -0,0 +1,168 @@
+<template>
+  <el-dialog
+    title="委外派单"
+    :visible.sync="entrustVisible"
+    :before-close="handleClose"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    width="50%"
+  >
+    <div class="main_container">
+      <el-form :model="addForm" :rules="addFormRules" label-width="120px"  ref="addFormRef">
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="报修记录编号:" prop="repairsCode">
+              <el-input
+                v-model="addForm.repairsCode"
+                size="small"
+                disabled
+              ></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="设备编码:" prop="equiCode">
+              <el-input
+                v-model="addForm.equiCode"
+                size="small"
+                disabled
+              ></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="设备名称:" prop="equiName">
+              <el-input
+                v-model="addForm.equiName"
+                size="small"
+                disabled
+              ></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="委外单位:" prop="outsourcUnit">
+              <el-select
+                size="small"
+                style="width: 100%"
+                clearable
+                v-model="addForm.outsourcUnit"
+                placeholder="请选择"
+              >
+                <el-option
+                  v-for="item in deptList"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.name"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="计划完成时间:" prop="plannCompletionTime">
+              <el-date-picker
+                v-model="addForm.plannCompletionTime"
+                type="datetime"
+                style="width: 100%"
+                placeholder="选择日期时间"
+                size="small"
+                value-format="yyyy-MM-dd HH:mm:ss"
+              >
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+    </div>
+    <div class="btns">
+      <el-button type="primary" size="small" @click="submitAdd">提交</el-button>
+      <el-button size="small" @click="handleClose">关闭</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+
+// import { addOutsource, getAllSupplier } from '@/api/maintenance/repair/repair'
+export default {
+  props: {
+
+  },
+ watch: {
+
+  },
+  data () {
+    return {
+      addForm: {},
+      addFormRules: {
+        outsourcUnit:[{ required: true, message: '请选择委外单位', trigger: 'change' }],
+        plannCompletionTime:[{ required: true, message: '请选择计划完成时间', trigger: 'change' }]
+      },
+      entrustVisible:false,
+      deptList:[]
+    }
+  },
+  created () {
+
+  },
+  methods: {
+    init(row){
+       this.addForm = {}
+       this.addForm.repairsCode = row.repairsCode
+       this.addForm.equiCode = row.equiCode
+       this.addForm.equiName = row.equiName
+       this.addForm.equiId = row.equiId
+       this.addForm.status = 0
+       // this.getgys()
+       this.entrustVisible = true
+    },
+
+    // 获取供应商列表
+    async getgys () {
+      let res = await getAllSupplier()
+      this.deptList = res.data
+    },
+
+    handleClose () {
+      this.$refs.addFormRef.resetFields()
+      this.entrustVisible = false
+    },
+
+    submitAdd(){
+      this.$refs.addFormRef.validate(valid => {
+        if (valid) {
+          addOutsource(this.addForm).then(res=>{
+               if (res?.success) {
+                 this.handleClose()
+                 this.$message.success('委派成功!')
+                 this.$emit('refresh')
+               }
+           })
+
+        }
+      })
+
+    }
+
+
+
+
+
+  }
+}
+</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;
+}
+</style>

+ 36 - 4
src/views/maintenance/repair/repairNotes/index.vue

@@ -43,14 +43,33 @@
 	     </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>
@@ -64,13 +83,14 @@
       @refresh="reload"
     />
 	
-	
 	<DetailsDialog
 	  ref="detailsDialogRef"
 	  :dialogTitle="detailsDialogTitle"
 	  :infoData="infoData"
 	  :repairInfoLogs="repairInfoLogs"
 	/>
+	<!-- 委外弹窗 -->
+	<EntrustDialog ref="entDialogRef" @refresh="reload" />
   </div>
 </template>
 
@@ -80,11 +100,13 @@
   import AddDialog from './components/addDialog.vue';
   import { pageRoles } from '@/api/system/role';
   import DetailsDialog from '../components/RepairDetailsDialog.vue'
+  import EntrustDialog from "./components/entrustDialog.vue";
   export default {
     components: {
       NotesSearch,
 	  AddDialog,
-	  DetailsDialog
+	  DetailsDialog,
+	  EntrustDialog
 	    // AddPatrolPlanDialog
     },
     data () {
@@ -170,7 +192,7 @@
 		  {
 		    columnKey: 'action',
 		    label: '操作',
-		    width: 230,
+		    width: 200,
 		    align: 'center',
 		    resizable: false,
 		    slot: 'action',
@@ -227,6 +249,16 @@
 		  //   //   id
 		  //   // }
 		  // })
+	  },
+	  
+	  // 委外
+	  appoint(row) {
+	     this.$refs.entDialogRef.init(row);
+	  },
+	  
+	  // 撤销
+	  cancel(row){
+		  
 	  }
 	  
     }

+ 48 - 15
src/views/maintenance/repair/workOrder/index.vue

@@ -21,32 +21,51 @@
 		     详情
 		   </el-button>
 	     </template>
-<!-- 	     <template v-slot:enable="{ row }">
-	       <el-switch
-	         v-model="row.enable"
-	         active-color="#13ce66"
-	         inactive-color="#ff4949"
-	         :active-value="1"
-	         :inactive-value="0"
-	         @change="changeEnable(row)"
-	       >
-	       </el-switch>
-	     </template> -->
+		 <!-- 操作列 -->
+		 <template v-slot:action="{ row }">
+			 <el-link
+			   type="primary"
+			   :underline="false"
+			   icon="el-icon-truck"
+			 >
+			   申请备品备件
+			 </el-link>
+			   <el-link
+				 type="primary"
+				 :underline="false"
+				 icon="el-icon-edit"
+			   >
+				 报工
+			   </el-link>
+			 <el-link
+				 type="primary"
+				 :underline="false"
+				 icon="el-icon-edit"
+				  @click="toRedeploy(row)"
+			 >
+			 	转派
+			 </el-link>
+		 </template>
+
 	   </ele-pro-table>
      </el-card>
 	 
 	 <RepairDetailsDialog ref="detailsDialogRef" />
+	 <!-- 转派弹窗 -->
+	 <redeployOther ref="redeployOtherRef" @refresh="reload" />
   </div>
 </template>
 
 <script>
   import WorkorderSearch from './components/workorder-search.vue';
-  import RepairDetailsDialog from '../components/RepairDetailsDialog.vue'
+  import RepairDetailsDialog from '../components/RepairDetailsDialog.vue';
+  import redeployOther from '../components/redeployOther.vue';
   import { pageRoles } from '@/api/system/role'; 
   export default {
     components: {
       WorkorderSearch,
-	  RepairDetailsDialog
+	  RepairDetailsDialog,
+	  redeployOther
     },
     data () {
       return {
@@ -124,7 +143,16 @@
 		    align: 'center',
 		    showOverflowTooltip: true,
 		    minWidth: 110
-		  }
+		  },
+			{
+			  columnKey: 'action',
+			  label: '操作',
+			  width: 250,
+			  align: 'center',
+			  resizable: false,
+			  slot: 'action',
+			  showOverflowTooltip: true
+			}
 		],
         // 加载状态
         loading: false,
@@ -162,7 +190,12 @@
 		  row.title = '工单详情'
 		  row.tabLabel = '工单信息'
 		  this.$refs.detailsDialogRef.init(row)
-	  }
+	  },
+	  
+	  // 转派
+	  toRedeploy(row) {
+	    this.$refs.redeployOtherRef.open(row);
+	  },
 	  
     }
   };