Explorar o código

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

695593266@qq.com hai 11 meses
pai
achega
f796394b01

+ 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>

+ 8 - 0
src/views/factoryModel/jobManagement/components/user-edit.vue

@@ -181,9 +181,17 @@
           {
             label: '元',
             value: '元'
+          },
+          {
+            label: '美元',
+            value: '美元'
           }
         ],
         timeOptions: [
+          {
+            label: '分钟',
+            value: '分钟'
+          },
           {
             label: '小时',
             value: '小时'

+ 35 - 14
src/views/factoryModel/jobManagement/index.vue

@@ -23,7 +23,6 @@
             class="ele-btn-icon"
             @click="openEdit()"
             v-if="$hasPermission('main:profession:save')"
-
           >
             新建
           </el-button>
@@ -35,26 +34,26 @@
             @click="removeBatch"
             plain
             v-if="$hasPermission('main:profession:delete')"
-
           >
             删除
           </el-button>
-          <el-button
-            size="small"
-            type="primary"
-            icon="el-icon-upload2"
-            class="ele-btn-icon"
-            plain
-          >
-            导出
-          </el-button>
+          <!--          <el-button
+                      size="small"
+                      type="primary"
+                      icon="el-icon-upload2"
+                      class="ele-btn-icon"
+                      @click="exportProfession"
+                      plain
+                    >
+                      导出
+                    </el-button>-->
           <el-button
             size="small"
             type="primary"
             icon="el-icon-download"
             class="ele-btn-icon"
             v-if="$hasPermission('main:profession:update')"
-
+            @click="importProfession"
             plain
           >
             导入
@@ -69,7 +68,6 @@
             icon="el-icon-edit"
             @click="openEdit(row)"
             v-if="$hasPermission('main:profession:update')"
-
           >
             修改
           </el-link>
@@ -87,7 +85,6 @@
             title="确定要删除当前工种吗?"
             @confirm="remove(row)"
             v-if="$hasPermission('main:profession:delete')"
-
           >
             <template v-slot:reference>
               <el-link type="danger" :underline="false" icon="el-icon-delete">
@@ -108,6 +105,14 @@
       ref="userEdit"
       :typeList="typeOptions"
     />
+
+    <importDialog
+      :defModule="moduleName"
+      ref="importDialogRef"
+      :fileUrl="'/main/profession/downLoadTemplate'"
+      fileName="工种导入模板"
+      @success="reload"
+    />
   </div>
 </template>
 
@@ -121,16 +126,19 @@
   } from '@/api/factoryModel';
   import control from '@/api/technology/control';
   import dictMixins from '@/mixins/dictMixins';
+  import importDialog from '@/components/upload/import-dialogNew.vue';
 
   export default {
     name: 'technologyProduction',
     components: {
+      importDialog,
       UserSearch,
       UserEdit
     },
     mixins: [dictMixins, tabMixins],
     data() {
       return {
+        moduleName: 'mainProfession',
         levelOptions: [
           {
             label: '初级',
@@ -207,6 +215,14 @@
             align: 'center',
             minWidth: 110
           },
+          {
+            slot: 'unit',
+            prop: 'unit',
+            label: '工时费单位',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110
+          },
           // {
           //   slot: 'aptitude',
           //   label: '资质',
@@ -251,6 +267,11 @@
       }
     },
     methods: {
+      importProfession() {
+        debugger;
+        this.$refs.importDialogRef.open();
+      },
+      exportJobs() {},
       /*配置工艺参数 */
       openSetting(row) {
         this.current = row;

+ 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')"
           >

+ 14 - 6
src/views/material/product/components/index-data.vue

@@ -309,7 +309,8 @@
   import { produceTypeList } from '@/enum/dict.js';
   import request from '@/utils/request';
   import { download } from '@/utils/file';
-  const attributeList = [
+  import { getByCode } from '@/api/system/dictionary-data';
+  /*const attributeList = [
     {
       label: '总装',
       value: 1
@@ -326,7 +327,7 @@
       label: '原材料',
       value: 4
     }
-  ];
+  ];*/
   const measureTypeList = [
     {
       label: '数量',
@@ -380,6 +381,7 @@
     },
     data() {
       return {
+        attributeList: [],
         exportLoading: false,
         moudleName: 'mainCategory',
 
@@ -530,9 +532,10 @@
             label: '存货类型',
             showOverflowTooltip: true,
             formatter: (row, column) => {
-              return attributeList.find(
-                (item) => item.value == row.attributeType
-              )?.label;
+              const item = this.attributeList.find(
+                (item) => item[row.attributeType] !== undefined
+              );
+              return item ? item[row.attributeType] : null; // 如果找不到返回 null
             }
           },
           {
@@ -608,7 +611,12 @@
       };
     },
 
-    created() {
+    created: function () {
+      getByCode('inventory_type').then((res) => {
+        if (res.code === '0') {
+          this.attributeList = res.data;
+        }
+      });
       this.requestDict('生产类型');
       this.getFieldModel();
     },

+ 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;