Просмотр исходного кода

产品信息详情页面跳转

yijing 1 год назад
Родитель
Сommit
ff00ccdd88

+ 1 - 1
src/api/ruleManagement/earlyWarning.js

@@ -43,7 +43,7 @@ export async function rulesSave(data) {
   return Promise.reject(new Error(res.data.message));
   return Promise.reject(new Error(res.data.message));
 }
 }
 export async function rulesUpdate(data) {
 export async function rulesUpdate(data) {
-  const res = await request.post('/main/alertrules/update', data);
+  const res = await request.put('/main/alertrules/update', data);
   if (res.data.code == 0) {
   if (res.data.code == 0) {
     return res.data;
     return res.data;
   }
   }

+ 18 - 3
src/main.js

@@ -5,7 +5,10 @@ import App from './App.vue';
 import store from './store';
 import store from './store';
 import router from './router';
 import router from './router';
 import permission from './utils/permission';
 import permission from './utils/permission';
-import { MAP_KEY, LICENSE_CODE } from '@/config/setting';
+import {
+  MAP_KEY,
+  LICENSE_CODE
+} from '@/config/setting';
 import EleAdmin from 'ele-admin';
 import EleAdmin from 'ele-admin';
 import VueClipboard from 'vue-clipboard2';
 import VueClipboard from 'vue-clipboard2';
 import i18n from './i18n';
 import i18n from './i18n';
@@ -40,6 +43,15 @@ import 'bpmn-js/dist/assets/bpmn-font/css/bpmn.css';
 import 'bpmn-js/dist/assets/bpmn-font/css/bpmn-codes.css';
 import 'bpmn-js/dist/assets/bpmn-font/css/bpmn-codes.css';
 import 'bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css';
 import 'bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css';
 
 
+// 引入公共方法
+import {
+  handleInputPublicHasPoint,
+  handleInputPublic
+} from './utils/inputHandler';
+
+Vue.prototype.$handleInputPublicHasPoint = handleInputPublicHasPoint;
+Vue.prototype.$handleInputPublic = handleInputPublic;
+
 Vue.component('DictSelection', DictSelection);
 Vue.component('DictSelection', DictSelection);
 Vue.config.productionTip = false;
 Vue.config.productionTip = false;
 
 
@@ -70,7 +82,10 @@ Vue.use(VueClipboard);
 let instance = null;
 let instance = null;
 
 
 function render(props = {}) {
 function render(props = {}) {
-  const { container, routerBase } = props;
+  const {
+    container,
+    routerBase
+  } = props;
   // const router = new VueRouter({
   // const router = new VueRouter({
   //   base: window.__POWERED_BY_QIANKUN__ ? routerBase : process.env.BASE_URL,
   //   base: window.__POWERED_BY_QIANKUN__ ? routerBase : process.env.BASE_URL,
   //   mode: 'history',
   //   mode: 'history',
@@ -97,7 +112,7 @@ export async function bootstrap() {
 export async function mount(props) {
 export async function mount(props) {
   console.log('[vue] props from main framework', props);
   console.log('[vue] props from main framework', props);
   Vue.prototype.$portalStore = props.store;
   Vue.prototype.$portalStore = props.store;
-  initParentStore(props.store?.state);
+  initParentStore(props.store ?.state);
   props.onGlobalStateChange((state, prev) => {
   props.onGlobalStateChange((state, prev) => {
     // state: 变更后的状态; prev 变更前的状态
     // state: 变更后的状态; prev 变更前的状态
     initParentStore(state);
     initParentStore(state);

+ 28 - 0
src/utils/inputHandler.js

@@ -0,0 +1,28 @@
+/**
+ * 处理输入值,使其只包含数字和最多一个小数点,并且小数点后最多保留两位
+ * @param {string} value - 输入的值
+ * @returns {string} - 处理后的值
+ */
+
+//小数点后两位处理
+export const handleInputPublicHasPoint = (value) => {
+  // 过滤掉非数字和小数点的字符
+  const filteredValue = value.replace(/[^0-9.]/g, '');
+  // 限制只能有一个小数点
+  const singleDotValue = filteredValue.replace(/(\..*)\./g, '$1');
+
+  let finalValue = '';
+  const dotIndex = singleDotValue.indexOf('.');
+  if (dotIndex !== -1) {
+    // 截取小数点后最多两位
+    finalValue = singleDotValue.slice(0, dotIndex + 3);
+  } else {
+    finalValue = singleDotValue;
+  }
+  return finalValue;
+};
+//整数
+export const handleInputPublic = (value) => {
+  // 只能输入数字
+  return value.replace(/[^0-9]/g, '');
+};

+ 62 - 55
src/views/material/product/components/BoatInfo.vue

@@ -1,48 +1,48 @@
 <template>
 <template>
   <div class="other">
   <div class="other">
-      <el-form label-width="100px"  ref="form" :model="form">
-         <div class="divider">
-           <div class="title">
-             <div class="ele-bg-primary"></div>
-             <span>舟皿信息</span>
-           </div>
-           <div class="ele-bg-primary ele-width"></div>
-         </div>
-         <el-row :gutter="24">
-           <el-col :span="8">
-             <el-form-item label="槽数" prop="slotNum">
-                <el-input  v-model="form.slotNum"/>
-             </el-form-item>
-           </el-col>
-           <el-col :span="8">
-             <el-form-item label="角度" prop="angle">
-                <DictSelection dictName="角度" clearable v-model="form.angle">
-                </DictSelection>
-             </el-form-item>
-           </el-col>
-           <el-col :span="8">
-             <el-form-item label="长" prop="palletLen">
-                <el-input v-model="form.palletLen">
-                    <template slot="append">mm</template>
-                </el-input>
-             </el-form-item>
-           </el-col>
-           <el-col :span="8">
-             <el-form-item label="宽" prop="wilde">
-                <el-input v-model="form.wilde">
-                    <template slot="append">mm</template>
-                </el-input>
-             </el-form-item>
-           </el-col>
-           <el-col :span="8">
-             <el-form-item label="高" prop="hight">
-                <el-input v-model="form.hight">
-                    <template slot="append">mm</template>
-                </el-input>
-             </el-form-item>
-           </el-col>
-         </el-row>
-      </el-form>
+    <el-form label-width="100px" ref="form" :model="form">
+      <div class="divider">
+        <div class="title">
+          <div class="ele-bg-primary"></div>
+          <span>舟皿信息</span>
+        </div>
+        <div class="ele-bg-primary ele-width"></div>
+      </div>
+      <el-row :gutter="24">
+        <el-col :span="8">
+          <el-form-item label="槽数" prop="slotNum">
+            <el-input v-model="form.slotNum" @input="handleInput1" />
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="角度" prop="angle">
+            <DictSelection dictName="角度" clearable v-model="form.angle">
+            </DictSelection>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="长" prop="palletLen">
+            <el-input v-model="form.palletLen" @input="handleInput2">
+              <template slot="append">mm</template>
+            </el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="宽" prop="wilde">
+            <el-input v-model="form.wilde" @input="handleInput3">
+              <template slot="append">mm</template>
+            </el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="高" prop="hight">
+            <el-input v-model="form.hight" @input="handleInput4">
+              <template slot="append">mm</template>
+            </el-input>
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
   </div>
   </div>
 </template>
 </template>
 
 
@@ -54,23 +54,30 @@
         default: {}
         default: {}
       }
       }
     },
     },
-    components: { },
+    components: {},
     data() {
     data() {
-      return {
-
-
-      };
+      return {};
     },
     },
 
 
     methods: {
     methods: {
-
-
+      handleInput1(val) {
+        this.form.slotNum = this.$handleInputPublicHasPoint(val);
+      },
+      handleInput2(val) {
+        this.form.palletLen = this.$handleInputPublicHasPoint(val);
+      },
+      handleInput3(val) {
+        this.form.wilde = this.$handleInputPublicHasPoint(val);
+      },
+      handleInput4(val) {
+        this.form.hight = this.$handleInputPublicHasPoint(val);
+      }
     }
     }
   };
   };
 </script>
 </script>
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>
-  .other{
+  .other {
     background: #fff;
     background: #fff;
     padding: 1px 17px;
     padding: 1px 17px;
   }
   }
@@ -89,17 +96,17 @@
         font-size: 20px;
         font-size: 20px;
       }
       }
     }
     }
-    .ele-width{
+    .ele-width {
       width: 100%;
       width: 100%;
       height: 2px;
       height: 2px;
     }
     }
   }
   }
