ysy пре 2 година
родитељ
комит
cbf5d6361c

+ 264 - 0
src/views/technology/route/components/user-detail.vue

@@ -0,0 +1,264 @@
+<!-- 用户编辑弹窗 -->
+<template>
+    <ele-modal width="1060px" :visible="visible" :append-to-body="true" :close-on-click-modal="true"
+        custom-class="ele-dialog-form" title="修改工艺详情" @update:visible="updateVisible">
+        <header-title title="基本信息"> </header-title>
+        <el-form ref="form" :model="form" :rules="rules" label-width="140px">
+            <el-row>
+                <el-col :span="8">
+                    <el-form-item label="工艺路线组编码:" prop="code">
+                        {{ form.code }}
+                    </el-form-item>
+                </el-col>
+
+                <el-col :span="8">
+                    <el-form-item label="工艺路线组名称:" prop="name">
+                        {{ form.name }}
+                    </el-form-item>
+                </el-col>
+                <el-col :span="8">
+                    <el-form-item label="所属工厂:" prop="factoryId">
+                        <el-select v-model="form.factoryId" placeholder="请选择" filterable disabled>
+                            <el-option v-for="item in fList" :key="item.id" :label="item.name" :value="item.id">
+                            </el-option>
+                        </el-select>
+                    </el-form-item>
+                </el-col>
+
+                <el-col :span="8">
+                    <el-form-item label="生产版本:" prop="produceVersionId">
+                        <el-select v-model="form.produceVersionId" filterable placeholder="请选择" :style="{ width: '100%' }"
+                            disabled>
+                            <el-option v-for="item in versionList" :key="item.code" :label="item.code + '-' + item.name"
+                                :value="item.id">
+                            </el-option>
+                        </el-select>
+                    </el-form-item>
+                </el-col>
+
+
+                <el-col :span="8">
+                    <el-form-item label="工艺路线版本:" prop="version">
+                        {{ form.version }}
+                    </el-form-item>
+                </el-col>
+                <el-col :span="8">
+                    <el-form-item label="状态:" prop="status">
+                        <el-select v-model="form.status" placeholder="" filterable disabled>
+                            <el-option v-for="item in statusList" :key="item.value" :label="item.label" :value="item.value">
+                            </el-option>
+                        </el-select>
+                    </el-form-item>
+                </el-col>
+
+
+            </el-row>
+
+        </el-form>
+
+        <ele-pro-table ref="table" :needPage="false" :columns="columns" :datasource="datasource" row-key="id">
+            <template v-slot:orderNum="{ row }">
+                {{ row.orderNum }}
+            </template>
+
+
+        </ele-pro-table>
+
+        <template v-slot:footer>
+            <el-button type="primary" @click="save">
+                确定
+            </el-button>
+
+
+        </template>
+
+
+
+
+
+
+    </ele-modal>
+</template>
+  
+<script>
+
+import route from '@/api/technology/route';
+import { pageList } from '@/api/technology/version/version.js';
+
+export default {
+    components: {
+
+    },
+    props: {
+        // 弹窗是否打开
+        visible: Boolean,
+        // 修改回显的数据
+        data: Object
+    },
+    data() {
+        const defaultForm = {
+            code: '',
+            name: '',
+            factoryId: '',
+            status: -1,
+            categoryId: '',
+            produceVersionId: '',
+            version: '1.0',
+            id: '',
+
+        };
+        return {
+            defaultForm,
+            fList: [], //仓库列表
+
+            // 表单数据
+            form: { ...defaultForm },
+
+            statusList: [
+                { label: '草稿', value: -1 },
+                { label: '失效', value: 0 },
+                { label: '生效', value: 1 }
+            ],
+
+            // 表单验证规则
+            rules: {
+
+
+            },
+            versionList: [],
+            // 提交状态
+            loading: false,
+            // 是否是修改
+            isUpdate: false,
+
+            columns: [
+
+                {
+                    prop: 'orderNum',
+                    label: '排序',
+                    align: 'center',
+                    slot: 'orderNum',
+                    minWidth: 120
+                },
+                {
+                    prop: 'code',
+                    label: '工序编码',
+                    // sortable: 'custom',
+                    showOverflowTooltip: true,
+                    align: 'center',
+                    minWidth: 110
+                },
+
+
+                {
+                    prop: 'name',
+                    label: '工序名称',
+                    showOverflowTooltip: true,
+                    align: 'center',
+                    minWidth: 110
+                },
+                {
+                    align: 'center',
+                    prop: 'controlName',
+                    label: '工序控制码',
+                    showOverflowTooltip: true,
+                    minWidth: 110
+                },
+                {
+                    prop: 'workCenterName',
+                    label: '所属工作中心',
+                    align: 'center',
+                    showOverflowTooltip: true,
+                    minWidth: 110
+                },
+
+
+            ],
+
+
+        };
+    },
+    computed: {
+
+        // 是否开启响应式布局
+        styleResponsive() {
+            return this.$store.state.theme.styleResponsive;
+        }
+    },
+    methods: {
+
+
+        /* 表格数据源 */
+        async datasource({ page, limit, where }) {
+
+            if (this.data.id) {
+                const res = await route.taskinstanceList({
+                    routingId: this.data.id,
+                    isDetail: true,
+                    pageNum: 1,
+                    size: -1
+                });
+
+                let arr = res.list.map((it) => {
+                    it.detail.orderNum = it.orderNum
+                    return it.detail
+                });
+                return {
+                    list: arr,
+                };
+            }
+        },
+
+
+        /* 保存编辑 */
+        save() { 
+            this.$emit('close')
+        },
+
+        async getVersionList() {
+            const res = await pageList({
+                pageNum: 1,
+                size: 100
+            });
+
+            this.versionList = res.list;
+        },
+
+
+        /* 更新visible */
+        updateVisible(value) {
+            this.$emit('update:visible', value);
+        },
+
+
+
+    },
+
+    watch: {
+        async visible(visible) {
+
+            if (visible) {
+
+                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, {
+                        ...res
+                    });
+
+                    this.isUpdate = true;
+                }
+            } else {
+                this.$refs.form.clearValidate();
+                this.form = { ...this.defaultForm };
+            }
+        }
+    }
+};
+</script>

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

