chencc vor 1 Jahr
Ursprung
Commit
8d83b6cdc6

+ 9 - 0
src/api/codeManagement/index.js

@@ -38,6 +38,15 @@ export async function getCodeDetail (id) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+export async function checkExist (params) {
+  const res = await request.get(`/main/category/checkExist` , {params});
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
 // 生成编码
 export async function getCode (code) {
   const res = await request.get(`/main/codemanage/getCode/` + code, {});

+ 1 - 0
src/views/factoryModel/plant/components/edit.vue

@@ -99,6 +99,7 @@
           <el-form-item label="负责人:" prop="leaderId">
             <el-select
               v-model="form.leaderId"
+              filterable 
               placeholder="请选择"
               @change="change_principal"
               style="width: 100%"

+ 3 - 3
src/views/factoryModel/station/components/ProduceDialog.vue

@@ -131,9 +131,9 @@ export default {
       this.visible = false;
     },
     confirm() {
-
-      if (!this.current) {
-        return this.$message.warning('请选择工作中心')
+      
+      if (!this.current.id||!this.current.name) {
+        return this.$message.warning('请选择工')
       }
       this.$emit('changeProduct', this.current)
       this.cancel()

+ 4 - 2
src/views/factoryModel/workshop/components/edit.vue

@@ -299,10 +299,11 @@
         this.factoryList = list || [];
       },
 
-      change_factoryId() {
+      change_factoryId(e) {
+
         this.form.workshopPlanId = '';
         this.workshopPlanList = [];
-
+        this.form.parentId = '';
         this.getlistCf();
 
       },
@@ -315,6 +316,7 @@
           size: 9999
         };
         getFactoryarea(par).then((res) => {
+          
           this.workshopPlanList = res.list;
         });
       },

+ 20 - 50
src/views/factoryModel/workshop/index.vue

@@ -1,29 +1,12 @@
 <template>
   <div class="ele-body">
     <el-card shadow="never">
-      <search
-        ref="search"
-        @search="search"
-        :options_groupId="dict.groupId"
-        :options_factory="dict.factory"
-      ></search>
-      <ele-pro-table
-        ref="table"
-        :columns="columns"
-        :datasource="datasource"
-        :page-size="pageSize"
-        @columns-change="handleColumnChange"
-        :cache-key="cacheKeyUrl"
-      >
+      <search ref="search" @search="search" :options_groupId="dict.groupId" :options_factory="dict.factory"></search>
+      <ele-pro-table ref="table" :columns="columns" :datasource="datasource" :page-size="pageSize"
+        @columns-change="handleColumnChange" :cache-key="cacheKeyUrl">
         <!-- 表头工具栏 -->
         <template v-slot:toolbar>
-          <el-button
-            size="small"
-            type="primary"
-            icon="el-icon-plus"
-            class="ele-btn-icon"
-            @click="openEdit('add')"
-          >
+          <el-button size="small" type="primary" icon="el-icon-plus" class="ele-btn-icon" @click="openEdit('add')">
             添加
           </el-button>
         </template>
@@ -33,19 +16,10 @@
 
         <!-- 操作列 -->
         <template v-slot:action="{ row }">
-          <el-link
-            type="primary"
-            :underline="false"
-            icon="el-icon-edit"
-            @click="openEdit('edit', row)"
-          >
+          <el-link type="primary" :underline="false" icon="el-icon-edit" @click="openEdit('edit', row)">
             修改
           </el-link>
-          <el-popconfirm
-            class="ele-action"
-            title="确定要删除此角色吗?"
-            @confirm="remove(row)"
-          >
+          <el-popconfirm class="ele-action" title="确定要删除此角色吗?" @confirm="remove(row)">
             <template v-slot:reference>
               <el-link type="danger" :underline="false" icon="el-icon-delete">
                 删除
@@ -55,11 +29,7 @@
         </template>
       </ele-pro-table>
     </el-card>
-    <edit
-      ref="edit"
-      @done="done"
-      :options_groupId="dict.groupId"
-    ></edit>
+    <edit ref="edit" @done="done" :options_groupId="dict.groupId"></edit>
   </div>
 </template>
 <script>
@@ -74,7 +44,7 @@ export default {
     search,
     edit
   },
-    data () {
+  data() {
     return {
       columns: [
         {
@@ -98,7 +68,7 @@ export default {
         },
         {
           label: '所属工厂',
-            prop: 'factoryName',
+          prop: 'factoryName',
 
         },
         {
@@ -108,7 +78,7 @@ export default {
         },
         {
           label: '所属区域',
-            prop: 'areaName',
+          prop: 'areaName',
         },
         {
           label: '详细地址',
@@ -132,12 +102,12 @@ export default {
       cacheKeyUrl: '8fc13138-factoryModel-workshop'
     };
   },
-    created () {
+  created() {
     this.getGs();
     this.getFactoryarea();
   },
   methods: {
-      datasource ({ page, where, limit }) {
+    datasource({ page, where, limit }) {
       return getFactoryarea({
         ...where,
         pageNum: page,
@@ -145,24 +115,24 @@ export default {
         type: 3
       });
     },
-      search (where) {
+    search(where) {
       this.$refs.table.reload({
         where: where,
         page: 1
       });
     },
-      openEdit (type, row) {
+    openEdit(type, row) {
       this.$refs.edit.open(type, row);
     },
     // 获取公司数据
-      getGs () {
+    getGs() {
       listOrganizations().then((list) => {
         console.log(list);
         this.dict.groupId = list;
       });
     },
     // 回显公司名称
-      showgroupName (id) {
+    showgroupName(id) {
       let result = this.dict.groupId.find((n) => n.id == id);
       if (result) {
         return result.name;
@@ -172,17 +142,17 @@ export default {
     },
 
     // 获取工厂数据
-      getFactoryarea () {
+    getFactoryarea() {
       let par = {
         type: 1,
-          size: 9999,
+        size: 9999,
 
       };
       getFactoryarea(par).then((res) => {
         this.dict.factory = res.list;
       });
     },
-      remove (row) {
+    remove(row) {
       deletefactoryarea(row.id)
         .then((message) => {
           this.$message.success(message);
@@ -192,7 +162,7 @@ export default {
           this.$message.error(e.message);
         });
     },
-      done () {
+    done() {
       this.$refs.search.search();
     }
   }

+ 160 - 151
src/views/material/BOMmanage/components/routing.vue

@@ -2,25 +2,12 @@
   <div class="ele-body">
     <el-card shadow="never">
       <!-- 数据表格 -->
-  
-      <ele-pro-table
-        ref="table"
-        :columns="columns"
-        :datasource="datasource"
-        :selection.sync="selection"
-        row-key="id"
-      >
+
+      <ele-pro-table ref="table" :columns="columns" :datasource="datasource" :selection.sync="selection" row-key="id">
         <!-- 表头工具栏 -->
         <template v-slot:toolbar>
-          <el-button
-           v-if="attributeData.status != 1"
-            size="small"
-            type="primary"
-            icon="el-icon-plus"
-            class="ele-btn-icon"
-            @click="add"
-            >新增</el-button
-          >
+          <el-button v-if="attributeData.status != 1" size="small" type="primary" icon="el-icon-plus"
+            class="ele-btn-icon" @click="add">新增</el-button>
         </template>
         <!-- 状态列 -->
         <template v-slot:status="{ row }">
@@ -28,11 +15,11 @@
         </template>
 
         <template v-slot:routeType="{ row }">
-         {{ row.routeType == 2 ? '委外' :  row.routeType == 1 ? '生产' :   row.routeType == 3 ? '质检' : ''}} 
+          {{ row.routeType == 2 ? '委外' : row.routeType == 1 ? '生产' : row.routeType == 3 ? '质检' : '' }}
         </template>
 
         <template v-slot:action="{ row, $index }">
-          <el-link type="danger" @click="handleDel(row)"  v-if="attributeData.status != 1">删除</el-link>
+          <el-link type="danger" @click="handleDel(row)" v-if="attributeData.status != 1">删除</el-link>
         </template>
       </ele-pro-table>
     </el-card>
@@ -41,163 +28,185 @@
 </template>
 
 <script>
-  import { getMbomPage } from '@/api/material/BOM';
-  import routingDialog from './routingDialog.vue';
-
-  import { workingProcedureUpdate } from '@/api/material/BOM';
-  export default {
-    name: 'technologyRoute',
-    components: {
-      routingDialog
-    },
-    props: {
-      taskParam: Object,
+import { getMbomPage } from '@/api/material/BOM';
+import routingDialog from './routingDialog.vue';
+import route from '@/api/technology/route';
 
-      attributeData: {
-        type: Object,
-        default: {}
-      },
+import { workingProcedureUpdate } from '@/api/material/BOM';
+export default {
+  name: 'technologyRoute',
+  components: {
+    routingDialog
+  },
+  props: {
+    taskParam: Object,
 
+    attributeData: {
+      type: Object,
+      default: {}
     },
-    watch: {
-      attributeData: {
-        handler(val) {
-         this.$nextTick(() => {
+
+  },
+  watch: {
+    attributeData: {
+      handler(val) {
+        this.$nextTick(() => {
           this.reload()
-         })
+        })
+      },
+      deep: true,
+      immediate: true
+    }
+  },
+  data() {
+    return {
+      tableData: [],
+      selection: [],
+      versionList: [],
+      where: {},
+      // 表格列配置
+      columns: [
+        {
+          prop: 'code',
+          label: '工艺路线组编码',
+          showOverflowTooltip: true,
+          align: 'center',
+          minWidth: 110,
+          slot: 'code'
+        },
+        {
+          prop: 'name',
+          label: '工艺路线名称',
+          showOverflowTooltip: true,
+          align: 'center',
+          minWidth: 110
+        },
+
+        {
+          prop: 'version',
+          label: '工艺路线版本',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+
+        {
+          prop: 'produceVersionName',
+          label: '生产版本',
+          align: 'center',
+          showOverflowTooltip: true
         },
-        deep: true,
-        immediate: true
+
+        {
+          prop: 'status',
+          label: '状态',
+          align: 'center',
+          slot: 'status',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+
+        {
+          slot: 'routeType',
+          label: '类型',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'action',
+          label: '操作',
+          align: 'center',
+          slot: 'action'
+        }
+      ],
+
+      // 表格选中数据
+      selection: [],
+      // 当前编辑数据
+      current: null,
+      // 是否显示编辑弹窗
+      showEdit: false,
+      detailEdit: false,
+
+      statusList: [
+        { label: '草稿', value: -1 },
+        { label: '失效', value: 0 },
+        { label: '生效', value: 1 }
+      ],
+      loading: false
+    };
+  },
+  methods: {
+    add() {
+
+      console.log(this.taskParam, this.tableData);
+
+      this.$refs.routingDialogRef.open(this.taskParam, this.tableData);
+    },
+    search(e) {
+
+
+      this.reload(this.where);
+    },
+    /* 表格数据源 */
+    async datasource({ page, limit, where }) {
+      let data = await getMbomPage({
+        ...where,
+        bomCategoryId: this.taskParam.id,
+        pageNum: page,
+        size: limit
+      });
+      if (data?.length > 0) {
+        this.tableData = data[0];
+        return data[0].processRoute.list || [];
+      } else {
+        this.tableData = {};
+        return [];
       }
     },
-    data() {
-      return {
-        tableData: [],
-        selection: [],
-        versionList: [],
-        where: {},
-        // 表格列配置
-        columns: [
-          {
-            prop: 'code',
-            label: '工艺路线组编码',
-            showOverflowTooltip: true,
-            align: 'center',
-            minWidth: 110,
-            slot: 'code'
-          },
-          {
-            prop: 'name',
-            label: '工艺路线名称',
-            showOverflowTooltip: true,
-            align: 'center',
-            minWidth: 110
-          },
 
-          {
-            prop: 'version',
-            label: '工艺路线版本',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
+    handleDel(row) {
 
-          {
-            prop: 'produceVersionName',
-            label: '生产版本',
-            align: 'center',
-            showOverflowTooltip: true
-          },
+      // route.getProcessById([row.id]).then((data) => {
 
-          {
-            prop: 'status',
-            label: '状态',
-            align: 'center',
-            slot: 'status',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
 
-          {
-            slot: 'routeType',
-            label: '类型',
-            align: 'center',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'action',
-            label: '操作',
-            align: 'center',
-            slot: 'action'
-          }
-        ],
-
-        // 表格选中数据
-        selection: [],
-        // 当前编辑数据
-        current: null,
-        // 是否显示编辑弹窗
-        showEdit: false,
-        detailEdit: false,
-
-        statusList: [
-          { label: '草稿', value: -1 },
-          { label: '失效', value: 0 },
-          { label: '生效', value: 1 }
-        ],
-        loading: false
-      };
-    },
-    methods: {
-      add() {
-    
-        this.$refs.routingDialogRef.open(this.taskParam, this.tableData);
-      },
-      search() {
-        this.reload(this.where);
-      },
-      /* 表格数据源 */
-      async datasource({ page, limit, where }) {
-        let data = await getMbomPage({
-          ...where,
-          bomCategoryId: this.taskParam.id,
-          pageNum: page,
-          size: limit
-        });
-        if (data?.length > 0) {
-          this.tableData = data[0];
-          return data[0].processRoute.list || [];
-        } else {
-          this.tableData = {};
-          return [];
-        }
-      },
+      // })
 
-      handleDel(row) {
 
+      // console.log(row,'41444444',this.tableData.processRoute.list);
+      // return
+      this.$confirm('是否删除?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
         workingProcedureUpdate({
           id: this.tableData.id,
           categoryId: this.taskParam.categoryId,
           bomCategoryId: this.taskParam.id,
           categoryCode: this.taskParam.categoryCode,
+          isRouting:1,
           processRoute: {
             list: this.tableData.processRoute.list.filter(
               (item) => item.id !== row.id
             )
-          }
+          },
         }).then((data) => {
           this.$message.success('删除成功');
           this.reload();
         });
-      },
-      checkStatus(row) {
-        let obj = this.statusList.find((it) => it.value == row.status);
-        return obj.label;
-      },
-      /* 刷新表格 */
-      reload(where) {
-        this.$refs.table.reload({ page: 1, where: where });
-      }
+      })
+      .catch(() => console.info("操作取消"));
+    },
+    checkStatus(row) {
+      let obj = this.statusList.find((it) => it.value == row.status);
+      return obj.label;
+    },
+    /* 刷新表格 */
+    reload(where) {
+
+      this.$refs.table.reload({ page: 1, where: where });
     }
-  };
+  }
+};
 </script>

+ 8 - 0
src/views/material/BOMmanage/components/routingDialog.vue

@@ -281,6 +281,7 @@
                 newArr.push(data[i]);
               }
             }
+          
             workingProcedureUpdate({
               id: this.tableData.id,
               categoryId: this.treeData.categoryId,
@@ -310,6 +311,13 @@
                 };
               })
             }).then(() => {
+              let taskParam = data.map((item) => {
+                return {
+                  ...item,
+                  versions: this.treeData.versions,
+                  status: this.treeData.status
+                };
+              })
               this.$emit('reload');
               this.visible = false;
             });

+ 20 - 2
src/views/material/BOMmanage/components/workingProcedure.vue

@@ -22,14 +22,32 @@
             </el-form-item>
           </el-col>
           <el-col :span="6" label-width="100px">
-            <el-form-item label="名称" prop="type">
+            <el-form-item label="工序名称" prop="type">
               <el-input
                 disabled
                 placeholder="工序名称"
-                v-model="rowData.controlName"
+                v-model="rowData.name"
+              ></el-input>
+            </el-form-item>
+          </el-col>
+          <!-- <el-col :span="6" label-width="100px">
+            <el-form-item label="名称" prop="type">
+              <el-input
+                disabled
+                placeholder="物品名称"
+                v-model="rowData.name"
               ></el-input>
             </el-form-item>
           </el-col>
+          <el-col :span="6" label-width="100px">
+            <el-form-item label="物品编码" prop="type">
+              <el-input
+                disabled
+                placeholder="工序名称"
+                v-model="rowData.name"
+              ></el-input>
+            </el-form-item>
+          </el-col> -->
         </el-row>
       </el-form>
 

+ 49 - 13
src/views/material/product/detail.vue

@@ -196,7 +196,7 @@
     <el-card shadow="never">
       <headerTitle title="标签"></headerTitle>
       <!-- {{ form.extTagField }} -->
-      <el-form label-width="100px"  >
+      <el-form label-width="100px">
         <el-form-item label="是否消耗品">
           <el-radio-group v-model="form.extTagField.isConsumables">
             <el-radio :label="1">是</el-radio>
@@ -259,8 +259,8 @@ import personSelect from '@/components/CommomSelect/person-select.vue';
 import linkMsg from './components/link-msg.vue';
 import { getDetails } from '@/api/classifyManage/itemInformation';
 import { getByCode } from '@/api/system/dictionary-data';
-import { getCode, rootCategoryCode, fieldModel } from '@/api/codeManagement';
-
+import { getCode, rootCategoryCode, fieldModel, checkExist } from '@/api/codeManagement';
+// /main/category/checkExist
 import { addMaterial } from '@/api/material/list.js';
 import { deepClone } from '@/utils/index';
 import { finishPageTab, reloadPageTab } from '@/utils/page-tab-util';
@@ -431,8 +431,8 @@ export default {
         produceType: [
           { required: true, message: '请选择生产类型', trigger: 'change' }
         ],
-        componentAttribute:[
-         { required: true, message: '请选择生产类型', trigger: 'change' }
+        componentAttribute: [
+          { required: true, message: '请选择生产类型', trigger: 'change' }
         ],
         attributeType: [
           { required: true, message: '请选择属性类型', trigger: 'change' }
@@ -767,9 +767,9 @@ export default {
       fieldModel({ relevance: 't_main_category' }).then((res) => {
         this.fileList = res;
 
-        if(!this.form.extTagField){
-          this.form.extTagField={
-            isConsumables:0
+        if (!this.form.extTagField) {
+          this.form.extTagField = {
+            isConsumables: 0
           }; // 初始化动态模型属性
 
         }
@@ -857,22 +857,59 @@ export default {
         });
       }
     },
+    verifyDuplicate(obj) {
+      return new Promise((resolve, reject) => {
+        checkExist(obj).then((res) => {
+          if (res) {
+            this.$confirm('系统已有相同的数据', '提示', {
+              confirmButtonText: '确定',
+              cancelButtonText: '取消',
+              type: 'warning'
+            }).then(() => {
+              resolve(true);
+            }).catch(() => {
+              resolve(false);
+            });
+          } else {
+            resolve(true);
+          }
+
+
+        });
+      })
+
+    },
+
 
     // 保存
     submit() {
 
-      
+
       this.$refs.manageForm.validate(async (valid) => {
 
+        if (!valid) return;
+
+        let req = {
+          name: this.form.name,
+          modelType: this.form.modelType,
+          specification: this.form.specification
+        }
+        if(! await this.verifyDuplicate(req)) return;
+        
+
+
+
 
-        let productionValid = await this.$refs.productionRefs.getFormValid();
-        let warehouseValid = await this.$refs.warehouseRefs.getFormValid();
 
 
+
+
+
+        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(
@@ -992,7 +1029,6 @@ export default {
             }
           );
         }
-        console.log('保存', data);
 
         data.category.produceType = [data.category.produceType];
 

+ 1 - 1
src/views/technology/production/components/user-edit.vue

@@ -107,7 +107,7 @@
         </el-col>
 
         <el-col :span="8">
-          <el-form-item label="节拍时间单位:" prop="workBeat.beatTimesUnit">
+          <el-form-item label="节拍时间单位:" >
             <el-select v-model="form.workBeat.beatTimesUnit">
               <el-option v-for="item in timeType2" :key="item.code" :label="item.label" :value="item.code">
               </el-option>

+ 10 - 4
src/views/technology/route/components/user-detail.vue

@@ -185,12 +185,14 @@ export default {
             return this.$store.state.theme.styleResponsive;
         }
     },
+    
     methods: {
-
+        
 
         /* 表格数据源 */
-        async datasource({ page, limit, where }) {
-
+        async datasource(id) {
+            console.log(111111);
+           
             if (this.data.id) {
                 const res = await route.taskinstanceList({
                     routingId: this.data.id,
@@ -216,6 +218,7 @@ export default {
         },
 
         async getVersionList() {
+            
             const res = await pageList({
                 pageNum: 1,
                 size: 100
@@ -238,14 +241,17 @@ export default {
         async visible(visible) {
 
             if (visible) {
-
+                
+                this.datasource();
                 this.getVersionList()
+
                 const res = await route.Flist({
                     pageNum: 1,
                     size: -1,
                     type: 1
                 });
                 this.fList = res.list;
+                
                 if (this.data) {
                     const res = await route.getById(this.data.id);
                     this.$util.assignObject(this.form, {

+ 4 - 2
src/views/technology/route/index.vue

@@ -72,7 +72,7 @@
     <!-- 历史版本弹框 -->
     <historyModal ref="historyRefs"></historyModal>
 
-    <UserDetail :visible.sync="detailEdit" :data="current" @close="detailEdit = false"></UserDetail>
+    <UserDetail :visible.sync="detailEdit" :data="current" @close="detailEdit = false" ref="userEdit"></UserDetail>
 
   </div>
 </template>
@@ -292,8 +292,10 @@ export default {
 
     openDetail(row) {
       this.current = row
-      this.detailEdit = true
+      // 
 
+      // this.$refs.userEdit.datasource(this.current.id);
+      this.detailEdit = true;
     },
 
   }