Explorar o código

新增 模具

ysy %!s(int64=2) %!d(string=hai) anos
pai
achega
c0cb63c362

+ 9 - 1
src/views/material/product/components/index-data.vue

@@ -53,7 +53,7 @@
     <ParamEdit :visible.sync="paramEditShow"  :paramData="current" ref="paramRefs"></ParamEdit>
 
     <!-- 模具 -->
-    <mouldDialog ></mouldDialog>
+    <mouldDialog  :visible.sync="mouldShow" :data="current" ref="mouldRefs"></mouldDialog>
 
   </div>
 </template>
@@ -180,6 +180,7 @@ export default {
 
       materialEdit: false,
       paramEditShow: false,
+      mouldShow: false,
       current: null,
 
     };
@@ -246,6 +247,13 @@ export default {
 
     },
 
+    openMould(row) {
+      this.current = row;
+      this.mouldShow = true;
+      this.$refs.mouldRefs.$refs.form &&
+       this.$refs.mouldRefs.$refs.form.clearValidate();
+    },
+
 
 
   },

+ 140 - 169
src/views/material/product/components/mouldDialog.vue

@@ -42,115 +42,70 @@
                 </el-col>
             </el-row>
 
-            <header-title title="物料BOM">
-                <div>
-                    <el-button size="small" icon="el-icon-plus" class="ele-btn-icon" type="primary"
-                        @click="handleAdd">新增</el-button>
-                </div>
+            <header-title title="工序">
             </header-title>
+             
+            <ele-pro-table ref="table" :needPage="false" :columns="columns" :datasource="datasource" row-key="id">
+
+                <!-- 表头工具栏 -->
+                <template v-slot:toolbar>
+                    <el-button size="small" type="primary" icon="el-icon-plus" class="ele-btn-icon"
+                        @click="openEdit">新增</el-button>
+
+
+                </template>
+
+                <template v-slot:mouldName="{ row, $index }">
+                  
+                    <el-input :v-model="row.mouldName" placeholder="请选择" @click.native="mouldSelect(row, $index)"></el-input>
+                </template>
+
+
+
+
+                <!-- 操作列 -->
+                <template v-slot:action="{ row, $index }">
+                 
+                    <el-popconfirm class="ele-action" title="确定要删除当前工序吗?" @confirm="handleDel(row, $index)">
+                        <template v-slot:reference>
+                            <el-link type="danger" :underline="false" icon="el-icon-delete">
+                                删除 {{ row.mouldName }}
+                            </el-link>
+                        </template>
+                    </el-popconfirm>
+                </template>
+
+
+
+
+
+            </ele-pro-table>
+
 
-            <el-card v-for="(bomItem, index) in form.bomList" :key="index">
-                <el-row>
-                    <el-col :span="8">
-                        <el-form-item label="BOM编码:">
-                            {{ bomItem.code }}
-                        </el-form-item>
-                    </el-col>
-
-                    <el-col :span="8">
-                        <el-form-item label="BOM名称:" prop="name">
-                            {{ bomItem.name }}
-                        </el-form-item>
-                    </el-col>
-
-                    <el-col :span="8">
-                        <el-form-item label="版本号:" prop="version">
-                            {{ bomItem.version }}
-                        </el-form-item>
-                    </el-col>
-
-                    <el-col :span="8">
-                        <el-form-item label="状态:" prop="status">
-                            <el-select v-model="bomItem.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-col :span="8">
-                        <el-form-item label="生产版本:" prop="produceVersionId">
-                            <el-select v-model="bomItem.produceVersionId" filterable placeholder="请选择" disabled
-                                :style="{ width: '100%' }">
-                                <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="factoryId">
-                            <factorySelect v-model="bomItem.factoryId" disabled />
-                        </el-form-item>
-                    </el-col>
-
-                    <el-col :span="8">
-                        <el-form-item label="基本数量:" prop="baseCount">
-                            <el-row>
-                                <el-col :span="12">
-                                    {{ bomItem.baseCount }}
-                                </el-col>
-                                <el-col :span="2">&nbsp;</el-col>
-                                <el-col :span="10">
-                                    <DictSelection disabled dictName="计量单位:" v-model="bomItem.baseCountUnit" />
-                                </el-col>
-                            </el-row>
-                        </el-form-item>
-                    </el-col>
-                </el-row>
-
-                <el-row>
-                    <div class="ele-body">
-                        <ele-pro-table ref="table" :columns="columns" :need-page="false" row-key="id"
-                            :datasource="bomItem.subDetailList" min-height="200px">
-                            <template v-slot:toolbar>
-                                <el-button type="primary" size="small" @click="openEdit(index)">编辑</el-button>
-
-                                <el-popconfirm class="ele-action" title="确定要删除此物料BOM?" @confirm="remove(bomItem)">
-                                    <template v-slot:reference>
-                                        <el-button type="danger" size="small" icon="el-icon-delete">
-                                            删除
-                                        </el-button>
-                                    </template>
-                                </el-popconfirm>
-                            </template>
-                        </ele-pro-table>
-                    </div>
-                </el-row>
-            </el-card>
         </el-form>
 
