Przeglądaj źródła

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend into dev

yusheng 11 miesięcy temu
rodzic
commit
398f453dba

+ 9 - 0
src/api/technology/work/index.js

@@ -41,5 +41,14 @@ export default {
     if (res.data.code == 0) {
       return res.data.message;
     }
+  },
+
+  centerCodeExists: async (code) => {
+    const res = await request.get(`/main/workcenter/codeExists/${code}`,);
+    if (res.data.code == 0) {
+      return res.data;
+    }
   }
+
+
 };

+ 1 - 1
src/views/enterpriseModel/regionalManage/components/area-edit.vue

@@ -12,7 +12,7 @@
     <el-form ref="form" :model="form" :rules="rules" label-width="140px">
       <el-row :gutter="15">
         <el-col v-bind="styleResponsive ? { sm: 12 } : { span: 12 }">
-          <el-form-item label="区域类型:" prop="areaLevel">
+          <el-form-item label="区域类型:" prop="areaType">
             <DictSelection dictName="区域类型" v-model="form.areaType" :disabled="dialogType=='view'"></DictSelection>
           </el-form-item>
         </el-col>

+ 0 - 1
src/views/factoryModel/plant/components/edit.vue

@@ -464,7 +464,6 @@
             })
             .catch((e) => {
               this.loading = false;
-              this.$message.error(e.message);
             });
         });
       },

+ 1 - 1
src/views/factoryModel/productionLine/index.vue

@@ -56,7 +56,7 @@
           </el-link>
           <el-popconfirm
             class="ele-action"
-            title="确定要删除此角色吗?"
+            title="确定要删除此产线吗?"
             @confirm="remove(row)"
             v-if="$hasPermission('main:factoryarea:delete')"
           >

+ 173 - 173
src/views/rulesManagement/matterRules/details.vue

@@ -20,8 +20,8 @@
             <el-col :span="6">
               <el-form-item label="规则类型">
                 <span>
-                  {{ getDictValue('规则类型',  infoData.ruleType) }}
-				  </span>
+                  {{ getDictValue('规则类型', infoData.ruleType) }}
+                </span>
               </el-form-item>
             </el-col>
             <el-col :span="6">
@@ -47,16 +47,16 @@
                 <rule-cycle :formData="infoData" />
               </el-form-item>
             </el-col>
-            <el-col :span="24">
-              <el-form-item label="操作方式/注意事项">
-                <el-link
-                  v-for="item in infoData.contentImage"
-                  @click="$fileSystemDownload(item)"
-                  :key="item.docId"
-                  >{{ item.name }}</el-link
-                >
-              </el-form-item>
-            </el-col>
+            <!--            <el-col :span="24">
+                          <el-form-item label="操作方式/注意事项">
+                            <el-link
+                              v-for="item in infoData.contentImage"
+                              @click="$fileSystemDownload(item)"
+                              :key="item.docId"
+                              >{{ item.name }}</el-link
+                            >
+                          </el-form-item>
+                        </el-col>-->
           </el-row>
         </div>
         <template v-if="!(infoData.ruleType && infoData.ruleType.code == 4)">
@@ -71,7 +71,7 @@
             border
             :header-cell-style="{ background: '#F0F3F3' }"
           >
-            <el-table-column type="index" label="序号" width="60"/>
+            <el-table-column type="index" label="序号" width="60" />
             <el-table-column prop="name" label="检测事项" />
             <el-table-column prop="content" label="检测内容" />
             <el-table-column prop="norm" label="检测标准" />
@@ -85,179 +85,179 @@
 </template>
 <script>
   import dictMixins from '@/mixins/dictMixins';
