LAPTOP-16IUEB3P\Lenovo 2 лет назад
Родитель
Сommit
b2f5fc9050

+ 2 - 1
src/enum/dict.js

@@ -40,5 +40,6 @@ export const numberList = [
   'schedule_type',
   'leadtime_unit',
   'inspection_scheme',
-  'angle'
+  'angle',
+  'weight_unit'
 ];

+ 8 - 7
src/views/factoryModel/plant/components/edit.vue

@@ -93,9 +93,9 @@
           </el-form-item>
         </el-col>
         <el-col :span="8" style="margin-bottom: 22px">
-          <el-form-item label="负责人:" prop="extInfo.principal">
+          <el-form-item label="负责人:" prop="leaderId">
             <el-select
-              v-model="form.extInfo.principal"
+              v-model="form.leaderId"
               placeholder="请选择"
               @change="change_principal"
               style="width: 100%"
@@ -257,8 +257,9 @@ export default {
       id: '',
       code: '',
       name: '',
+      leaderId:'',
       extInfo: {
-        principal: '', // 负责人
+        // principal: '', // 负责人
         principalDep: '', // 负责人部门
         phone: '', // 手机号
         locationDetail: '', // 详细地址
@@ -292,8 +293,8 @@ export default {
         'extInfo.principalDep': [
           { required: true, message: '请输入', trigger: 'change' }
         ],
-        'extInfo.principal': [
-          { required: true, message: '请输入', trigger: 'change' }
+        leaderId: [
+          { required: true, message: '请选择', trigger: 'change' }
         ],
         'extInfo.phone': [
           { min: 11, message: '手机号格式不正确', trigger: 'blur' }
@@ -434,14 +435,14 @@ export default {
     },
     // 选择负责人部门
     change_principalDep() {
-      this.form.extInfo.principal = '';
+      this.form.leaderId = '';
       this.options.principal = [];
       this.getUserPage();
     },
     // 选择负责人
     change_principal() {
       let result = this.options.principal.find(
-        (n) => n.id == this.form.extInfo.principal
+        (n) => n.id == this.form.leaderId
       );
       this.form.extInfo.phone = result.phone;
     }

+ 8 - 7
src/views/factoryModel/productionLine/components/edit.vue

@@ -99,9 +99,9 @@
              </el-form-item>
            </el-col>
            <el-col :span="8" style="margin-bottom: 22px">
-             <el-form-item label="负责人:" prop="extInfo.principal">
+             <el-form-item label="负责人:" prop="leaderId">
                <el-select
-                 v-model="form.extInfo.principal"
+                 v-model="form.leaderId"
                  placeholder="请选择"
                  @change="change_principal"
                  style="width: 100%"
@@ -311,9 +311,10 @@ export default {
       id: '',
       code: '',
       name: '',
+      leaderId:'',
       extInfo: {
         factoryId: '',
-        principal: '', // 负责人
+        // principal: '', // 负责人
         principalDep: '', // 负责人部门
         phone: '', // 手机号
         workMeter: '', // 工作节拍
@@ -343,8 +344,8 @@ export default {
         'extInfo.principalDep': [
           { required: true, message: '请输入', trigger: 'change' }
         ],
-        'extInfo.principal': [
-          { required: true, message: '请输入', trigger: 'change' }
+        leaderId: [
+          { required: true, message: '请选择', trigger: 'change' }
         ],
         'extInfo.phone': [
           { min: 11, message: '手机号格式不正确', trigger: 'blur' }
@@ -510,7 +511,7 @@ export default {
     },
     // 选择负责人部门
     change_principalDep() {
-      this.form.extInfo.principal = '';
+      this.form.leaderId = '';
       this.options.principal = [];
       this.getUserPage();
     },
@@ -524,7 +525,7 @@ export default {
     // 选择负责人
     change_principal() {
       let result = this.options.principal.find(
-        (n) => n.id == this.form.extInfo.principal
+        (n) => n.id == this.form.leaderId
       );
       this.form.extInfo.phone = result.phone;
     }

+ 13 - 12
src/views/material/productLinkMaterial/components/link-material-dialog.vue

@@ -28,7 +28,7 @@
                 <categorySelect
                   :pid="type"
                   :key="type"
-                  v-model="where.categoryLevelGroupId"
+                  v-model="where.categoryId"
                 />
                 <!-- <el-input
                   placeholder="请输入"
@@ -102,7 +102,7 @@
                 <categorySelect
                   :pid="type"
                   :key="type"
-                  v-model="whereRight.categoryLevelGroupId"
+                  v-model="whereRight.categoryId"
                 /> </el-form-item
             ></el-col>
             <el-col :span="12">
@@ -363,9 +363,9 @@
       reload () {
         this.datasourceShow = this.datasource.filter((item) => {
           return (
-            (!this.where.categoryLevelGroupId ||
-              item.categoryLevelGroupId.includes(
-                this.where.categoryLevelGroupId
+            (!this.where.categoryId ||
+              item.parentId.includes(
+                this.where.categoryId
               )) &&
             (!this.where.code || item.code.includes(this.where.code)) &&
             (!this.where.name || item.name.includes(this.where.name)) &&
@@ -377,9 +377,9 @@
       reloadRight () {
         this.datasourceRightShow = this.datasourceRight.filter((item) => {
           return (
-            (!this.whereRight.categoryLevelGroupId ||
-              item.categoryLevelGroupId.includes(
-                this.whereRight.categoryLevelGroupId
+            (!this.whereRight.categoryId ||
+              item.parentId.includes(
+                this.whereRight.categoryId
               )) &&
             (!this.whereRight.code ||
               item.code.includes(this.whereRight.code)) &&
@@ -393,16 +393,17 @@
       async getDatasource () {
         const data = await unassociated({
           categoryLevelGroupId: this.idMap[this.type],
-          categoryLevelRootId: this.type
+          categoryLevelRootId: this.type,
+          mainCategoryId: this.row.id
         });
         this.datasource = data.slice(0);
         this.datasourceShow = data.slice(0);
       },
       async getDatasourceRight () {
         const data = await getRelatesInformationList({
-          mainCategoryId: this.row.id,
-          // categoryLevelGroupId: this.idMap[this.type],
-          categoryLevelRootId: this.type
+          categoryLevelGroupId: this.idMap[this.type],
+          categoryLevelRootId: this.type,
+          mainCategoryId: this.row.id
         });
         this.datasourceRight = data.slice(0);
         this.datasourceRightShow = data.slice(0);

+ 3 - 3
src/views/technology/parameter/components/user-edit.vue

@@ -212,19 +212,19 @@
             const maxValue = this.form.maxValue
             const minValue = this.form.minValue
             if(defaultValue!=''&maxValue!=''){
-               if(defaultValue>maxValue){
+               if(defaultValue>maxValue||defaultValue==maxValue){
                   this.loading = false;
                   return this.$message.warning('默认值应小于参数上限')
                }
             }
             if(defaultValue!=''&minValue!=''){
-               if(defaultValue<minValue){
+               if(defaultValue<minValue||defaultValue==minValue){
                   this.loading = false;
                   return this.$message.warning('默认值应大于参数下限')
                }
             }
             if(maxValue!=''&minValue!=''){
-               if(maxValue<minValue){
+               if(maxValue<minValue||maxValue==minValue){
                   this.loading = false;
                   return this.$message.warning('参数上限应大于参数下限')
                }

+ 48 - 17
src/views/technology/production/components/user-setting.vue

@@ -109,7 +109,7 @@
   import producetask from '@/api/technology/production';
   import parameter from '@/api/technology/parameter';
   import Paramrter from './parameter';
-
+  import { deepClone } from '@/components/FormGenerator/utils/index';
   export default {
     components: { Paramrter },
     props: {
@@ -153,21 +153,21 @@
             slot: 'maxValue',
             label: '参数上限',
             align: 'center',
-            showOverflowTooltip: true
+            // showOverflowTooltip: true
           },
           {
             prop: 'minValue',
             slot: 'minValue',
             label: '参数下限',
             align: 'center',
-            showOverflowTooltip: true
+            // showOverflowTooltip: true
           },
           {
             prop: 'defaultValue',
             slot: 'defaultValue',
             label: '默认值',
             align: 'center',
-            showOverflowTooltip: true
+            // showOverflowTooltip: true
           },
           {
             prop: 'notNull',
@@ -196,7 +196,7 @@
 
     methods: {
       addParamrter() {
-        let arr = this.$refs.Paramrter.selection;
+        let arr = deepClone(this.$refs.Paramrter.selection)
         arr.forEach((element) => {
           this.$set(element, 'paramId', element.id);
           this.$set(element, 'paramName', element.name);
@@ -208,7 +208,7 @@
         this.closeAdd();
       },
       showAddLog() {
-        this.tableData = this.$refs.table.getData();
+        this.tableData = this.$refs.table.getData()
         this.addDialog = true;
       },
       /*关闭选择参数*/
@@ -252,18 +252,49 @@
             this.$set(it, 'taskId', this.data.id);
           }
         });
-        producetask
-          .paramSave({
-            removeList: this.removeList,
-            saveList: arr
-          })
-          .then((msg) => {
-            if(msg){
-              this.$message.success(msg);
-              this.updateVisible(false);
+        if(!arr.length){
+          return this.$message.warning('参数不能为空')
+        }
+        let canSave = true
+        for(var i=0;i<arr.length;i++){
+            const defaultValue = arr[i].defaultValue
+            const maxValue = arr[i].maxValue
+            const minValue = arr[i].minValue
+            if(defaultValue!=''&maxValue!=''){
+               if(defaultValue>maxValue||defaultValue==maxValue){
+                  this.$message.warning('默认值应小于参数上限')
+                  canSave = false
+                  break
+               }
             }
-          });
-
+            if(defaultValue!=''&minValue!=''){
+               if(defaultValue<minValue||defaultValue==minValue){
+                  this.$message.warning('默认值应大于参数下限')
+                  canSave = false
+                  break
+               }
+            }
+            if(maxValue!=''&minValue!=''){
+               if(maxValue<minValue||maxValue==minValue){
+                  this.$message.warning('参数上限应大于参数下限')
+                  canSave = false
+                  break
+               }
+            }
+        }
+        if(canSave){
+            producetask
+              .paramSave({
+                removeList: this.removeList,
+                saveList: arr
+              })
+              .then((msg) => {
+                if(msg){
+                  this.$message.success(msg);
+                  this.updateVisible(false);
+                }
+              });
+        }
         // this.$refs.form.validate((valid) => {
         //   if (!valid) {
         //     return false;

+ 44 - 14
src/views/technology/route/components/production/components/user-setting.vue

@@ -162,21 +162,21 @@
             slot: 'maxValue',
             label: '参数上限',
             align: 'center',
-            showOverflowTooltip: true
+            // showOverflowTooltip: true
           },
           {
             prop: 'minValue',
             slot: 'minValue',
             label: '参数下限',
             align: 'center',
-            showOverflowTooltip: true
+            // showOverflowTooltip: true
           },
           {
             prop: 'defaultValue',
             slot: 'defaultValue',
             label: '默认值',
             align: 'center',
-            showOverflowTooltip: true
+            // showOverflowTooltip: true
           },
           {
             prop: 'notNull',
@@ -268,18 +268,48 @@
             this.$set(it, 'routingTaskId', this.data.id);
           }
         });
-        route
-          .taskinstanceParamSave({
-            removeList: this.removeList,
-            saveList: arr
-          })
-          .then((res) => {
-            if (res) {
-              this.$message.success('保存成功!');
-
-              this.updateVisible(false);
+        let canSave = true
+        for(var i=0;i<arr.length;i++){
+            const defaultValue = arr[i].defaultValue
+            const maxValue = arr[i].maxValue
+            const minValue = arr[i].minValue
+            if(defaultValue!=''&maxValue!=''){
+               if(defaultValue>maxValue||defaultValue==maxValue){
+                  this.$message.warning('默认值应小于参数上限')
+                  canSave = false
+                  break
+               }
             }
-          });
+            if(defaultValue!=''&minValue!=''){
+               if(defaultValue<minValue||defaultValue==minValue){
+                  this.$message.warning('默认值应大于参数下限')
+                  canSave = false
+                  break
+               }
+            }
+            if(maxValue!=''&minValue!=''){
+               if(maxValue<minValue||maxValue==minValue){
+                  this.$message.warning('参数上限应大于参数下限')
+                  canSave = false
+                  break
+               }
+            }
+        }
+        if(canSave){
+            route
+              .taskinstanceParamSave({
+                removeList: this.removeList,
+                saveList: arr
+              })
+              .then((res) => {
+                if (res) {
+                  this.$message.success('保存成功!');
+            
+                  this.updateVisible(false);
+                }
+              });
+        }
+
 
         // this.$refs.form.validate((valid) => {
         //   if (!valid) {