@@ -209,6 +209,7 @@ export default {
     },
     },
 
 
     refresh() {
     refresh() {
+      this.save()
       this.updateVisible(false)
       this.updateVisible(false)
       this.$emit('done')
       this.$emit('done')
     },
     },

+ 0 - 1
src/views/technology/route/components/user-taskinstance.vue

@@ -245,7 +245,6 @@ export default {
         });
         });
         return {
         return {
           list:  arr,
           list:  arr,
-
         };
         };
       }
       }
     },
     },

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

@@ -14,6 +14,12 @@
             :loading="loading">刷新</el-button>
             :loading="loading">刷新</el-button>
         </template>
         </template>
 
 
+
+        <template v-slot:code="{ row }">
+          <el-link  type="primary" :underline="false" @click="openDetail(row)" > {{ row.code }}</el-link>
+        </template>
+
+
         <!-- 状态列 -->
         <!-- 状态列 -->
         <template v-slot:status="{ row }">
         <template v-slot:status="{ row }">
           {{ checkStatus(row) }}
           {{ checkStatus(row) }}
@@ -51,6 +57,7 @@
     <!-- 历史版本弹框 -->
     <!-- 历史版本弹框 -->
     <historyModal  ref="historyRefs"></historyModal>
     <historyModal  ref="historyRefs"></historyModal>
 
 
+    <UserDetail  :visible.sync="detailEdit" :data="current"  @close="detailEdit = false"></UserDetail>
 
 
   </div>
   </div>
 </template>
 </template>
@@ -58,7 +65,7 @@
 <script>
 <script>
 import UserSearch from './components/user-search.vue';
 import UserSearch from './components/user-search.vue';
 import UserEdit from './components/user-edit.vue';
 import UserEdit from './components/user-edit.vue';
-
+import UserDetail from './components/user-detail.vue'
 import historyModal from './components/historyModal.vue'
 import historyModal from './components/historyModal.vue'
 import route from '@/api/technology/route';
 import route from '@/api/technology/route';
 export default {
 export default {
@@ -66,6 +73,7 @@ export default {
   components: {
   components: {
     UserSearch,
     UserSearch,
     UserEdit,
     UserEdit,
+    UserDetail,
     historyModal
     historyModal
   },
   },
   data() {
   data() {
@@ -86,8 +94,8 @@ export default {
           // sortable: 'custom',
           // sortable: 'custom',
           showOverflowTooltip: true,
           showOverflowTooltip: true,
           align: 'center',
           align: 'center',
-
-          minWidth: 110
+          minWidth: 110,
+          slot: 'code',
         },
         },
         {
         {
           prop: 'name',
           prop: 'name',
@@ -139,6 +147,7 @@ export default {
       current: null,
       current: null,
       // 是否显示编辑弹窗
       // 是否显示编辑弹窗
       showEdit: false,
       showEdit: false,
+      detailEdit: false,
 
 
       statusList: [
       statusList: [
         { label: '草稿', value: -1 },
         { label: '草稿', value: -1 },
@@ -235,7 +244,13 @@ export default {
         .catch((e) => {
         .catch((e) => {
           this.loading = false;
           this.loading = false;
         });
         });
-    }
+    },
+
+    openDetail(row) {
+      this.current = row
+      this.detailEdit = true
+     
+    },
 
 
   }
   }
 };
 };