-  import RuleCycle from './components/rule-cycle'
-  import {  getDetail  } from '@/api/ruleManagement/matter'
-export default {
-  mixins: [dictMixins],
-  components: { RuleCycle },
-  data () {
-    return {
-      num: 1,
-      dialogVisible: false,
-      infoData: {},
-      form: {},
-      type: [],
-      tableData: [],
-      ruleTypeObj: {
-        1: '巡点检规则',
-        2: '保养规则',
-        4: '盘点规则'
-      }
-    }
-  },
-  async created () {
-    this.getInfo()
-	 this.requestDict('规则类型');
-  },
-  methods: {
-    delete () {},
-    // 点击切换事件
-    tab (index) {
-      this.num = index
+  import RuleCycle from './components/rule-cycle';
+  import { getDetail } from '@/api/ruleManagement/matter';
+  export default {
+    mixins: [dictMixins],
+    components: { RuleCycle },
+    data() {
+      return {
+        num: 1,
+        dialogVisible: false,
+        infoData: {},
+        form: {},
+        type: [],
+        tableData: [],
+        ruleTypeObj: {
+          1: '巡点检规则',
+          2: '保养规则',
+          4: '盘点规则'
+        }
+      };
     },
+    async created() {
+      this.getInfo();
+      this.requestDict('规则类型');
+    },
+    methods: {
+      delete() {},
+      // 点击切换事件
+      tab(index) {
+        this.num = index;
+      },
 
-    // 表格数据
-    async getInfo () {
-      const data = await getDetail(this.$route.query.id)
-        this.tableData = data.ruleItems
-        this.infoData = data
+      // 表格数据
+      async getInfo() {
+        const data = await getDetail(this.$route.query.id);
+        this.tableData = data.ruleItems;
+        this.infoData = data;
+      }
     }
-  }
-}
+  };
 </script>
 <style lang="scss" scoped>
-.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 {
+    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 #1890ff;
-  padding-bottom: 8px;
-  display: flex;
-  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;
+  .flows {
+    .flow-left {
+      width: 156px;
+      height: 70px;
+      border: 1px dashed #ccc;
+      padding: 10px;
     }
-    .content-value {
-      color: #000;
+    .row {
+      margin-top: 13px;
     }
   }
-}
-.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;
+  .basic-details-title {
+    margin-bottom: 12px;
+    margin-top: 20px;
+    border-bottom: 1px solid #1890ff;
+    padding-bottom: 8px;
+    display: flex;
+    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;
-      height: 50px;
-      width: 50px;
-      text-align: center;
-      line-height: 50px;
-      color: #fff;
-      margin: 2px;
+      display: inline-block;
+      .content-key {
+        color: #3e3e3e;
+        margin-right: 12px;
+        font-weight: 500;
+      }
+      .content-value {
+        color: #000;
+      }
     }
   }
-}
-.vacant {
-  background: #3196fb;
-}
-.inUse {
-  background: #157a2c;
-}
-.invalid {
-  background: #cccccc;
-}
-.full {
-  background: #cc3300;
-}
+  .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;
+      }
+    }
+  }
+  .vacant {
+    background: #3196fb;
+  }
+  .inUse {
+    background: #157a2c;
+  }
+  .invalid {
+    background: #cccccc;
+  }
+  .full {
+    background: #cc3300;
+  }
 </style>

+ 14 - 5
src/views/technology/work/components/user-edit.vue

@@ -89,11 +89,8 @@
 </template>
 
 <script>
-  // import { emailReg, phoneReg } from 'ele-admin';
   import work from '@/api/technology/work';
 
-  import { addUsers, putUsers } from '@/api/system/user';
-
   export default {
     props: {
       // 弹窗是否打开
@@ -132,7 +129,8 @@
             { required: true, message: '请输入工序名称', trigger: 'blur' }
           ],
           code: [
-            { required: true, message: '工作中心编码', trigger: 'change' }
+            { required: true, message: '工作中心编码', trigger: 'change' },
+            { validator: this.codeExists, trigger: 'blur' }
           ],
           factoryId: [
             { required: true, message: '请选择所属工厂', trigger: 'blur' }
@@ -157,6 +155,17 @@
       }
     },
     methods: {
+      codeExists(rule, value, callback) {
+        debugger;
+        work.centerCodeExists(this.form.code).then((result) => {
+          debugger;
+          if (result.data) {
+            callback(new Error('工作中心编码已存在!'));
+          } else {
+            callback();
+          }
+        });
+      },
       /* 保存编辑 */
       save() {
         this.$refs.form.validate((valid) => {
@@ -201,7 +210,7 @@
               this.isUpdate = true;
             } else {
               this.isUpdate = false;
-              this.form.code=''
+              this.form.code = '';
             }
           } else {
             this.isUpdate = false;