-        <!-- 物料Bom -->
-        <MaterialAdd :visible.sync="materialShow" :data="current" :categoryId="categoryId" @done="done"
-            ref="materialAddRef">
-        </MaterialAdd>
+        <div slot="footer" class="footer">
+            <el-button type="primary" @click="save">保存</el-button>
+            <el-button @click="visible = false">返回</el-button>
+        </div>
+
+
+        <processModal ref="processRefs" @chooseProcess="chooseProcess"></processModal>
+        <ProductModal ref="productRefs" @changeProduct='determineChoose' />
+
     </ele-modal>
 </template>
   
 <script>
 
-import MaterialAdd from './MaterialAdd.vue';
-import { pageList } from '@/api/technology/version/version.js';
-import { getCategoryBom } from '@/api/material/product';
-import { bomDelete } from '@/api/material/BOM';
-import factorySelect from '@/components/CommomSelect/factory-select.vue';
 
+import processModal from '@/views/technology/productParam/components/processModal.vue'
+import ProductModal from '@/views/technology/productParam/components/ProductModal.vue'
 export default {
     components: {
-        MaterialAdd,
-        factorySelect
+        processModal,
+        ProductModal
+
     },
     props: {
         // 弹窗是否打开
@@ -169,7 +124,7 @@ export default {
             specification: '',
             measuringUnit: '',
 
-            bomList: []
+            routeList: []
         };
         return {
             defaultForm,
@@ -177,9 +132,6 @@ export default {
             form: {
                 ...defaultForm
             },
-
-            versionList: [],
-
             // 表单验证规则
             rules: {
                 categoryName: [
@@ -187,58 +139,66 @@ export default {
                 ]
             },
 
+
+
+            // 提交状态
+            loading: false,
+            current: null,
+
             columns: [
+
                 {
-                    type: 'index',
-                    width: 55,
-                    align: 'center'
-                },
-                {
-                    label: '子项编号',
-                    prop: 'subCode',
-                    action: 'subCode'
-                },
-                {
-                    label: '物料名称',
-                    prop: 'categoryName',
-                    action: 'categoryName'
+                    label: '模具名称',
+                    prop: 'mouldName',
+                    slot: 'mouldName',
                 },
+
                 {
-                    label: '物料编码',
-                    prop: 'categoryCode'
+                    prop: 'code',
+                    label: '工序编码',
+                    // sortable: 'custom',
+                    showOverflowTooltip: true,
+                    align: 'center',
+                    minWidth: 110
                 },
                 {
-                    label: '牌号',
-                    prop: 'brandNum'
+                    prop: 'name',
+                    label: '工序名称',
+                    showOverflowTooltip: true,
+                    align: 'center',
+                    minWidth: 110
                 },
                 {
-                    label: '型号',
-                    prop: 'modelType'
+                    align: 'center',
+                    prop: 'controlName',
+                    label: '工序控制码',
+                    showOverflowTooltip: true,
+                    minWidth: 110
                 },
                 {
-                    label: '净重',
-                    prop: 'count'
+                    prop: 'workCenterName',
+                    label: '所属工作中心',
+                    align: 'center',
+                    showOverflowTooltip: true,
+                    minWidth: 110
                 },
+
                 {
-                    label: '重量单位',
-                    prop: 'unit'
+                    columnKey: 'action',
+                    label: '操作',
+                    width: 260,
+                    align: 'center',
+                    resizable: false,
+                    slot: 'action',
+                    showOverflowTooltip: true
                 }
             ],
 
-            statusList: [
-                { label: '草稿', value: -1 },
-                { label: '失效', value: 0 },
-                { label: '生效', value: 1 }
-            ],
+            removeList: [],
 
-            // 提交状态
-            loading: false,
 
-            categoryId: null,
 
-            current: null,
 
-            materialShow: false
         };
     },
     computed: {
@@ -248,66 +208,77 @@ export default {
         }
     },
     methods: {
-        openEdit(index) {
-            this.current = this.form.bomList[index];
-            console.log(this.current);
-            this.materialShow = true;
-        },
 
         /* 表格数据源 */
         datasource({ page, limit, where }) {
             return [];
         },
 
-        async getVersionList() {
-            const res = await pageList({
-                pageNum: 1,
-                size: 100
-            });
-
-            this.versionList = res.list;
-        },
 
-        handleAdd() {
-            this.current = null;
-            this.materialShow = true;
-        },
 
         /* 更新visible */
         updateVisible(value) {
             this.$emit('update:visible', value);
         },
 
-        async getCategoryBomFn() {
-            const res = await getCategoryBom(this.categoryId);
-            this.form.bomList = res.bomList;
+        openEdit() {
+            this.$refs.processRefs.open(this.$refs.table.getData())
+        },
+
+        chooseProcess(data) {
+            this.$refs.table.setData([...data, ...this.$refs.table.getData()]);
         },
 
-        remove(row) {
-            bomDelete([row.id])
-                .then((message) => {
-                    this.$message.success(message);
-                    this.getCategoryBomFn();
-                })
-                .catch((e) => {
-                    this.$message.error(e.message);
-                });
+
+
+
+        handleDel(row, index) {
+            let _arr = this.$refs.table.getData()
+            _arr.splice(index, 1)
+            this.$refs.table.setData(_arr)
+            if (row?.id) {
+                this.removeList.push(row.id)
+            }
         },
 
-        done() {
-            this.materialShow = false
-            this.getCategoryBomFn();
+        mouldSelect(row, idx) {
+            this.$refs.productRefs.open(row, '模具', '5', idx)
         },
 
+        determineChoose(title, row, idx) {
+         
+            if (title == '模具') {
+                let _arr = this.$refs.table.getData()
+                let _new = _arr
+
+              
+               
+                _new[idx].mouldId = row.id
+                _new[idx]['mouldName'] = row.name
+              
+                console.log(_new)
+
+                this.$refs.table.setData(_new);
+
+            }
+
+
+        },
+
+
+        save() { },
+
+
+
     },
 
     watch: {
         async visible(visible) {
             if (visible) {
-                this.getVersionList();
+
                 if (this.data) {
-                    this.categoryId = this.data.id;
-                    this.getCategoryBomFn();
+
+
                     this.$util.assignObject(this.form, {
                         ...this.data
                     });

+ 2 - 6
src/views/technology/productParam/components/ProductModal.vue

@@ -154,18 +154,14 @@ export default {
         this.title = title
         this.categoryLevelId = categoryLevelId
         this.idx = idx
-
-        if (title == '选择产品' || title == '选择舟皿' || title == '选择物料') {
-          this.current = {
+        
+        this.current = {
             id: item.categoryId,
             name: item.categoryName,
             code: item.categoryCode
           }
           this.radio = item.categoryId
 
-        }
-
-
       }
       this.visible = true
     },

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

@@ -43,7 +43,7 @@
         </el-col>
         <el-col :span="8">
           <el-form-item label="状态:" prop="status">
-            <el-select v-model="form.status" placeholder="" filterable :disabled="isUpdate">
+            <el-select v-model="form.status" placeholder="" filterable >
               <el-option v-for="item in statusList" :key="item.value" :label="item.label" :value="item.value">
               </el-option>
             </el-select>

+ 6 - 15
src/views/technology/route/components/user-taskinstance.vue

@@ -11,9 +11,9 @@
           </el-button>
         </template>
 
-        <template v-slot:sortNum="{ row }">
+        <template v-slot:orderNum="{ row }">
          
-          <el-input v-model="row.sortNum" placeholder="请输入排序"></el-input>
+          <el-input v-model="row.orderNum" placeholder="请输入排序"></el-input>
 
         </template>
 
@@ -94,10 +94,10 @@ export default {
       columns: [
 
         {
-          prop: 'sortNum',
+          prop: 'orderNum',
           label: '排序',
           align: 'center',
-          slot: 'sortNum',
+          slot: 'orderNum',
           minWidth: 120
         },
         {
@@ -238,7 +238,7 @@ export default {
         });
 
         let arr = res.list.map((it) => {
-          it.detail.sortNum = it.sortNum
+          it.detail.orderNum = it.orderNum
           return it.detail
         });
         return {
@@ -254,21 +254,12 @@ export default {
         this.$message.warning('至少配置一条工序才能保存');
         return;
       }
-      let arr1 = arr.map((it, i) => {
-        if (it.orderNum) {
-          delete it.orderNum;
-        }
-        return {
-          ...it,
-          orderNum: i + 1
-        };
-      });
 
       route
         .taskinstanceSave({
           routingId: this.taskInfo.id,
           versionUpgradeType: this.versionUpgradeType,
-          taskInstanceList: arr1
+          taskInstanceList: arr
         })
         .then((res) => {
           if (res) {

+ 182 - 0
src/views/technology/version/components/multiRouteModal.vue

@@ -0,0 +1,182 @@
+<template>
+    <el-dialog title="选择工艺路线" :visible.sync="visible" :before-close="handleClose" :close-on-click-modal="false"
+        :close-on-press-escape="false" append-to-body width="80%">
+        <el-card shadow="never">
+            <routetSearch @search="reload" />
+
+
+            <!-- 表格 -->
+
+            <ele-pro-table ref="table" :columns="columns" :datasource="datasource" :need-page="true"
+                :selection.sync="selection" row-key="id">
+
+                <!-- 状态列 -->
+                <template v-slot:status="{ row }">
+                    {{ checkStatus(row) }}
+                </template>
+                <!-- 表头工具栏 -->
+                <template v-slot:action="{ row }">
+                    <el-radio class="radio" v-model="radio" :label="row.id"><i></i></el-radio>
+                </template>
+            </ele-pro-table>
+
+
+        </el-card>
+        <div class="btns">
+            <el-button type="primary" size="small" @click="selected">选择</el-button>
+            <el-button size="small" @click="handleClose">关闭</el-button>
+        </div>
+    </el-dialog>
+</template>
+  
+<script>
+import AssetTree from '@/components/AssetTree';
+import routetSearch from './route-search.vue'
+import route from '@/api/technology/route';
+export default {
+    components: { AssetTree, routetSearch },
+    data() {
+        return {
+            visible: false,
+            // 表格列配置
+            columns: [
+                {
+                    columnKey: 'selection',
+                    type: 'selection',
+                    width: 45,
+                    align: 'center',
+                    selectable: (row, index) => {
+                        return !this.chooseData.some((it) => it.id == row.id);
+                    },
+                    reserveSelection: true,
+                    fixed: 'left'
+                },
+                {
+                    prop: 'code',
+                    label: '工艺路线组编码',
+                    showOverflowTooltip: true,
+                    align: 'center',
+                    minWidth: 110
+                },
+                {
+                    prop: 'name',
+                    label: '工艺路线名称',
+                    showOverflowTooltip: true,
+                    align: 'center',
+                    minWidth: 110
+                },
+                {
+                    align: 'center',
+                    prop: 'categoryCode',
+                    label: '产品编码',
+                    showOverflowTooltip: true,
+                    minWidth: 110
+                },
+                {
+                    prop: 'categoryName',
+                    label: '产品名称',
+                    align: 'center',
+                    showOverflowTooltip: true,
+                    minWidth: 110
+                },
+                {
+                    prop: 'version',
+                    label: '工艺路线版本',
+                    align: 'center',
+                    showOverflowTooltip: true,
+                    minWidth: 110
+                },
+                {
+                    prop: 'status',
+                    label: '状态',
+                    align: 'center',
+                    slot: 'status',
+                    showOverflowTooltip: true,
+                    minWidth: 110
+                },
+
+
+
+            ],
+
+            // 表格选中数据
+            selection: [],
+            chooseData: [],
+
+            statusList: [
+                { label: '草稿', value: -1 },
+                { label: '失效', value: 0 },
+                { label: '生效', value: 1 }
+            ],
+        }
+    },
+
+    watch: {
+
+    },
+    methods: {
+        /* 表格数据源 */
+        async datasource({ page, limit, where }) {
+            const res = await route.list({
+                ...where,
+                status: 1,
+                pageNum: page,
+                size: limit
+            });
+            return res;
+        },
+
+
+        checkStatus(row) {
+            let obj = this.statusList.find((it) => it.value == row.status);
+            return obj.label;
+        },
+        /* 刷新表格 */
+        reload() {
+            this.$refs.table.reload();
+        },
+
+        open(item) {
+            if (item) {
+                this.chooseData = item
+            }
+            this.visible = true
+        },
+
+
+        handleClose() {
+            this.visible = false
+            this.$refs.table.setSelectedRows([]);
+            this.selection = []
+        },
+        selected() {
+            if (!this.selection.length) {
+                return this.$message.warning('请选择工艺路线')
+            }
+            this.$emit('changeRoute', this.selection)
+            this.handleClose()
+        },
+    }
+}
+</script>
+  
+<style lang="scss" scoped>
+.table_col {
+    padding-left: 10px;
+
+    ::v-deep .el-table th.el-table__cell {
+        background: #f2f2f2;
+    }
+}
+
+.pagination {
+    text-align: right;
+    padding: 10px 0;
+}
+
+.btns {
+    text-align: center;
+    padding: 10px 0;
+}
+</style>
+