From f466ae4fdc645c66c9f25e2e4598b9809e2b41af Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期六, 13 一月 2024 22:56:49 +0800
Subject: [PATCH] Merge branch 'master' of http://www.beijingsoft.cn:9090/r/mdc-front

---
 src/container/maintenance/dailyMAdd.vue |  176 ++++++++++++++++++++++++----------------------------------
 1 files changed, 72 insertions(+), 104 deletions(-)

diff --git a/src/container/maintenance/dailyMAdd.vue b/src/container/maintenance/dailyMAdd.vue
index f5d5a95..13ae2c0 100644
--- a/src/container/maintenance/dailyMAdd.vue
+++ b/src/container/maintenance/dailyMAdd.vue
@@ -7,13 +7,13 @@
         :visible.sync="dialogVisibleAdd" class="role-select">
          <!-- 鏌ヨ琛ㄥ崟 -->
         <el-form :model="dataForm" ref="dataForm" label-width="150px" style="margin-top:10px;">
-            <el-row>
-                <el-col :xs="24":sm="12":md="12":lg="12":xl="12">
+            <el-row :gutter="20">
+                <el-col :xs="24":sm="6":md="6":lg="6":xl="6">
                     <el-form-item label="缁熶竴缂栧彿" prop="uuid">
                         <el-input type="text" v-model="dataForm.uuid" autocomplete="off"></el-input>
                     </el-form-item>
                 </el-col>
-                <el-col :xs="24":sm="12":md="12":lg="12":xl="12">
+                <el-col :xs="24":sm="6":md="6":lg="6":xl="6">
                     <el-form-item label="璁惧鍚嶇О" prop="machineName">
                         <el-select v-model="dataForm.machineName" placeholder="---璇烽�夋嫨---">
                             <el-option
@@ -25,26 +25,26 @@
                         </el-select>
                     </el-form-item>
                 </el-col>
-                <el-col :xs="24":sm="12":md="12":lg="12":xl="12">
+                <el-col :xs="24":sm="6":md="6":lg="6":xl="6">
                     <el-form-item label="璁惧鍨嬪彿" prop="type">
                         <el-input size="mini" type="text" v-model="dataForm.type"></el-input>
                     </el-form-item>
                 </el-col>
-                <el-col :xs="24":sm="12":md="12":lg="12":xl="12">
+                <el-col :xs="24":sm="6":md="6":lg="6":xl="6">
                     <el-form-item label="璁惧瑙勬牸" prop="specification">
                         <el-input size="mini" type="text" v-model="dataForm.specification" @input="getMachineInfo"></el-input>
                     </el-form-item>
                 </el-col>
-                <el-col :xs="24":sm="12":md="12":lg="12":xl="12">
+                <el-col :xs="24":sm="6":md="6":lg="6":xl="6">
                     <el-form-item label="瀹夎鍦扮偣" prop="location">
                         <el-input size="mini" type="text" v-model="dataForm.location"></el-input>
                     </el-form-item>
                 </el-col>
-                <el-col :xs="24":sm="12":md="12":lg="12":xl="12">
+                <el-col :xs="24":sm="6":md="6":lg="6":xl="6">
                     <el-form-item label="浣跨敤閮ㄩ棬" prop="department">
                         <el-select v-model="dataForm.department" placeholder="---璇烽�夋嫨---" clearable >
                             <el-option
-                            v-for="item in department"
+                            v-for="item in departmentlist"
                             :key="item.value"
                             :label="item.label"
                             :value="item.value">
@@ -52,7 +52,7 @@
                         </el-select>
                     </el-form-item>
                 </el-col>
-                <el-col :xs="24":sm="12":md="12":lg="12":xl="12">
+                <el-col :xs="24":sm="6":md="6":lg="6":xl="6">
                     <el-form-item label="淇濆吇鑰�" prop="maintainPerson">
                         <el-select v-model="dataForm.maintainPerson" placeholder="---璇烽�夋嫨---" clearable >
                             <el-option
@@ -64,27 +64,27 @@
                         </el-select>
                     </el-form-item>
                 </el-col>
-                <!-- <el-col :xs="24":sm="12":md="12":lg="12":xl="12">
+                <!-- <el-col :xs="24":sm="6":md="6":lg="6":xl="6">
                     <el-form-item label="淇濆吇鍛ㄦ湡" prop="maintainPeriod">
                         <el-input size="mini" type="text" v-model="dataForm.maintainPeriod"></el-input>
                     </el-form-item>
                 </el-col>
