chencc 1 жил өмнө
parent
commit
297dcfa8db

+ 1 - 0
src/enum/dict.js

@@ -15,6 +15,7 @@ export default {
   运维计划状态: 'plan_status',
   紧急程度: 'urgent_type',
   计量单位: 'measuring_uint',
+  周期单位: 'periodic_unit',
   包装单位: 'packing_unit',
   体积单位: 'volume_unit',
   重量单位: 'weight_unit',

+ 1 - 15
src/views/material/BOMmanage/components/attribute.vue

@@ -262,21 +262,9 @@
             ></el-input>
           </el-form-item>
         </el-col>
-
-        <el-col :span="8" label-width="100px">
-         
-          <el-form-item label="来源版本号" prop="name">
-            <!-- {{ attributeData }} -->
-            <el-input
-              placeholder=""
-              disabled
-              v-model="attributeData.resourceBomVersion"
-            ></el-input>
-          </el-form-item>
-        </el-col>
       </el-row>
  
-      
+
       <div class="btn_box" v-if="attributeData.status != 1">
         <el-button type="primary" @click="handleUpdate">保存</el-button>
       </div>
@@ -391,8 +379,6 @@
     watch: {
       attributeData(val) {
         console.log(Object.prototype.hasOwnProperty.call(val, 'category'));
-        console.log(val,'111111111111');
-
         if (Object.prototype.hasOwnProperty.call(val, 'category')) {
           this.category = val.category;
           this.attributeData.produceType = val.category.produceType;

+ 1 - 1
src/views/material/BOMmanage/components/baseInfo.vue

@@ -57,7 +57,7 @@
           <el-button
             type="text"
             @click="handleEdit"
-            v-if="dataInfo.approvalStatus != 1&&dataInfo.approvalStatus != 2"
+            v-if="dataInfo.approvalStatus != 1"
           >
             编辑</el-button
           >

+ 8 - 19
src/views/material/BOMmanage/detailsPop.vue

@@ -179,6 +179,7 @@
           >
         </div>
       </div>
+
       <!-- 抽屉内容 -->
       <div class="drawer_content">
         <ele-split-layout
@@ -233,9 +234,8 @@
           </div>
 
           <template v-slot:content v-if="isNotData">
-            <!-- 表头工具栏 -->
             <baseInfo :dataInfo="currentNodeData" />
-            
+
             <el-tabs
               v-model="activeName"
               class="tab-box"
@@ -243,7 +243,7 @@
               @tab-click="handleClick"
             >
               <el-tab-pane label="属性" name="属性">
-                
+             
                 <attribute :attributeData="currentNodeData"></attribute>
               </el-tab-pane>
 
@@ -520,27 +520,16 @@
       },
 
       handleNodeClick(data) {
-        console.log(data, 'data');
-        //是子级才替换
-       
-        if(data.parentId!=="0"){
-          this.handBomDetails(data.resourceBomId||data.id,1);
-        }else{
-          this.handBomDetails(data.id,2);
-          this.treeId = data.id;
-        }
-
-        
+        this.treeId = data.id;
+        this.handBomDetails(data.id);
       },
 
-      // 获取bom信息
-      handBomDetails(id,type) {
+      handBomDetails(id) {
         if (id) {
           getBomGetById(id).then((res) => {
             this.currentNodeData = res.data;
-            if(type==2){
-              this.searchObj.versions = this.currentNodeData.versions;
-            }
+         
+            this.searchObj.versions = this.currentNodeData.versions;
             this.$forceUpdate();
           });
         } else {

+ 8 - 34
src/views/material/product/components/PurchasingInfo.vue

@@ -15,23 +15,16 @@
               v-model="form.purchasingCycle"
               placeholder="请输入"
               :min="0"
-              :precision="1"
               :controls="false"
               style="width: calc(100% - 100px)"
             />
-            <el-select
+            <DictSelection
+              dictName="周期单位"
+              clearable
               v-model="form.purchasingCycleUnit"
-              placeholder="请选择"
               style="width: 100px"
             >
-              <el-option
-                v-for="item in CycleUnitoptions"
-                :key="item.value"
-                :label="item.label"
-                :value="item.value"
-              >
-              </el-option>
-            </el-select>
+            </DictSelection>
           </el-form-item>
         </el-col>
         <el-col :span="8">
@@ -41,7 +34,6 @@
               v-model="form.purchaseMultiplier"
               placeholder="请输入"
               :min="0"
-              :precision="2"
               :controls="false"
             />
           </el-form-item>
@@ -49,21 +41,17 @@
         <el-col :span="8">
           <el-form-item label="最低订购量" prop="minimumOrderQuantity">
             <el-input-number
-              style="width: 100%"
               v-model="form.minimumOrderQuantity"
               placeholder="请输入"
               :min="0"
-              :precision="2"
               :controls="false"
+              style="width: calc(100% - 100px)"
             />
-          </el-form-item>
-        </el-col>
-        <el-col :span="8">
-          <el-form-item label="计量单位" prop="purchasingCycle">
             <DictSelection
               dictName="计量单位"
               clearable
               v-model="form.measuringUnit"
+              style="width: 100px"
             >
             </DictSelection>
           </el-form-item>
@@ -102,25 +90,11 @@
     },
     components: { deptSelect, personSelect },
     data() {
-      return {
-        CycleUnitoptions: [
-          {
-            value: '年',
-            label: '年'
-          },
-          {
-            value: '月',
-            label: '月'
-          },
-          {
-            value: '日',
-            label: '日'
-          }
-        ]
-      };
+      return {};
     },
     watch: {
       form(data) {
+        console.log(data, 'data');
         if (data.checkDepart) {
           const params = { executeGroupId: data.checkDepart };
           this.$nextTick(() => {

+ 70 - 1
src/views/material/product/detail.vue

@@ -389,7 +389,76 @@ export default {
 
           this.dictList = [];
 
-          this.fileList = [];
+            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.getFieldModel();
+
+      // if (this.$route.query.id) {
+      //   this._getDetails();
+      // }
+      this.getDictList('productionType');
+    },
+    methods: {
+      changeUnit() {
+        if (this.form.measuringUnit) {
+          this.categoryPurchase.measuringUnit = this.form.measuringUnit;
+          if (this.form.packingUnit) {
+            this.$refs.warehouseRefs.defaultBuild(this.form.packingUnit);
+          }
         }
       },
       deep: true,

+ 57 - 26
src/views/rulesManagement/earlyWarningRules/components/matter-add.vue

@@ -78,6 +78,16 @@
               </el-col>
             </el-form-item>
           </el-col>
+          <!-- 阈值 -->
+          <el-col :span="8">
+            <el-form-item label="阈值" prop="thresholdValue">
+              <el-input
+                v-model="formData.thresholdValue"
+                placeholder="请输入"
+                size="small"
+              ></el-input>
+            </el-form-item>
+          </el-col>
           <el-col :span="8">
             <el-form-item label="状态" prop="enabled">
               <el-select
@@ -185,19 +195,27 @@
             width="240"
           >
             <template slot-scope="scope">
-              <el-select
-                placeholder="请选择"
-                v-model="scope.row.alertMessageTempateCode"
-                @change="changeTemplate(scope.row, scope.$index)"
+              <el-form-item
+                :prop="
+                  'actionList.' + scope.$index + '.alertMessageTempateCode'
+                "
+                label-width="0"
+                :rules="contentConfigFormRules.alertMessageTempateCode"
               >
-                <el-option
-                  v-for="item in templateData"
-                  :key="item.code"
-                  :label="item.name + '-' + item.code"
-                  :value="item.code"
+                <el-select
+                  placeholder="请选择"
+                  v-model="scope.row.alertMessageTempateCode"
+                  @change="changeTemplate(scope.row, scope.$index)"
                 >
-                </el-option>
-              </el-select>
+                  <el-option
+                    v-for="item in templateData"
+                    :key="item.code"
+                    :label="item.name + '-' + item.code"
+                    :value="item.code"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
             </template>
           </el-table-column>
           <el-table-column prop="content" label="内容" width="240">
@@ -270,8 +288,9 @@
           ruleCode: '',
           ruleName: '',
           ruleObjCode: '',
-          alertCycleValue: '',
+          alertCycleValue: '1',
           alertCycleUnit: '',
+          thresholdValue: '',
           enabled: 1,
           actionList: [
             {
@@ -285,6 +304,19 @@
           ]
         },
         contentConfigFormRules: {
+          ruleCode: [
+            { required: true, message: '请输入规则编码', trigger: 'blur' }
+          ],
+          ruleName: [
+            { required: true, message: '请输入规则名称', trigger: 'blur' }
+          ],
+          ruleObjCode: [
+            { required: true, message: '请选择预警对象', trigger: 'blur' }
+          ],
+          alertCycleValue: [
+            { required: true, message: '请输入周期', trigger: 'blur' }
+          ],
+
           targetAddressName: [
             { required: true, message: '请选择通知人', trigger: 'blur' }
           ],
@@ -454,22 +486,21 @@
       dataKeep() {
         let form = deepClone(this.formData);
         console.log(form, 'form');
-        if (form.actionList && form.actionList.length > 0) {
-          this.$refs.contentConfigForm.validate(async (valid) => {
-            if (valid) {
-              let res = await saveOrUpdate(form);
-              if (res) {
-                this.$message.success('操作成功!');
-                this.handleClose();
-                this.$emit('done');
-              }
-            } else {
-              this.$message.warning('请将信息补充完整!');
-            }
-          });
-        } else {
+        if (form.actionList.length < 1) {
           this.$message.error('请添加事项内容!');
         }
+        this.$refs.contentConfigForm.validate(async (valid) => {
+          if (valid) {
+            let res = await saveOrUpdate(form);
+            if (res) {
+              this.$message.success('操作成功!');
+              this.handleClose();
+              this.$emit('done');
+            }
+          } else {
+            this.$message.warning('请将信息补充完整!');
+          }
+        });
       }
     }
   };

+ 8 - 4
vue.config.js

@@ -1,7 +1,11 @@
 const CompressionWebpackPlugin = require('compression-webpack-plugin');
-const { transformElementScss } = require('ele-admin/lib/utils/dynamic-theme');
+const {
+  transformElementScss
+} = require('ele-admin/lib/utils/dynamic-theme');
 const path = require('path');
-const { name } = require('./package.json');
+const {
+  name
+} = require('./package.json');
 
 function resolve(dir) {
   return path.join(__dirname, dir);
@@ -31,8 +35,8 @@ module.exports = {
     proxy: {
       // 当我们的本地的请求 有/api的时候,就会代理我们的请求地址向另外一个服务器发出请求
       '/api': {
-        target: 'http://192.168.1.125:18086',
-        // target: 'http://192.168.1.251:18086',
+        // target: 'http://192.168.1.125:18086',
+        target: 'http://192.168.1.158:18086',
         // target: 'http://192.168.1.176:18086',
 
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域