-  .form-line{
+  .form-line {
     display: flex;
     display: flex;
     align-items: center;
     align-items: center;
     justify-content: space-between;
     justify-content: space-between;
-    .line-select{
-      margin-left:15px;
+    .line-select {
+      margin-left: 15px;
     }
     }
   }
   }
 </style>
 </style>

+ 52 - 13
src/views/material/product/components/MoldInfo.vue

@@ -12,8 +12,8 @@
         <el-col :span="8">
         <el-col :span="8">
           <el-form-item label="收缩系数" prop="shrinkEffictive">
           <el-form-item label="收缩系数" prop="shrinkEffictive">
             <el-input
             <el-input
-              type="number"
-              v-model.number="form.shrinkEffictive"
+              v-model="form.shrinkEffictive"
+              @input="handleInput1"
               placeholder="请输入"
               placeholder="请输入"
             >
             >
               <template #append>%</template>
               <template #append>%</template>
@@ -22,27 +22,31 @@
         </el-col>
         </el-col>
         <el-col :span="8">
         <el-col :span="8">
           <el-form-item label="芯杆数量" prop="coreBarNum">
           <el-form-item label="芯杆数量" prop="coreBarNum">
-            <el-input v-model="form.coreBarNum" />
+            <el-input v-model="form.coreBarNum" @input="handleInput2" />
           </el-form-item>
           </el-form-item>
         </el-col>
         </el-col>
         <el-col :span="8">
         <el-col :span="8">
           <el-form-item label="模孔数量" prop="dieHoleNum">
           <el-form-item label="模孔数量" prop="dieHoleNum">
-            <el-input v-model="form.dieHoleNum"> </el-input>
+            <el-input v-model="form.dieHoleNum" @input="handleInput3">
+            </el-input>
           </el-form-item>
           </el-form-item>
         </el-col>
         </el-col>
         <el-col :span="8">
         <el-col :span="8">
           <el-form-item label="上冲头数量" prop="upperPunchNum">
           <el-form-item label="上冲头数量" prop="upperPunchNum">
-            <el-input v-model="form.upperPunchNum"> </el-input>
+            <el-input v-model="form.upperPunchNum" @input="handleInput4">
+            </el-input>
           </el-form-item>
           </el-form-item>
         </el-col>
         </el-col>
         <el-col :span="8">
         <el-col :span="8">
           <el-form-item label="下冲头数量" prop="downPunchNum">
           <el-form-item label="下冲头数量" prop="downPunchNum">
-            <el-input v-model="form.downPunchNum"> </el-input>
+            <el-input v-model="form.downPunchNum" @input="handleInput5">
+            </el-input>
           </el-form-item>
           </el-form-item>
         </el-col>
         </el-col>
         <el-col :span="8">
         <el-col :span="8">
           <el-form-item label="最大冲压次数" prop="maxCyTimes">
           <el-form-item label="最大冲压次数" prop="maxCyTimes">
-            <el-input v-model="form.maxCyTimes"> </el-input>
+            <el-input v-model="form.maxCyTimes" @input="handleInput6">
+            </el-input>
           </el-form-item>
           </el-form-item>
         </el-col>
         </el-col>
         <el-col :span="8">
         <el-col :span="8">
@@ -53,31 +57,32 @@
 
 
         <el-col :span="8">
         <el-col :span="8">
           <el-form-item label="芯棒直径" prop="mandrelDiameter">
           <el-form-item label="芯棒直径" prop="mandrelDiameter">
-            <el-input v-model="form.mandrelDiameter"> </el-input>
+            <el-input v-model="form.mandrelDiameter" @input="handleInput7">
+            </el-input>
           </el-form-item>
           </el-form-item>
         </el-col>
         </el-col>
 
 
         <el-col :span="24">
         <el-col :span="24">
           <div class="rx-sc">
           <div class="rx-sc">
             <el-form-item label="长" prop="length">
             <el-form-item label="长" prop="length">
-              <el-input v-model="form.length">
+              <el-input v-model="form.length" @input="handleInput8">
                 <template slot="append">mm</template>
                 <template slot="append">mm</template>
               </el-input>
               </el-input>
             </el-form-item>
             </el-form-item>
 
 
             <el-form-item label="宽" prop="breadth">
             <el-form-item label="宽" prop="breadth">
-              <el-input v-model="form.breadth">
+              <el-input v-model="form.breadth" @input="handleInput9">
                 <template slot="append">mm</template>
                 <template slot="append">mm</template>
               </el-input>
               </el-input>
             </el-form-item>
             </el-form-item>
 
 
             <el-form-item label="高" prop="altitude">
             <el-form-item label="高" prop="altitude">
-              <el-input v-model="form.altitude">
+              <el-input v-model="form.altitude" @input="handleInput10">
                 <template slot="append">mm</template>
                 <template slot="append">mm</template>
               </el-input>
               </el-input>
             </el-form-item>
             </el-form-item>
             <el-form-item label="直径" prop="diameter">
             <el-form-item label="直径" prop="diameter">
-              <el-input v-model="form.diameter">
+              <el-input v-model="form.diameter" @input="handleInput11">
                 <template slot="append">mm</template>
                 <template slot="append">mm</template>
               </el-input>
               </el-input>
             </el-form-item>
             </el-form-item>
@@ -101,7 +106,41 @@
       return {};
       return {};
     },
     },
 
 