-                <el-col :xs="24":sm="12":md="12":lg="12":xl="12">
+                <el-col :xs="24":sm="6":md="6":lg="6":xl="6">
                     <el-form-item label="鎶曚骇鏃ユ湡" prop="productionDate">
                         <el-input size="mini" type="text" v-model="dataForm.productionDate"></el-input>
                     </el-form-item>
                 </el-col>
-                <el-col :xs="24":sm="12":md="12":lg="12":xl="12">
+                <el-col :xs="24":sm="6":md="6":lg="6":xl="6">
                     <el-form-item label="鐢熶骇鍘傚" prop="manufacturer">
                         <el-input size="mini" type="text" v-model="dataForm.manufacturer"></el-input>
                     </el-form-item>
                 </el-col> -->
-                <el-col :xs="24":sm="12":md="12":lg="12":xl="12">
+                <el-col :xs="24":sm="6":md="6":lg="6":xl="6">
                     <el-form-item label="璁″垝鐘舵��" prop="planStatus">
                         <el-input size="mini" type="text" v-model="dataForm.planStatus" readonly></el-input>
                     </el-form-item>
                 </el-col>
-                <el-col :xs="24":sm="12":md="12":lg="12":xl="12">
+                <el-col :xs="24":sm="6":md="6":lg="6":xl="6">
                     <el-form-item label="鏄惁鍚堟牸" prop="isQualified">
                         <el-select v-model="dataForm.isQualified" placeholder="---璇烽�夋嫨---" clearable >
                             <el-option
@@ -96,33 +96,31 @@
                         </el-select>
                     </el-form-item>
                 </el-col>
-                <el-col :xs="24":sm="12":md="12":lg="12":xl="12">
+                <el-col :xs="24":sm="6":md="6":lg="6":xl="6">
                     <el-form-item label="璁″垝寮�濮嬫棩鏈�" prop="planStartDate">
                         <el-date-picker
                         format="yyyy 骞� MM 鏈� dd 鏃�"
                         value-format="yyyy-MM-dd"
                         v-model="dataForm.planStartDate"
-                        type="daterange"
                         range-separator="鑷�"
                         start-placeholder="寮�濮嬫棩鏈�"
                         end-placeholder="缁撴潫鏃ユ湡">
                         </el-date-picker>
                     </el-form-item>
                 </el-col>
-                <el-col :xs="24":sm="12":md="12":lg="12":xl="12">
+                <el-col :xs="24":sm="6":md="6":lg="6":xl="6">
                     <el-form-item label="璁″垝瀹屾垚鏃ユ湡" prop="planFinishDate">
                         <el-date-picker
                         format="yyyy 骞� MM 鏈� dd 鏃�"
                         value-format="yyyy-MM-dd"
                         v-model="dataForm.planFinishDate"
-                        type="daterange"
                         range-separator="鑷�"
                         start-placeholder="寮�濮嬫棩鏈�"
                         end-placeholder="缁撴潫鏃ユ湡">
                         </el-date-picker>
                     </el-form-item>
                 </el-col>
-                <el-col :xs="24":sm="12":md="12":lg="12":xl="12">
+                <el-col :xs="24":sm="6":md="6":lg="6":xl="6">
                     <el-form-item label="淇濆吇鍐呭涓庡瓨鍦ㄩ棶棰�" prop="detail">
                         <el-input size="mini" type="text" v-model="dataForm.detail"></el-input>
                     </el-form-item>
@@ -140,8 +138,9 @@
 <script>
 // import { getMachineList, maintainCreate, maintainUpdate, deviceManage, userList, departmentGet } from '@/api/MdcApi'
 import { getMachineList, maintainCreate, maintainUpdate, userList, departmentGet } from '@/api/MdcApi'
