Sfoglia il codice sorgente

产品物品管理新增采购信息

yijing 1 anno fa
parent
commit
d923fc0a35

+ 85 - 0
src/views/material/product/components/PurchasingInfo.vue

@@ -0,0 +1,85 @@
+<template>
+  <div class="other">
+    <el-form label-width="120px" 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="purchasingCycle">
+            <el-input v-model="form.purchasingCycle" placeholder="请输入" />
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="倍数" prop="purchaseMultiplier">
+            <el-input v-model="form.purchaseMultiplier" placeholder="请输入" />
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="最低订购量" prop="minimumOrderQuantity">
+            <el-input
+              v-model="form.minimumOrderQuantity"
+              placeholder="请输入"
+            />
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+  </div>
+</template>
+
+<script>
+  export default {
+    props: {
+      form: {
+        type: Object,
+        default: {}
+      }
+    },
+    components: {},
+    data() {
+      return {};
+    },
+
+    methods: {}
+  };
+</script>
+
+<style lang="scss" scoped>
+  .other {
+    background: #fff;
+    padding: 1px 17px;
+  }
+  .divider {
+    margin: 0px 0 20px;
+    .title {
+      display: flex;
+      align-items: center;
+      margin-bottom: 10px;
+      div {
+        width: 8px;
+        height: 20px;
+        margin-right: 10px;
+      }
+      span {
+        font-size: 20px;
+      }
+    }
+    .ele-width {
+      width: 100%;
+      height: 2px;
+    }
+  }
+  .form-line {
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    .line-select {
+      margin-left: 15px;
+    }
+  }
+</style>

+ 15 - 4
src/views/material/product/detail.vue

@@ -218,7 +218,7 @@
       v-if="codeShow"
       @close="codeShow = false"
       @chooseCode="chooseCode"
-    ></CodeDialog>
+    />
     <!-- 分类选择弹窗 -->
     <CategoryDialog ref="categoryRefs" @chooseCategory="confirmCategory" />
     <!-- 仓储配置 -->
@@ -230,6 +230,8 @@
       :packageDispositionVOList="packageDispositionVOList"
       @change="changePackagingSpecification"
     />
+    <!-- 采购信息 -->
+    <PurchasingInfo ref="PurchasingInfoRefs" :form="categoryPurchase" />
     <!-- 生产信息 -->
     <ProductionInfo ref="productionRefs" :form="categoryMes" />
     <!-- 计划 -->
@@ -255,6 +257,7 @@
 </template>
 
 <script>
+  import PurchasingInfo from './components/PurchasingInfo.vue';
   import GroupDialog from './components/GroupDialog.vue';
   import CodeDialog from './components/codeDialog.vue';
   import CategoryDialog from './components/CategoryDialog.vue';
@@ -282,6 +285,7 @@
   export default {
     name: 'product',
     components: {
+      PurchasingInfo,
       linkMsg,
       GroupDialog,
       deptSelect,
@@ -335,6 +339,7 @@
         remarkform: {
           remarkAttach: []
         },
+        categoryPurchase: {},
         categoryAps: {},
         categoryMes: {},
         categoryMold: {},
@@ -403,7 +408,7 @@
               packingUnit: '',
               extField: {}
             };
-
+            this.purchaseInfo = {};
             this.remarkform = {
               remarkAttach: []
             };
@@ -536,6 +541,11 @@
         } else {
           this.categoryPallet = info.categoryPallet;
         }
+        if (typeof info.categoryPurchase == 'string') {
+          this.categoryPurchase = {};
+        } else {
+          this.categoryPurchase = info.categoryPurchase;
+        }
         if (typeof info.categoryQms == 'string') {
           this.categoryQms = {};
         } else {
@@ -574,7 +584,6 @@
 
       // 确定分类
       async confirmCategory(node, title, PathInfo, ruleCode) {
-    
         if (this.status != 0) {
           this.$set(this.form, 'code', null);
         }
@@ -735,6 +744,7 @@
           //   : '';
 
           const data = {
+            categoryPurchase: this.categoryPurchase,
             categoryWms: this.categoryWms,
             categoryAps: this.categoryAps,
             categoryMes: this.categoryMes,
@@ -751,6 +761,7 @@
           };
 
           if (this.$route.query.status == 1) {
+            data.categoryPurchase.id = null;
             data.category.id = null;
             data.categoryWms.id = null;
             data.categoryAps.id = null;
@@ -768,7 +779,7 @@
               }
             );
           }
-          console.log('保存', this.$route.query.rootTreeId);
+          console.log('保存', data);
           addMaterial(data)
             .then((msg) => {
               this.loading = false;

+ 2 - 7
src/views/material/product/index.vue

@@ -75,7 +75,7 @@
             </div>
 
             <IndexSearch ref="searchRef" @search="reload" />
-          
+
             <IndexData
               ref="listData"
               v-if="current"
@@ -102,8 +102,6 @@
 
   import { getInfoById } from '@/api/classifyManage';
 
-
-
   export default {
     components: {
       IndexData,
@@ -225,9 +223,8 @@
       },
 
       async handleNodeClick(data, node) {
-
         this.$route.query.categoryLevelId = '';
-        if(this.$refs.searchRef) {
+        if (this.$refs.searchRef) {
           this.$refs.searchRef.resetAllSearch();
         }
 
@@ -235,8 +232,6 @@
         await this.publicfun(data);
         console.log(data, '点击物品分类');
         await this.getDetail(data.id);
-
-    
       },
       publicfun(data) {
         this.pathList = this.findParent([], data, this.treeList);