ysy 2 vuotta sitten
vanhempi
commit
84681b8f21

+ 207 - 0
src/views/technology/productParam/components/ParamModal.vue

@@ -0,0 +1,207 @@
+<template>
+    <el-dialog :title="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">
+            <user-search @search="reload" />
+
+            <!-- 数据表格 -->
+            <ele-pro-table ref="table" :columns="columns" :datasource="datasource" :selection.sync="selection"
+                row-key="code">
+
+
+                <template v-slot:status="{ row }">
+                    {{ checkType(row.categoryType) }}
+                </template>
+                <!-- 状态列 -->
+
+                <template v-slot:textType="{ row }">
+                    {{ row.textType == 1 ? '数值' : row.textType == 2 ? '选择' : row.textType == 3 ? '产品参数' : row.textType == 4
+                        ? '规格' :
+                        '' }}
+                </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 UserSearch from '@/views/technology/parameter/components/user-search.vue'
+import parameter from '@/api/technology/parameter';
+export default {
+    components: { UserSearch },
+    data() {
+        return {
+            visible: false,
+            title: '产品参数',
+
+            // 表格列配置
+            columns: [
+                {
+                    columnKey: 'selection',
+                    type: 'selection',
+                    width: 45,
+                    align: 'center',
+                    // selectable: (row, index) => {
+                    //   return !this.data.some((it) => it.id == row.id);
+                    // },
+                    reserveSelection: true,
+                    fixed: 'left'
+                },
+                {
+                    prop: 'code',
+                    label: '参数编码',
+                    // sortable: 'custom',
+                    showOverflowTooltip: true,
+                    align: 'center',
+                    minWidth: 110
+                },
+                {
+                    prop: 'name',
+                    label: '参数名称',
+                    showOverflowTooltip: true,
+                    align: 'center',
+                    minWidth: 110
+                },
+
+
+                {
+                    prop: 'textType',
+                    label: '参数类型',
+                    showOverflowTooltip: true,
+                    align: 'center',
+                    slot: 'textType',
+                    minWidth: 110
+                },
+                {
+                    align: 'center',
+                    prop: 'description',
+                    label: '文本描述',
+                    showOverflowTooltip: true,
+                    minWidth: 110
+                },
+                {
+                    prop: 'maxValue',
+                    label: '参数上限',
+                    align: 'center',
+                    showOverflowTooltip: true
+                },
+                {
+                    prop: 'minValue',
+                    label: '参数下限',
+                    align: 'center',
+                    showOverflowTooltip: true
+                },
+                {
+                    prop: 'defaultValue',
+                    label: '默认值',
+                    align: 'center',
+                    showOverflowTooltip: true
+                },
+                {
+                    prop: 'categoryType',
+                    label: '参数分类',
+                    align: 'center',
+                    slot: 'status',
+                    showOverflowTooltip: true
+                },
+
+                {
+                    columnKey: 'action',
+                    label: '操作',
+                    width: 220,
+                    align: 'center',
+                    resizable: false,
+                    slot: 'action',
+                    showOverflowTooltip: true
+                }
+            ],
+            statusList: [
+                { label: '工艺', value: 0 },
+                { label: '工序', value: 1 },
+                { label: '产品', value: 2 },
+                { label: '原料', value: 3 },
+                { label: '设备', value: 4 },
+                { label: '其他', value: 5 }
+            ],
+            // 表格选中数据
+            selection: [],
+
+        }
+    },
+
+    watch: {
+
+    },
+    methods: {
+
+        /*回显类型 */
+        checkType(id) {
+            const obj = this.statusList.find((item) => item.value == id);
+            return obj.label;
+        },
+
+        /* 表格数据源 */
+        async datasource({ page, limit, where, order }) {
+            const res = await parameter.list({
+                ...where,
+                ...order,
+                pageNum: page,
+                size: limit
+            });
+            return res;
+        },
+
+        /* 刷新表格 */
+        reload(where) {
+            this.$refs.table.reload({ page: 1, where: where });
+        },
+        open(item) {
+            if (item) {
+
+
+            }
+            this.visible = true
+        },
+
+
+
+
+
+
+        handleClose() {
+            this.visible = false
+            this.selection = []
+
+        },
+        selected() {
+            if (!this.selection.length) {
+                this.$message.error('请至少选择一条数据');
+                return;
+            }
+            this.$emit('chooseModal', this.selection)
+            this.handleClose()
+        },
+    }
+}
+</script>
+  
+<style lang="scss" scoped>
+.btns {
+    text-align: center;
+    padding: 10px 0;
+}
+</style>
+  

+ 18 - 11
src/views/technology/productParam/components/user-edit.vue

@@ -100,9 +100,7 @@
 
       <el-row>
         <el-col :span="8">
-        <el-form-item label="选择参数:">
-         <el-input readonly @click.native="openParam"></el-input>
-        </el-form-item>
+          <el-button type="primary" @click.native="openParam">选择参数</el-button>
         </el-col>
       </el-row>
 
@@ -122,6 +120,9 @@
     <!-- 选择产品弹窗 -->
     <ProductModal ref="productRefs" @changeProduct='determineChoose' />
 
+    <!-- 选择产品参数 -->
+    <ParamModal ref="paramRefs" @chooseModal="chooseModal"></ParamModal>
+
   </ele-modal>
 </template>
 
@@ -129,11 +130,13 @@
 import parameter from '@/api/technology/parameter';
 
 import ProductModal from './ProductModal.vue';
+import ParamModal from './ParamModal.vue'
 
 
 export default {
   components: {
-    ProductModal
+    ProductModal,
+    ParamModal
   },
   props: {
     // 弹窗是否打开
@@ -153,10 +156,9 @@ export default {
       remark: '',
 
       taskParam: [
-      
       ],
 
- 
+
 
     };
     return {
@@ -165,9 +167,7 @@ export default {
       form: { ...defaultForm },
 
       VersionList: [],
-      paramList: [
-       
-      ],
+
 
 
       // 表单验证规则
@@ -220,10 +220,17 @@ export default {
         this.$set(this.form, 'palletSpecs', row.specification)
 
 
+      }
 
+    },
 
-      }
+    openParam() {
+      this.$refs.paramRefs.open(this.form.taskParam)
+    },
+    
 
+    chooseModal(data) {
+      console.log(data)
     },
 
 
@@ -271,7 +278,7 @@ export default {
         size: 100
       });
       this.paramList = res.list
-      console.log( this.paramList)
+      console.log(this.paramList)
 
     },
   },

+ 1 - 1
src/views/technology/route/components/production/index.vue

@@ -9,7 +9,7 @@
         :columns="columns"
         :datasource="datasource"
         :selection.sync="selection"
-        row-key="code"
+        row-key="id"
       >
         <!-- 状态列 -->
 

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

@@ -4,7 +4,7 @@
     custom-class="ele-dialog-form" :title="`给工序【${this.data?.code}${this.data?.name}】配置工序`"
     @update:visible="updateVisible">
     <div class="ele-body">
-      <ele-pro-table ref="table" :needPage="false" :columns="columns" :datasource="datasource" row-key="code">
+      <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="showAddLog">