+import { getRequest } from '@/api/Api'
 export default {
-  props: ['styles'],
+  props: ['styles', 'departmentlist'],
   data() {
     return {
       dataForm: {
@@ -224,7 +223,7 @@
       this.dialogVisibleAdd = true
       this.machineName = []
       this.maintainPerson = []
-      this.initDevices() // 鍒濆鍖栨暟鎹�
+      // this.initDevices() // 鍒濆鍖栨暟鎹�
     },
     // 淇濆瓨
     savedata() {
@@ -236,93 +235,53 @@
       const completeDateTo = this.dataForm.planFinishDate[1]
       const isQualified = this.dataForm.isQualified === '鍚堟牸' ? 1 : 0
       if (this.no === 1) {
-        maintainCreate(
-          this.styles, this.dataForm.uuid, this.dataForm.machineName, this.dataForm.type,
-          this.dataForm.specification, this.dataForm.department, this.dataForm.location,
-          startDateFrom, startDateTo, completeDateFrom, completeDateTo, isQualified,
-          this.dataForm.state, this.dataForm.detail
-        ).then(res => {
-          if (res.result === 'SUCCESS') {
-            this.$message({
-              type: 'success',
-              message: '淇濆瓨鎴愬姛!'
-            })
-            this.$emit('reflash')
-            // const that = this
-            this.dialogVisibleAdd = false
-          } else {
-            this.$message({
-              type: 'error',
-              message: res.result
-            })
-          }
-        })
+        getRequest('maintainCreate',{})
+        // maintainCreate(
+        //   this.styles, this.dataForm.uuid, this.dataForm.machineName, this.dataForm.type,
+        //   this.dataForm.specification, this.dataForm.department, this.dataForm.location,
+        //   startDateFrom, startDateTo, completeDateFrom, completeDateTo, isQualified,
+        //   this.dataForm.state, this.dataForm.detail
+        // ).then(res => {
+        //   if (res.result === 'SUCCESS') {
+        //     this.$message({
+        //       type: 'success',
+        //       message: '淇濆瓨鎴愬姛!'
+        //     })
+        //     this.$emit('reflash')
+        //     // const that = this
+        //     this.dialogVisibleAdd = false
+        //   } else {
+        //     this.$message({
+        //       type: 'error',
+        //       message: res.result
+        //     })
+        //   }
+        // })
       } else {
+        getRequest('maintainUpdate',{})
         // 淇敼淇濆瓨
-        maintainUpdate(this.styles, this.data.id, this.dataForm.uuid, this.dataForm.machineName, this.dataForm.type,
-          this.dataForm.specification, this.dataForm.department, this.dataForm.location,
-          startDateFrom, startDateTo, completeDateFrom, completeDateTo, isQualified,
-          this.dataForm.state, this.dataForm.detail).then(res => {
-          if (res.result === 'SUCCESS') {
-            this.$message({
-              type: 'success',
-              message: '淇濆瓨鎴愬姛!'
-            })
-            this.$emit('reflash')
-          } else {
-            this.$message({
-              type: 'error',
-              message: res.result
-            })
-          }
-        })
+        // maintainUpdate(this.styles, this.data.id, this.dataForm.uuid, this.dataForm.machineName, this.dataForm.type,
+        //   this.dataForm.specification, this.dataForm.department, this.dataForm.location,
+        //   startDateFrom, startDateTo, completeDateFrom, completeDateTo, isQualified,
+        //   this.dataForm.state, this.dataForm.detail).then(res => {
+        //   if (res.result === 'SUCCESS') {
+        //     this.$message({
+        //       type: 'success',
+        //       message: '淇濆瓨鎴愬姛!'
+        //     })
+        //     this.$emit('reflash')
+        //   } else {
+        //     this.$message({
+        //       type: 'error',
+        //       message: res.result
+        //     })
+        //   }
+        // })
       }
     },
     /**
          * 鍒濆鍖栧凡鏈夋満搴�
          */
-    initDevices() {
-      this.machineName = []
-      this.maintainPerson = []
-      this.department = []
-      // 璁惧鍚嶇О
-      getMachineList().then(res => {
-        res.list.map(item => {
-          this.machineName.push({
-            label: item.name,
-            value: item.name,
-            id: item.id
-          })
-        })
-      })
-      // 浣跨敤鍗曚綅
-      userList().then(res => {
-        res.list.map(elem => {
-          this.maintainPerson.push({
-            label: elem.user,
-            value: elem.user,
-            id: elem.id
-          })
-          //    .split('_')[1]
-        })
-      })
-      // 鑾峰彇閮ㄩ棬
-      departmentGet().then(res => {
-        res.list.map(elem => {
-          this.department.push({
-            label: elem.name,
-            value: elem.name,
-            id: elem.id
-          })
-        })
-      })
-    },
-    // 璁惧鍚嶇О甯﹀嚭
-    getMachineInfo() {
-      // deviceManage(this.dataForm.machineName, this.dataForm.type, this.dataForm.specification).then(res => {
-      //
-      // })
-    },
     // 閲嶇疆
     resetForm() {
       this.$refs.dataForm.resetFields()
@@ -333,11 +292,20 @@
   }
 }
 </script>
-
+<style lang="scss">
+.el-form-item__content {
+    .el-select,.el-input {
+      width: 100%;
+    }
+  }
+  .el-dialog__body {
+    overflow: hidden;
+  }
+</style>
 <style scoped>
-    .el-table__body .cell{padding:3px;}
+    /* .el-table__body .cell{padding:3px;}
     .el-input__icon{line-height: 30px;}
     .el-input__inner{height:30px;line-height: 30px;}
     .el-form-item__content{line-height: 40px;}
-    .el-col{height:36px;}
+    .el-col{height:36px;} */
 </style>

--
Gitblit v1.9.3