ysy 2 tahun lalu
induk
melakukan
d8bfd79c1f

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

@@ -109,7 +109,13 @@
           </el-col>
 
           <el-col :span="8">
-            <el-form-item label="净重">
+            <el-form-item label="净重" v-if="form.isConsumable == 1" :key="1">
+              <div class="form-line">
+                <el-input v-model="form.netWeight" />
+              </div>
+            </el-form-item>
+
+            <el-form-item label="净重" prop="netWeight" v-if="form.isConsumable == 0" :key="0">
               <div class="form-line">
                 <el-input v-model="form.netWeight" />
               </div>
@@ -240,6 +246,10 @@ export default {
 
         packingUnit: [
         { required: true, message: '请选择包装单位', trigger: 'change' }
+        ],
+
+        netWeight: [
+        { required: true, message: '请输入净重', trigger: 'blur' }
         ]
       },
       PathInfo: {},

+ 83 - 38
src/views/workforceManagement/team/components/edit.vue

@@ -15,30 +15,51 @@
               <el-input clearable :maxlength="20" v-model="form.name" placeholder="请输入" />
             </el-form-item>
           </el-col>
+
+          <el-col :span="8" style="margin-bottom: 22px">
+            <el-form-item label="是否首工序:" prop="isFirst">
+              <el-radio-group v-model="form.isFirst">
+                <el-radio-button :label="1">是</el-radio-button>
+                <el-radio-button :label="0">否</el-radio-button>
+              </el-radio-group>
+            </el-form-item>
+          </el-col>
+
+
+
+          <el-col :span="8" style="margin-bottom: 22px">
+            <el-form-item label="所属厂房:" prop="workshopPlanId">
+              <el-select v-model="form.workshopPlanId" @change="change_factoryId" filterable placeholder="请选择">
+                <el-option v-for="item in factoryList" :key="item.id" :label="item.pathName" :value="item.id">
+                </el-option>
+
+              </el-select>
+            </el-form-item>
+          </el-col>
+
+
+
           <el-col :span="8">
-           
             <el-form-item label="车间:" prop="workshopId" style="margin-bottom: 22px">
-              <el-select v-model="form.workshopId" @change="change_workshopId" multiple placeholder="请选择"
-                style="width: 100%">
+              <el-select v-model="form.workshopId" @change="change_workshopId" multiple placeholder="请选择">
                 <el-option v-for="item in options.workshopId" :key="item.value" :label="item.label" :value="item.value">
                 </el-option>
               </el-select>
             </el-form-item>
           </el-col>
-          <el-col :span="8">
+          <el-col :span="8" style="margin-bottom: 22px">
             <el-form-item label="产线:" prop="productionLineId">
-              <el-select v-model="form.productionLineId"  multiple placeholder="请选择"
-                style="width: 100%">
+              <el-select v-model="form.productionLineId" multiple placeholder="请选择">
                 <el-option v-for="item in options.productionLineId" :key="item.value" :label="item.label"
                   :value="item.value">
                 </el-option>
               </el-select>
             </el-form-item>
           </el-col>
-          <el-col :span="8"  style="margin-bottom: 22px">
+          <el-col :span="8" style="margin-bottom: 22px">
             <el-form-item label="工作中心:" prop="workCenterIds">
               <div class="location-warp">
-                <el-select v-model="form.workCenterIds" multiple filterable placeholder="请选择" style="width: 100%">
+                <el-select v-model="form.workCenterIds" multiple filterable placeholder="请选择">
                   <el-option v-for="item in options.workCenterIds" :key="item.value" :label="item.label"
                     :value="item.value">
                   </el-option>
@@ -47,30 +68,27 @@
             </el-form-item>
           </el-col>
 
-         
-      
 
-          <el-col :span="8"  style="margin-bottom: 22px">
-            <el-form-item label="是否首工序:" prop="isFirst">
-              <el-radio-group v-model="form.isFirst">
-              <el-radio-button :label="1" >是</el-radio-button>
-              <el-radio-button :label="0" >否</el-radio-button>
-            </el-radio-group>
-              </el-form-item>
-          </el-col>
 
 
-          <el-col :span="8"  style="margin-bottom: 22px" >
+
+
+          <el-col :span="8" style="margin-bottom: 22px">
             <el-form-item label="生产版本:" prop="produceVersionId">