-    methods: {}
+    methods: {
+      handleInput1(val) {
+        this.form.shrinkEffictive = this.$handleInputPublicHasPoint(val);
+      },
+      handleInput2(val) {
+        this.form.coreBarNum = this.$handleInputPublic(val);
+      },
+      handleInput3(val) {
+        this.form.dieHoleNum = this.$handleInputPublic(val);
+      },
+      handleInput4(val) {
+        this.form.upperPunchNum = this.$handleInputPublic(val);
+      },
+      handleInput5(val) {
+        this.form.downPunchNum = this.$handleInputPublic(val);
+      },
+      handleInput6(val) {
+        this.form.maxCyTimes = this.$handleInputPublic(val);
+      },
+      handleInput7(val) {
+        this.form.mandrelDiameter = this.$handleInputPublicHasPoint(val);
+      },
+      handleInput8(val) {
+        this.form.length = this.$handleInputPublicHasPoint(val);
+      },
+      handleInput9(val) {
+        this.form.breadth = this.$handleInputPublicHasPoint(val);
+      },
+      handleInput10(val) {
+        this.form.altitude = this.$handleInputPublicHasPoint(val);
+      },
+      handleInput11(val) {
+        this.form.diameter = this.$handleInputPublicHasPoint(val);
+      }
+    }
   };
   };
 </script>
 </script>
 
 

+ 17 - 5
src/views/material/product/components/ProductionInfo.vue

@@ -17,21 +17,21 @@
         </el-col>
         </el-col>
         <el-col :span="8">
         <el-col :span="8">
           <el-form-item label="消耗波动" prop="consumWave">
           <el-form-item label="消耗波动" prop="consumWave">
-            <el-input v-model="form.consumWave">
+            <el-input v-model="form.consumWave" @input="handleInput1">
               <template slot="append">%</template>
               <template slot="append">%</template>
             </el-input>
             </el-input>
           </el-form-item>
           </el-form-item>
         </el-col>
         </el-col>
         <el-col :span="8">
         <el-col :span="8">
           <el-form-item label="变动损耗率" prop="changeLossRate">
           <el-form-item label="变动损耗率" prop="changeLossRate">
-            <el-input v-model="form.changeLossRate">
+            <el-input v-model="form.changeLossRate" @input="handleInput2">
               <template slot="append">%</template>
               <template slot="append">%</template>
             </el-input>
             </el-input>
           </el-form-item>
           </el-form-item>
         </el-col>
         </el-col>
         <el-col :span="8">
         <el-col :span="8">
           <el-form-item label="固定损耗数" prop="fixLossNum">
           <el-form-item label="固定损耗数" prop="fixLossNum">
-            <el-input v-model="form.fixLossNum" />
+            <el-input v-model="form.fixLossNum" @input="handleInput3" />
           </el-form-item>
           </el-form-item>
         </el-col>
         </el-col>
         <el-col :span="8">
         <el-col :span="8">
@@ -43,9 +43,9 @@
         <el-col :span="8">
         <el-col :span="8">
           <el-form-item label="生产周期" prop="productionDays">
           <el-form-item label="生产周期" prop="productionDays">
             <el-input
             <el-input
-              style="width: 100%"
-              type="number"
               v-model="form.productionDays"
               v-model="form.productionDays"
+              @input="handleInput4"
+              style="width: 100%"
             >
             >
               <span slot="append">天</span>
               <span slot="append">天</span>
             </el-input>
             </el-input>
@@ -142,6 +142,18 @@
             resolve(await valid);
             resolve(await valid);
           });
           });
         });
         });
+      },
+      handleInput1(val) {
+        this.form.consumWave = this.$handleInputPublicHasPoint(val);
+      },
+      handleInput2(val) {
+        this.form.changeLossRate = this.$handleInputPublicHasPoint(val);
+      },
+      handleInput3(val) {
+        this.form.fixLossNum = this.$handleInputPublicHasPoint(val);
+      },
+      handleInput4(val) {
+        this.form.productionDays = this.$handleInputPublicHasPoint(val);
       }
       }
     }
     }
   };
   };

+ 19 - 14
src/views/material/product/components/PurchasingInfo.vue

@@ -11,11 +11,10 @@
       <el-row :gutter="24">
       <el-row :gutter="24">
         <el-col :span="8">
         <el-col :span="8">
           <el-form-item label="周期" prop="purchasingCycle">
           <el-form-item label="周期" prop="purchasingCycle">
-            <el-input-number
+            <el-input
               v-model="form.purchasingCycle"
               v-model="form.purchasingCycle"
               placeholder="请输入"
               placeholder="请输入"
-              :min="0"
-              :controls="false"
+              @input="handleInput1"
               style="width: calc(100% - 100px)"
               style="width: calc(100% - 100px)"
             />
             />
             <DictSelection
             <DictSelection
@@ -29,22 +28,20 @@
         </el-col>
         </el-col>
         <el-col :span="8">
         <el-col :span="8">
           <el-form-item label="倍数" prop="purchaseMultiplier">
           <el-form-item label="倍数" prop="purchaseMultiplier">
-            <el-input-number
-              style="width: 100%"
+            <el-input
               v-model="form.purchaseMultiplier"
               v-model="form.purchaseMultiplier"
               placeholder="请输入"
               placeholder="请输入"
-              :min="0"
-              :controls="false"
+              @input="handleInput2"
+              style="width: 100%"
             />
             />
           </el-form-item>
           </el-form-item>
         </el-col>
         </el-col>
         <el-col :span="8">
         <el-col :span="8">
           <el-form-item label="最低订购量" prop="minimumOrderQuantity">
           <el-form-item label="最低订购量" prop="minimumOrderQuantity">
-            <el-input-number
+            <el-input
               v-model="form.minimumOrderQuantity"
               v-model="form.minimumOrderQuantity"
               placeholder="请输入"
               placeholder="请输入"
-              :min="0"
-              :controls="false"
+              @input="handleInput3"
               style="width: calc(100% - 100px)"
               style="width: calc(100% - 100px)"
             />
             />
             <DictSelection
             <DictSelection
@@ -98,7 +95,7 @@
 <script>
 <script>
   import deptSelect from '@/components/CommomSelect/dept-select.vue';
   import deptSelect from '@/components/CommomSelect/dept-select.vue';
   import personSelect from '@/components/CommomSelect/person-select.vue';
   import personSelect from '@/components/CommomSelect/person-select.vue';
-  import {getByCode} from "@/api/system/dictionary-data";
+  import { getByCode } from '@/api/system/dictionary-data';
   export default {
   export default {
     props: {
     props: {
       form: {
       form: {
@@ -109,12 +106,11 @@
     components: { deptSelect, personSelect },
     components: { deptSelect, personSelect },
     data() {
     data() {
       return {
       return {
-        dictList:[]
+        dictList: []
       };
       };
     },
     },
     watch: {
     watch: {
       form(data) {
       form(data) {
-        console.log(data, 'data');
         if (data.checkDepart) {
         if (data.checkDepart) {
           const params = { executeGroupId: data.checkDepart };
           const params = { executeGroupId: data.checkDepart };
           this.$nextTick(() => {
           this.$nextTick(() => {
@@ -123,7 +119,7 @@
         }
         }
       }
       }
     },
     },
-    activated(){
+    activated() {
       this.getDictList('purchase_origin');
       this.getDictList('purchase_origin');
     },
     },
     methods: {
     methods: {
@@ -144,6 +140,15 @@
         this.$nextTick(() => {
         this.$nextTick(() => {
           this.$refs.directorRef.getList(params);
           this.$refs.directorRef.getList(params);
         });
         });
+      },
+      handleInput1(val) {
+        this.form.purchasingCycle = this.$handleInputPublicHasPoint(val);
+      },
+      handleInput2(val) {
+        this.form.purchaseMultiplier = this.$handleInputPublicHasPoint(val);
+      },
+      handleInput3(val) {
+        this.form.minimumOrderQuantity = this.$handleInputPublicHasPoint(val);
       }
       }
     }
     }
   };
   };

+ 16 - 5
src/views/material/product/components/WarehouseInfo.vue

@@ -43,7 +43,7 @@
               trigger: 'blur'
               trigger: 'blur'
             }"
             }"
           >
           >
-            <el-input v-model="form.secureInventory" @input="handleInputPublic">
+            <el-input v-model="form.secureInventory" @input="handleInput1">
               <template #append>
               <template #append>
                 {{ packingUnit }}
                 {{ packingUnit }}
               </template>
               </template>
@@ -60,7 +60,7 @@
               trigger: 'blur'
               trigger: 'blur'
             }"
             }"
           >
           >
-            <el-input v-model="form.minInventory">
+            <el-input v-model="form.minInventory" @input="handleInput2">
               <template #append>
               <template #append>
                 {{ packingUnit }}
                 {{ packingUnit }}
               </template>
               </template>
@@ -77,7 +77,7 @@
               trigger: 'blur'
               trigger: 'blur'
             }"
             }"
           >
           >
-            <el-input v-model="form.maxInventory">
+            <el-input v-model="form.maxInventory" @input="handleInput3">
               <template #append>
               <template #append>
                 {{ packingUnit }}
                 {{ packingUnit }}
               </template>
               </template>
@@ -100,6 +100,7 @@
             <div class="form-line">
             <div class="form-line">
               <el-input
               <el-input
                 v-model="form.warrantyPeriod"
                 v-model="form.warrantyPeriod"
+                @input="handleInput4"
                 style="width: calc(100% - 100px)"
                 style="width: calc(100% - 100px)"
               />
               />
               <DictSelection
               <DictSelection
@@ -402,9 +403,19 @@
       console.log(this.packingRules, 'packingRules');
       console.log(this.packingRules, 'packingRules');
     },
     },
     methods: {
     methods: {
-      handleInputPublic(value) {
-        this.form.secureInventory = value.replace(/[^0-9]/g, '');
+      handleInput1(value) {
+        this.form.secureInventory = this.$handleInputPublic(value);
       },
       },
+      handleInput2(value) {
+        this.form.minInventory = this.$handleInputPublic(value);
+      },
+      handleInput3(value) {
+        this.form.maxInventory = this.$handleInputPublic(value);
+      },
+      handleInput4(value) {
+        this.form.warrantyPeriod = this.$handleInputPublicHasPoint(value);
+      },
+
       async defaultBuild(val) {
       async defaultBuild(val) {
         if (!this.hasPushed) {
         if (!this.hasPushed) {
           let code = await getCode('package_disposition');
           let code = await getCode('package_disposition');

+ 58 - 534
src/views/material/product/detail.vue

@@ -146,7 +146,7 @@
                 <el-input
                 <el-input
                   v-model="form.volume"
                   v-model="form.volume"
                   style="width: calc(100% - 100px)"
                   style="width: calc(100% - 100px)"
-                  @input="handleInputPublicHasPoint"
+                  @input="handleInput1"
                 />
                 />
                 <DictSelection
                 <DictSelection
                   dictName="体积单位"
                   dictName="体积单位"
@@ -162,7 +162,7 @@
           <el-col :span="8">
           <el-col :span="8">
             <el-form-item label="毛重">
             <el-form-item label="毛重">
               <div class="form-line">
               <div class="form-line">
-                <el-input v-model="form.roughWeight" />
+                <el-input v-model="form.roughWeight" @input="handleInput2" />
               </div>
               </div>
             </el-form-item>
             </el-form-item>
           </el-col>
           </el-col>
@@ -170,7 +170,7 @@
           <el-col :span="8">
           <el-col :span="8">
             <el-form-item label="净重">
             <el-form-item label="净重">
               <div class="form-line">
               <div class="form-line">
-                <el-input v-model="form.netWeight" />
+                <el-input v-model="form.netWeight" @input="handleInput3" />
               </div>
               </div>
             </el-form-item>
             </el-form-item>
           </el-col>
           </el-col>
@@ -213,23 +213,6 @@
               </template>
               </template>
             </el-form-item>
             </el-form-item>
           </el-col>
           </el-col>
-
-          <el-col :span="8">
-            <el-form-item label="属性类型:" prop="attributeType">
-              <el-select
-                v-model="form.attributeType"
-                filterable
-                class="ele-block"
-              >
-                <el-option
-                  v-for="item in attributeList"
-                  :key="item.value"
-                  :value="item.value"
-                  :label="item.label"
-                ></el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
         </el-row>
         </el-row>
       </el-form>
       </el-form>
     </el-card>
     </el-card>
@@ -244,7 +227,6 @@
     <!-- 分类选择弹窗 -->
     <!-- 分类选择弹窗 -->
     <CategoryDialog ref="categoryRefs" @chooseCategory="confirmCategory" />
     <CategoryDialog ref="categoryRefs" @chooseCategory="confirmCategory" />
     <!-- 仓储配置 -->
     <!-- 仓储配置 -->
-    <<<<<<< HEAD
     <WarehouseInfo
     <WarehouseInfo
       ref="warehouseRefs"
       ref="warehouseRefs"
       v-if="isShow"
       v-if="isShow"
@@ -254,24 +236,10 @@
       :packageDispositionVOList="packageDispositionVOList"
       :packageDispositionVOList="packageDispositionVOList"
       @change="changePackagingSpecification"
       @change="changePackagingSpecification"
     />
     />
-    =======
-    <WarehouseInfo
-      ref="warehouseRefs"
-      :form="categoryWms"
-      :measuringUnit="form.measuringUnit"
-      :packingUnit="form.packingUnit"
-      :packageDispositionVOList="packageDispositionVOList"
-      @change="changePackagingSpecification"
-    />
-    >>>>>>> 778152e35a1d73386814551d9d6194caae9cf792
     <!-- 销售配置 -->
     <!-- 销售配置 -->
     <SalesInfos ref="salesRefs" :form="categorySales" />
     <SalesInfos ref="salesRefs" :form="categorySales" />
     <!-- 采购信息 -->
     <!-- 采购信息 -->
-    <PurchasingInfo
-      ref="PurchasingInfoRefs"
-      v-if="categoryPurchase"
-      :form="categoryPurchase"
-    />
+    <PurchasingInfo ref="PurchasingInfoRefs" :form="categoryPurchase" />
     <!-- 生产信息 -->
     <!-- 生产信息 -->
     <ProductionInfo ref="productionRefs" :form="categoryMes" />
     <ProductionInfo ref="productionRefs" :form="categoryMes" />
     <!-- 计划 -->
     <!-- 计划 -->
@@ -323,39 +291,6 @@
   import { deepClone } from '@/utils/index';
   import { deepClone } from '@/utils/index';
   import { finishPageTab, reloadPageTab } from '@/utils/page-tab-util';
   import { finishPageTab, reloadPageTab } from '@/utils/page-tab-util';
 
 
-  <<<<<<< HEAD
-    export default {
-      name: 'product',
-      components: {
-        SalesInfos,
-        PurchasingInfo,
-        linkMsg,
-        GroupDialog,
-        deptSelect,
-        personSelect,
-        WarehouseInfo,
-        ProcureInfo,
-        ProductionInfo,
-        PlanInfo,
-        SalesInfo,
-        QualityInfo,
-        BoatInfo,
-        TurnoverInfo,
-        MoldInfo,
-        RemarkInfo,
-        CategoryDialog,
-        CodeDialog
-      },
-      data() {
-        return {
-          isShow: true,
-          packagingSpecificationList: [],
-          loading: false,
-          levelOptions: [
-            {
-              label: '特级',
-              value: '特级'
-  =======
   export default {
   export default {
     name: 'product',
     name: 'product',
     components: {
     components: {
@@ -380,6 +315,7 @@
     },
     },
     data() {
     data() {
       return {
       return {
+        isShow: true,
         packagingSpecificationList: [],
         packagingSpecificationList: [],
         loading: false,
         loading: false,
         levelOptions: [
         levelOptions: [
@@ -400,24 +336,6 @@
             value: '三级'
             value: '三级'
           }
           }
         ],
         ],
-        attributeList: [
-          {
-              label: '总装',
-              value: 1
-  >>>>>>> 778152e35a1d73386814551d9d6194caae9cf792
-            },
-            {
-              label: '部件',
-              value: 2
-            },
-            {
-              label: '零',
-              value: 3
-            },{
-              label: '原材料',
-              value: 4
-            }
-          ],
         form: {
         form: {
           categoryLevelGroupName: '',
           categoryLevelGroupName: '',
           categoryLevelName: '',
           categoryLevelName: '',
@@ -425,7 +343,7 @@
           measuringUnit: '',
           measuringUnit: '',
           weightUnit: '',
           weightUnit: '',
           packingUnit: '',
           packingUnit: '',
-          attributeType:'',
+
           extField: {}
           extField: {}
         },
         },
 
 
@@ -433,39 +351,24 @@
           remarkAttach: []
           remarkAttach: []
         },
         },
         categorySales: {},
         categorySales: {},
-        categoryPurchase: { purchaseMultiplier: 1 },
+        categoryPurchase: { purchaseMultiplier: 1, measuringUnit: '' },
         categoryAps: {},
         categoryAps: {},
         categoryMes: {},
         categoryMes: {},
         categoryMold: {},
         categoryMold: {},
         categoryPallet: {},
         categoryPallet: {},
-        categoryQms: {},
+        categoryQms: {
+          isComeCheck: '1'
+        },
         categoryVehicle: {},
         categoryVehicle: {},
         categoryWms: {
         categoryWms: {
-          isUnpack: 1
+          isUnpack: 1,
+          isWarn: 1,
+          inventoryMode: ''
         },
         },
         packageDispositionVOList: [],
         packageDispositionVOList: [],
         categoryLevelPathId: null,
         categoryLevelPathId: null,
 
 
-          remarkform: {
-            remarkAttach: []
-          },
-          categorySales: {},
-          categoryPurchase: { purchaseMultiplier: 1, measuringUnit: '' },
-          categoryAps: {},
-          categoryMes: {},
-          categoryMold: {},
-          categoryPallet: {},
-          categoryQms: {
-            isComeCheck: '1'
-          },
-          categoryVehicle: {},
-          categoryWms: {
-            isUnpack: 1,
-            isWarn: 1,
-            inventoryMode: ''
-          },
-          packageDispositionVOList: [],
-          categoryLevelPathId: null,
+        dictList: [],
 
 
         fileList: [],
         fileList: [],
         // 表单验证规则
         // 表单验证规则
@@ -521,6 +424,7 @@
               packingUnit: '',
               packingUnit: '',
               extField: {}
               extField: {}
             };
             };
+            this.categorySales = {};
             this.purchaseInfo = {};
             this.purchaseInfo = {};
             this.remarkform = {
             this.remarkform = {
               remarkAttach: []
               remarkAttach: []
@@ -532,140 +436,16 @@
             this.categoryQms = {};
             this.categoryQms = {};
             this.categoryVehicle = {};
             this.categoryVehicle = {};
             this.categoryWms = {
             this.categoryWms = {
-              isUnpack: 1
+              isUnpack: 1,
+              isWarn: 1,
+              inventoryMode: this.form.isConsumable
             };
             };
             this.packageDispositionVOList = [];
             this.packageDispositionVOList = [];
             this.categoryLevelPathId = null;
             this.categoryLevelPathId = null;
 
 
-          status: null
-        };
-      },
-      watch: {
-        '$route.query.id': {
-          handler(id) {
-            if (id) {
-              this._getDetails();
-            } else {
-              this.form = {
-                categoryLevelGroupName: '',
-                // categoryLevelName: '',
-                isConsumable: 1,
-                measuringUnit: '',
-                weightUnit: '',
-                packingUnit: '',
-                extField: {}
-              };
-              this.categorySales = {};
-              this.purchaseInfo = {};
-              this.remarkform = {
-                remarkAttach: []
-              };
-              this.categoryAps = {};
-              this.categoryMes = {};
-              this.categoryMold = {};
-              this.categoryPallet = {};
-              this.categoryQms = {};
-              this.categoryVehicle = {};
-              this.categoryWms = {
-                isUnpack: 1,
-                isWarn: 1,
-                inventoryMode: this.form.isConsumable
-              };
-              this.packageDispositionVOList = [];
-              this.categoryLevelPathId = null;
-
-              this.dictList = [];
-
-              this.fileList = [];
-            }
-        },
-          deep: true,
-          immediate: true
-
-      },
-      async activated() {
-        this.status = this.$route.query.status;
-        this.form.categoryLevelId = this.$route.query.categoryLevelId;
-        this.form.categoryLevelName = this.$route.query.categoryLevelName;
-        this.form.categoryLevelPath = this.$route.query.categoryLevelPath;
-        this.form.categoryLevelPathId = this.$route.query.categoryLevelPathId;
-
-        this.ruleCode = this.$route.query.ruleCode;
-        if (this.ruleCode && this.ruleCode != '自定义' && this.status != 0) {
-          const code = await getCode(this.ruleCode);
-          this.$set(this.form, 'code', code);
-        }
-
-        this.getFieldModel();
-
-        this.getDictList('productionType');
-      },
-      async created() {
-        //新增
-
-        this.$set(
-          this.form,
-          'categoryLevelId',
-          this.$route.query.categoryLevelId
-        );
-        this.$set(
-          this.form,
-          'categoryLevelName',
-          this.$route.query.categoryLevelName
-        );
-        this.$set(
-          this.form,
-          'categoryLevelPath',
-          this.$route.query.categoryLevelPath
-        );
-        this.$set(
-          this.form,
-          'categoryLevelPathId',
-          this.$route.query.categoryLevelPathId
-        );
-        this.status = this.$route.query.status;
-        this.ruleCode = this.$route.query.ruleCode;
-        if (this.ruleCode && this.ruleCode != '自定义' && this.status != 0) {
-          const code = await getCode(this.ruleCode);
-          this.$set(this.form, 'code', code);
-        }
+            this.dictList = [];
 
 
-        this.getFieldModel();
-
-        this.getDictList('productionType');
-      },
-      methods: {
-        handleInputPublicHasPoint(value) {
-          const filteredValue = value.replace(/[^0-9.]/g, '');
-          let finalValue = '';
-          const dotIndex = filteredValue.indexOf('.');
-          if (dotIndex !== -1) {
-            finalValue = filteredValue.slice(0, dotIndex + 3);
-          } else {
-            finalValue = filteredValue;
-          }
-          this.form.volume = finalValue;
-        },
-        changeConsumable() {
-          this.categoryWms.inventoryMode = this.form.isConsumable;
-        },
-        changeUnit() {
-          if (this.$route.query.id == '' || this.$route.query.id == null) {
-            if (this.form.measuringUnit) {
-              this.categoryPurchase.measuringUnit = this.form.measuringUnit;
-              // 如果有计量单位和包装单位 默认添加包装组
-              if (this.form.packingUnit) {
-                this.$refs.warehouseRefs.defaultBuild(this.form.packingUnit);
-              }
-            }
-          } else {
-            this.isShow = false;
-            if (this.form.measuringUnit && this.form.packingUnit) {
-              console.log(this.form.measuringUnit, 'this.form.measuringUnit');
-              console.log(this.form.packingUnit, 'this.form.packingUnit');
-            }
-
-            this.isShow = true;
+            this.fileList = [];
           }
           }
         },
         },
         deep: true,
         deep: true,
@@ -721,15 +501,42 @@
 
 
       this.getFieldModel();
       this.getFieldModel();
 
 
-      // if (this.$route.query.id) {
-      //   this._getDetails();
-      // }
       this.getDictList('productionType');
       this.getDictList('productionType');
     },
     },
     methods: {
     methods: {
+      handleInput(value) {
+        this.form.volume = this.$handleInputPublicHasPoint(value);
+      },
+      handleInput2(value) {
+        this.form.roughWeight = this.$handleInputPublicHasPoint(value);
+      },
+      handleInput3(value) {
+        this.form.netWeight = this.$handleInputPublicHasPoint(value);
+      },
+      changeConsumable() {
+        this.categoryWms.inventoryMode = this.form.isConsumable;
+      },
       changeUnit() {
       changeUnit() {
-        if (this.form.measuringUnit && this.form.packingUnit) {
-          this.$refs.warehouseRefs.defaultBuild(this.form.packingUnit);
+        if (this.$route.query.id == '' || this.$route.query.id == null) {
+          if (this.form.measuringUnit) {
+            this.categoryPurchase.measuringUnit = this.form.measuringUnit;
+            console.log(this.categoryPurchase.measuringUnit, '采购信息');
+            // 如果有计量单位和包装单位 默认添加包装组
+            if (this.form.packingUnit) {
+              this.$refs.warehouseRefs.defaultBuild(this.form.packingUnit);
+            }
+          }
+        } else {
+          this.isShow = false;
+          if (this.form.measuringUnit) {
+            this.categoryPurchase.measuringUnit = this.form.measuringUnit;
+
+            if (this.form.packingUnit) {
+              console.log(this.form.measuringUnit, 'this.form.measuringUnit');
+              console.log(this.form.packingUnit, 'this.form.packingUnit');
+            }
+          }
+          this.isShow = true;
         }
         }
       },
       },
       changePackagingSpecification(val) {
       changePackagingSpecification(val) {
@@ -744,6 +551,9 @@
           ...info.category
           ...info.category
         };
         };
 
 
+        // if (this.form.measuringUnit && this.form.packingUnit) {
+        //   this.$refs.warehouseRefs.defaultBuild(this.form.packingUnit);
+        // }
         this.categoryLevelPathId = info.category.categoryLevelPathIdParent;
         this.categoryLevelPathId = info.category.categoryLevelPathIdParent;
         this.judgeSet(info);
         this.judgeSet(info);
 
 
@@ -760,6 +570,7 @@
       // 判断字段类型并赋值
       // 判断字段类型并赋值
       judgeSet(info) {
       judgeSet(info) {
         console.log('info-------', info);
         console.log('info-------', info);
+
         if (typeof info.categoryAps == 'string') {
         if (typeof info.categoryAps == 'string') {
           this.categoryAps = {};
           this.categoryAps = {};
         } else {
         } else {
@@ -866,17 +677,9 @@
         });
         });
       },
       },
 
 
-  <<<<<<< HEAD
-          // if (this.form.measuringUnit && this.form.packingUnit) {
-          //   this.$refs.warehouseRefs.defaultBuild(this.form.packingUnit);
-          // }
-          this.categoryLevelPathId = info.category.categoryLevelPathIdParent;
-          this.judgeSet(info);
-  =======
       openCategory() {
       openCategory() {
         this.$refs.categoryRefs.open();
         this.$refs.categoryRefs.open();
       },
       },
-  >>>>>>> 778152e35a1d73386814551d9d6194caae9cf792
 
 
       openCode() {
       openCode() {
         this.codeShow = true;
         this.codeShow = true;
@@ -888,78 +691,6 @@
         this.$forceUpdate();
         this.$forceUpdate();
       },
       },
 
 
-  <<<<<<< HEAD
-          this.$forceUpdate();
-        },
-        // 判断字段类型并赋值
-        judgeSet(info) {
-          console.log('info-------', info);
-
-          if (typeof info.categoryAps == 'string') {
-            this.categoryAps = {};
-          } else {
-            this.categoryAps = info.categoryAps;
-          }
-          if (typeof info.categoryMes == 'string') {
-            this.categoryMes = {};
-          } else {
-            this.categoryMes = info.categoryMes;
-          }
-          if (typeof info.categoryMold == 'string') {
-            this.categoryMold = {};
-          } else {
-            this.categoryMold = info.categoryMold;
-          }
-          if (typeof info.categoryPallet == 'string') {
-            this.categoryPallet = {};
-          } else {
-            this.categoryPallet = info.categoryPallet;
-          }
-          if (typeof info.categorySales == 'string') {
-            this.categorySales = {};
-          } else {
-            this.categorySales = info.categorySales;
-          }
-
-          if (typeof info.categoryPurchase == 'string') {
-            this.categoryPurchase = {};
-          } else {
-            this.categoryPurchase = info.categoryPurchase;
-          }
-          if (typeof info.categoryQms == 'string') {
-            this.categoryQms = {};
-          } else {
-            this.categoryQms = info.categoryQms;
-          }
-          if (typeof info.categoryVehicle == 'string') {
-            this.categoryVehicle = {};
-          } else {
-            this.categoryVehicle = info.categoryVehicle;
-          }
-          if (typeof info.categoryWms == 'string') {
-            this.categoryWms = {};
-          } else {
-            this.categoryWms = info.categoryWms;
-          }
-          if (typeof info.packageDispositionVOList == 'string') {
-            this.packageDispositionVOList = [];
-          } else {
-            this.packageDispositionVOList = info.packageDispositionVOList;
-            console.log(
-              'this.packageDispositionVOList---!!!----',
-              this.packageDispositionVOList
-            );
-          }
-        },
-
-        getFieldModel() {
-          fieldModel({ relevance: 't_main_category' }).then((res) => {
-            this.fileList = res;
-
-            this.fileList.forEach((f) => {
-              this.$set(this.form.extField, f.prop, ''); // 初始化动态模型属性
-            });
-  =======
       cancel() {
       cancel() {
         // finishPageTab();
         // finishPageTab();
         // this.$router.go(-1);
         // this.$router.go(-1);
@@ -969,7 +700,6 @@
             query: {
             query: {
               categoryLevelId: this.form.categoryLevelId
               categoryLevelId: this.form.categoryLevelId
             }
             }
-  >>>>>>> 778152e35a1d73386814551d9d6194caae9cf792
           });
           });
         } else {
         } else {
           this.$router.push({
           this.$router.push({
@@ -977,213 +707,6 @@
             query: {
             query: {
               categoryLevelId: this.form.categoryLevelId
               categoryLevelId: this.form.categoryLevelId
             }
             }
-  <<<<<<< HEAD
-          }
-
-          this.$forceUpdate();
-        },
-
-        async getDictList(code) {
-          let { data: res } = await getByCode(code);
-          this.dictList = res.map((item) => {
-            let values = Object.keys(item);
-            return {
-              value: Number(values[0]),
-              label: item[values[0]]
-            };
-          });
-        },
-
-        openCategory() {
-          this.$refs.categoryRefs.open();
-        },
-
-        openCode() {
-          this.codeShow = true;
-        },
-
-        chooseCode(code) {
-          this.$set(this.form, 'code', code);
-          this.codeShow = false;
-          this.$forceUpdate();
-        },
-
-        cancel() {
-          // finishPageTab();
-          // this.$router.go(-1);
-          if (this.$route.query.rootTreeId == 9) {
-            this.$router.push({
-              path: '/product/oneProduct',
-              query: {
-                categoryLevelId: this.form.categoryLevelId
-              }
-            });
-          } else {
-            this.$router.push({
-              path: '/material/product',
-              query: {
-                categoryLevelId: this.form.categoryLevelId
-              }
-            });
-          }
-        },
-
-        // 保存
-        submit() {
-          this.$refs.manageForm.validate(async (valid) => {
-            let productionValid = await this.$refs.productionRefs.getFormValid();
-            let warehouseValid = await this.$refs.warehouseRefs.getFormValid();
-
-            if (!valid || !productionValid || !warehouseValid) {
-              return false;
-            }
-
-            let packageDispositionVOList = [];
-            if (this.packagingSpecificationList.length > 0) {
-              packageDispositionVOList = this.packagingSpecificationList.map(
-                (item) => {
-                  let obj = {
-                    code: item.code,
-                    name: item.name
-                  };
-                  return [
-                    {
-                      ...obj,
-                      id: item.id0,
-                      sort: 0,
-                      status: item.status,
-                      packageCell: 1,
-                      packageUnit: item.packageUnit,
-                      conversionUnit: item.packageUnit
-                    },
-                    {
-                      ...obj,
-                      id: item.id1,
-                      sort: 1,
-                      packageCell: item.minPackageCell,
-                      packageUnit: item.packageUnit,
-                      conversionUnit: item.minConversionUnit,
-                      status: item.status
-                    },
-                    {
-                      ...obj,
-                      id: item.id2,
-                      sort: 2,
-                      packageCell: item.inPackageCell,
-                      packageUnit: item.minConversionUnit,
-                      conversionUnit: item.inConversionUnit,
-                      status: item.status
-                    },
-                    {
-                      ...obj,
-                      id: item.id3,
-                      sort: 3,
-                      packageCell: item.outPackageCell,
-                      packageUnit: item.inConversionUnit,
-                      conversionUnit: item.outConversionUnit,
-                      status: item.status
-                    }
-                  ];
-                }
-              );
-              let packagingSpecificationList =
-                this.packagingSpecificationList.filter(
-                  (item) => item.status == 1
-                );
-              this.form.extField.packingSpecification = packagingSpecificationList
-                .map((item) => {
-                  return [
-                    `${item.minPackageCell}${item.packageUnit}/${item.minConversionUnit}`,
-                    `${item.inPackageCell}${item.minConversionUnit}/${item.inConversionUnit}`,
-                    `${item.outPackageCell}${item.inConversionUnit}/${item.outConversionUnit}`
-                  ];
-                })
-                .flat()
-                .join(',');
-            } else {
-              this.form.extField.packingSpecification = '';
-            }
-
-            this.loading = true;
-            // const imgList = this.remarkform.imgList;
-            // const arr = [];
-            // if (imgList.length) {
-            //   imgList.map((item) => {
-            //     arr.push(item.storePath);
-            //   });
-            //   this.form.remarkAttach = arr.join(',');
-            // }
-            // this.form.remark = this.remarkform.remark
-            //   ? this.remarkform.remark
-            //   : '';
-
-            const data = {
-              categorySales: this.categorySales,
-              categoryPurchase: this.categoryPurchase,
-              categoryWms: this.categoryWms,
-              categoryAps: this.categoryAps,
-              categoryMes: this.categoryMes,
-              categoryMold: this.categoryMold,
-              categoryPallet: this.categoryPallet,
-              categoryQms: this.categoryQms,
-              categoryVehicle: this.categoryVehicle,
-              category: {
-                ...this.form,
-                ...this.remarkform,
-                ...this.PathInfo
-              },
-              packageDispositionVOList: packageDispositionVOList.flat()
-            };
-
-            if (this.$route.query.status == 1) {
-              data.categorySales.id = null;
-              data.categoryPurchase.id = null;
-              data.category.id = null;
-              data.categoryWms.id = null;
-              data.categoryAps.id = null;
-              data.categoryMes.id = null;
-              data.categoryMold.id = null;
-              data.categoryPallet.id = null;
-              data.categoryQms.id = null;
-              data.categoryVehicle.id = null;
-              data.packageDispositionVOList = data.packageDispositionVOList.map(
-                (item) => {
-                  return {
-                    ...item,
-                    id: null
-                  };
-                }
-              );
-            }
-            console.log('保存', data);
-            addMaterial(data)
-              .then((msg) => {
-                this.loading = false;
-                this.$message.success(msg);
-                // reloadPageTab({ fullPath: '/material/product' });
-                // this.$router.go(-1);
-                this.cancel();
-                // if (this.$route.query.rootTreeId == 9) {
-                //   this.$router.push({
-                //     path: '/product/oneProduct',
-                //     query: {
-                //       categoryLevelId: this.form.categoryLevelId
-                //     }
-                //   });
-                // } else {
-                //   this.$router.push({
-                //     path: '/material/product',
-                //     query: {
-                //       categoryLevelId: this.form.categoryLevelId
-                //     }
-                //   });
-                // }
-              })
-              .catch((e) => {
-                this.loading = false;
-              });
-  =======
-  >>>>>>> 778152e35a1d73386814551d9d6194caae9cf792
           });
           });
         }
         }
       },
       },
@@ -1192,8 +715,9 @@
       submit() {
       submit() {
         this.$refs.manageForm.validate(async (valid) => {
         this.$refs.manageForm.validate(async (valid) => {
           let productionValid = await this.$refs.productionRefs.getFormValid();
           let productionValid = await this.$refs.productionRefs.getFormValid();
+          let warehouseValid = await this.$refs.warehouseRefs.getFormValid();
 
 
-          if (!valid || !productionValid) {
+          if (!valid || !productionValid || !warehouseValid) {
             return false;
             return false;
           }
           }
 
 

+ 15 - 22
src/views/rulesManagement/earlyWarningRules/components/matter-add.vue

@@ -361,18 +361,7 @@
     },
     },
     methods: {
     methods: {
       handleInput(value) {
       handleInput(value) {
-        //表单输入框 只保留数字和小数点
-        // const filteredValue = value.replace(/[^0-9.]/g, '');
-        // let finalValue = '';
-        // const dotIndex = filteredValue.indexOf('.');
-        // if (dotIndex !== -1) {
-        //   finalValue = filteredValue.slice(0, dotIndex + 3);
-        // } else {
-        //   finalValue = filteredValue;
-        // }
-
-        // 只能输入数字
-        this.formData.alertCycleValue = value.replace(/[^0-9]/g, '');
+        this.formData.alertCycleValue = this.$handleInputPublic(value);
       },
       },
       handleInputByTable(value, index) {
       handleInputByTable(value, index) {
         // 表内限制输入框 只保留数字和小数点
         // 表内限制输入框 只保留数字和小数点
@@ -388,6 +377,7 @@
       },
       },
 
 
       handleAddInfo(row, index) {
       handleAddInfo(row, index) {
+        this.NumberOfPeople = '';
         this.formData.actionList[index].targetAddress = '';
         this.formData.actionList[index].targetAddress = '';
         this.formData.actionList[index].targetAddressName = '';
         this.formData.actionList[index].targetAddressName = '';
         this.$refs.selectPersonDialogRef.open(row, index);
         this.$refs.selectPersonDialogRef.open(row, index);
@@ -437,17 +427,14 @@
       },
       },
       async openDialog(row, type) {
       async openDialog(row, type) {
         this.isBindPlan = type;
         this.isBindPlan = type;
-        // await this.getAllData();
-        if (type != 'add') {
+        if (type == 'edit' || type == 'clone') {
           this.getRuleInfo(row.id, type);
           this.getRuleInfo(row.id, type);
-        } else {
-          this.$set(this.formData, 'enabled', 1);
-          this.$refs.contentConfigForm &&
-            this.$refs.contentConfigForm.resetFields();
         }
         }
-        if (type != 'edit') {
+        if (type == 'add') {
+          console.log('add');
           this.getOrderCode();
           this.getOrderCode();
         }
         }
+
         this.addMatterDialog = true;
         this.addMatterDialog = true;
       },
       },
 
 
@@ -482,10 +469,15 @@
       },
       },
 
 
       handleClose() {
       handleClose() {
-        this.formData = {};
+        this.NumberOfPeople = '';
+        this.formData = {
+          ruleCode: '',
+          ruleName: '',
+          ruleObjCode: '',
+          alertCycleUnit: ''
+        };
         this.formData.actionList = [];
         this.formData.actionList = [];
         this.addMatterDialog = false;
         this.addMatterDialog = false;
-        this.$emit('handleClose');
       },
       },
       addItem() {
       addItem() {
         if (this.formData.actionList) {
         if (this.formData.actionList) {
@@ -526,7 +518,8 @@
         }
         }
         this.$refs.contentConfigForm.validate(async (valid) => {
         this.$refs.contentConfigForm.validate(async (valid) => {
           if (valid) {
           if (valid) {
-            let request = this.isBindPlan == 'add' ? rulesSave : rulesUpdate;
+            let request = this.isBindPlan != 'add' ? rulesUpdate : rulesSave;
+
             let res = await request(form);
             let res = await request(form);
             if (res) {
             if (res) {
               this.$message.success('操作成功!');
               this.$message.success('操作成功!');

+ 15 - 9
src/views/rulesManagement/earlyWarningRules/components/matter-search.vue

@@ -9,12 +9,20 @@
     <el-row :gutter="24">
     <el-row :gutter="24">
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
         <el-form-item label="规则名称:">
         <el-form-item label="规则名称:">
-          <el-input clearable v-model.trim="where.name" placeholder="请输入" />
+          <el-input
+            clearable
+            v-model.trim="where.ruleName"
+            placeholder="请输入"
+          />
         </el-form-item>
         </el-form-item>
       </el-col>
       </el-col>
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
         <el-form-item label="规则编码:">
         <el-form-item label="规则编码:">
-          <el-input clearable v-model.trim="where.code" placeholder="请输入" />
+          <el-input
+            clearable
+            v-model.trim="where.ruleCode"
+            placeholder="请输入"
+          />
         </el-form-item>
         </el-form-item>
       </el-col>
       </el-col>
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
@@ -37,7 +45,7 @@
           <DictSelection
           <DictSelection
             dictName="规则状态"
             dictName="规则状态"
             clearable
             clearable
-            v-model.trim="where.status"
+            v-model.trim="where.enabled"
           >
           >
           </DictSelection>
           </DictSelection>
         </el-form-item>
         </el-form-item>
@@ -72,13 +80,11 @@
     data() {
     data() {
       // 默认表单数据
       // 默认表单数据
       const defaultWhere = {
       const defaultWhere = {
-        name: '',
-        code: '',
-        userName: '',
-        type: '',
-        status: '',
+        ruleCode: '',
+        ruleName: '',
         startTime: '',
         startTime: '',
-        endTime: ''
+        endTime: '',
+        enabled: ''
       };
       };
       return {
       return {
         // 表单数据
         // 表单数据

+ 6 - 2
src/views/rulesManagement/earlyWarningRules/details.vue

@@ -88,7 +88,7 @@
             />
             />
             <el-table-column
             <el-table-column
               align="center"
               align="center"
-              prop="alertLevel"
+              prop="alertLevelName"
               label="预警级别"
               label="预警级别"
               width="120"
               width="120"
             />
             />
@@ -182,7 +182,11 @@
               ele.actionTypeName = this.operationTypeData[key];
               ele.actionTypeName = this.operationTypeData[key];
             }
             }
           }
           }
-
+          for (const key in this.allAlertLevelData) {
+            if (key == ele.alertLevel) {
+              ele.alertLevelName = this.allAlertLevelData[key];
+            }
+          }
           this.templateData.forEach((item) => {
           this.templateData.forEach((item) => {
             if (item.code == ele.alertMessageTempateCode) {
             if (item.code == ele.alertMessageTempateCode) {
               ele.alertMessageTempateCodeName = item.name + '-' + item.code;
               ele.alertMessageTempateCodeName = item.name + '-' + item.code;

+ 1 - 1
vue.config.js

@@ -36,7 +36,7 @@ module.exports = {
       // 当我们的本地的请求 有/api的时候,就会代理我们的请求地址向另外一个服务器发出请求
       // 当我们的本地的请求 有/api的时候,就会代理我们的请求地址向另外一个服务器发出请求
       '/api': {
       '/api': {
         // target: 'http://192.168.1.125:18086',
         // target: 'http://192.168.1.125:18086',
-        target: 'http://192.168.1.158:18086',
+        target: 'http://192.168.1.251:18086',
         // target: 'http://192.168.1.176:18086',
         // target: 'http://192.168.1.176:18086',
 
 
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域