-            <el-select v-model="form.produceVersionId" filterable placeholder="请选择" :style="{ width: '100%' }">
-              <el-option v-for="item in versionList" :key="item.id" :label="item.code + '-' + item.name" :value="item.id" @click.native="form.produceVersionName = item.name">
-              </el-option>
-            </el-select>
-          </el-form-item>
+              <el-select v-model="form.produceVersionId" filterable placeholder="请选择">
+                <el-option v-for="item in versionList" :key="item.id" :label="item.code + '-' + item.name"
+                  :value="item.id" @click.native="form.produceVersionName = item.name">
+                </el-option>
+              </el-select>
+            </el-form-item>
           </el-col>
 
 
-        
+
+
+
+
+
         </el-row>
       </el-card>
       <el-card shadow="never" header="员工配置" body-style="padding: 22px 22px 0 22px;">
@@ -96,6 +114,7 @@ import {
 import { pageList } from '@/api/technology/version/version.js';
 import work from '@/api/technology/work';
 import userTable from './userTable.vue';
+import { getFactoryarea } from '@/api/factoryModel';
 export default {
   components: {
     userTable
@@ -103,12 +122,12 @@ export default {
   data() {
 
     var checkVersion = (rule, value, callback) => {
-        if (this.form.isFirst == 1 && this.form.produceVersionId == '') {
-          callback(new Error('请选择生产版本'));
-        }else {
-          callback();
-        }
-      };
+      if (this.form.isFirst == 1 && this.form.produceVersionId == '') {
+        callback(new Error('请选择生产版本'));
+      } else {
+        callback();
+      }
+    };
 
 
     const defaultForm = function () {
@@ -120,6 +139,7 @@ export default {
         productionLineId: [],
         userIds: '',
         userNumber: '',
+        workshopPlanId: null,
         workCenterIds: [],
         workshopId: [],
         isFirst: 0,
@@ -134,13 +154,16 @@ export default {
       rules: {
         code: [{ required: true, message: '请输入', trigger: 'blur' }],
         name: [{ required: true, message: '请输入', trigger: 'blur' }],
+        workshopPlanId: [
+          { required: true, message: '请选择', trigger: 'change' }
+        ],
         workshopId: [{ required: true, message: '请输入', trigger: 'change' }],
         productionLineId: [
           { required: true, message: '请输入', trigger: 'change' }
         ],
         produceVersionId: [
-        { validator: checkVersion, trigger: 'blur' }
-     
+          { validator: checkVersion, trigger: 'blur' }
+
         ]
       },
       visible: false,
@@ -153,6 +176,7 @@ export default {
       },
 
       versionList: [],
+      factoryList: []
     };
   },
   computed: {
@@ -170,7 +194,7 @@ export default {
     }
   },
   created() {
-    this.getlistWorkshopByParentId();
+    this.getFactoryarea()
   },
   methods: {
     async open(type, row) {
@@ -197,7 +221,7 @@ export default {
         // 获取下拉列表
         await this.getlistWorkshopByParentId();
         await this.getlistFactoryLineByParentId();
-       
+
       }
       this.getVersionList()
       this.getlistByProductionLineId();
@@ -250,10 +274,22 @@ export default {
       this.visible = false;
       this.loading = false;
     },
+
+    // 获取厂房
+    getFactoryarea() {
+      let par = {
+        type: 2,
+        size: 9999
+      };
+      getFactoryarea(par).then((res) => {
+        this.factoryList = res.list;
+      });
+    },
+
+
     // 获取车间
     getlistWorkshopByParentId() {
-      let par = this.$store.state.user.info.factoryId;
-      return listWorkshopByParentId(par).then((res) => {
+      return listWorkshopByParentId(this.form.workshopPlanId).then((res) => {
         this.options.workshopId = res.map((n) => {
           return {
             value: n.id,
@@ -275,7 +311,7 @@ export default {
     },
     // 获取工位
     getlistByProductionLineId() {
-      return work.list({pageNum: 1,  size: -1}).then((res) => {
+      return work.list({ pageNum: 1, size: -1 }).then((res) => {
         this.options.workCenterIds = res.list.map((n) => {
           return {
             value: n.id,
@@ -284,6 +320,15 @@ export default {
         });
       });
     },
+
+    change_factoryId() {
+      this.form.workshopId = ''
+      this.options.workshopId = []
+      this.form.productionLineId = '';
+      this.options.productionLineId = [];
+
+      this.getlistWorkshopByParentId()
+    },
     // 选择车间
     change_workshopId() {
       this.form.productionLineId = '';

+ 6 - 0
src/views/workforceManagement/team/index.vue

@@ -91,6 +91,12 @@
             label: '名称',
             prop: 'name'
           },
+
+          {
+            label: '所属工厂-厂房',
+            prop: 'workshopPlanName'
+          },
+
           {
             label: '所属产线',
             prop: 'productionLineName'