ysy 2 жил өмнө
parent
commit
9acefa3216

+ 1 - 9
src/views/technology/productParam/components/ParamModal.vue

@@ -118,15 +118,7 @@ export default {
                     showOverflowTooltip: true
                 },
 
-                {
-                    columnKey: 'action',
-                    label: '操作',
-                    width: 220,
-                    align: 'center',
-                    resizable: false,
-                    slot: 'action',
-                    showOverflowTooltip: true
-                }
+           
             ],
             statusList: [
                 { label: '工艺', value: 0 },

+ 134 - 6
src/views/technology/productParam/components/user-edit.vue

@@ -99,9 +99,68 @@
       <header-title title="产品参数"></header-title>
 
       <el-row>
-        <el-col :span="8">
-          <el-button type="primary" @click.native="openParam">选择参数</el-button>
-        </el-col>
+
+
+        <div class="ele-body">
+          <ele-pro-table ref="table" :datasource="datasource" :needPage="false" :columns="columns">
+            <!-- 表头工具栏 -->
+            <template v-slot:toolbar>
+
+              <el-button ize="small" icon="el-icon-plus" class="ele-btn-icon" type="primary"
+                @click.native="openParam">添加参数</el-button>
+
+            </template>
+
+            <!-- 默认值 -->
+            <template v-slot:defaultValue="{ row }">
+              <el-input v-if="row.textType == 1 || row.textType == 4" v-model="row.defaultValue"
+                placeholder="请输入"></el-input>
+              <el-select v-if="row.textType == 2" v-model="row.defaultValue" placeholder="请选择">
+                <el-option label="TRUE" :value="'TRUE'" />
+                <el-option label="FALSE" :value="'FALSE'" />
+              </el-select>
+
+            </template>
+
+            <!-- 上限 -->
+            <template v-slot:maxValue="{ row }">
+              <el-input v-if="row.textType == 3"  v-model="row.maxValue" placeholder="请输入"></el-input>
+            </template>
+            <!-- 下限 -->
+            <template v-slot:minValue="{ row }">
+              <el-input v-if="row.textType == 3" v-model="row.minValue" placeholder="请输入"></el-input>
+            </template>
+
+            <!-- 单位 -->
+            <template v-slot:unitName="{ row }">
+              <DictSelection v-if="row.textType != 2" dictName="工艺参数单位" clearable filterable v-model="row.unitName">
+              </DictSelection>
+            </template>
+
+
+            <!-- 默认值 -->
+            <!-- <template v-slot:notNull="{ row }">
+              <el-select v-model="row.notNull" placeholder="请选择">
+                <el-option v-for="item in timeType" :key="item.value" :label="item.label" :value="item.value">
+                </el-option>
+              </el-select>
+            </template> -->
+
+            <!-- 状态列 -->
+
+            <!-- 操作列 -->
+            <template v-slot:action="{ row }">
+              <el-popconfirm class="ele-action" title="确定要删除当前工序吗?" @confirm="remove(row)">
+                <template v-slot:reference>
+                  <el-link type="danger" :underline="false" icon="el-icon-delete">
+                    删除
+                  </el-link>
+                </template>
+              </el-popconfirm>
+            </template>
+          </ele-pro-table>
+        </div>
+
       </el-row>
 
     </el-form>
@@ -131,7 +190,7 @@ import parameter from '@/api/technology/parameter';
 
 import ProductModal from './ProductModal.vue';
 import ParamModal from './ParamModal.vue'
-
+import { deepClone } from '@/components/FormGenerator/utils/index';
 
 export default {
   components: {
@@ -184,7 +243,74 @@ export default {
       // 提交状态
       loading: false,
       // 是否是修改
-      isUpdate: false
+      isUpdate: false,
+
+
+      // 表格列配置
+      columns: [
+        {
+          prop: 'code',
+          label: '参数编码',
+          showOverflowTooltip: true,
+          align: 'center',
+          minWidth: 110
+        },
+        {
+          prop: 'name',
+          label: '参数名称',
+          showOverflowTooltip: true,
+          align: 'center',
+          minWidth: 110
+        },
+        {
+          align: 'center',
+          prop: 'description',
+          label: '文本描述',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+
+        {
+          prop: 'maxValue',
+          slot: 'maxValue',
+          label: '参数上限',
+          align: 'center',
+
+        },
+        {
+          prop: 'minValue',
+          slot: 'minValue',
+          label: '参数下限',
+          align: 'center',
+
+        },
+        {
+          prop: 'defaultValue',
+          slot: 'defaultValue',
+          label: '默认值',
+          align: 'center',
+
+        },
+
+        {
+          prop: 'unitName',
+          slot: 'unitName',
+          label: '参数单位',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+
+
+        {
+          columnKey: 'action',
+          label: '操作',
+
+          align: 'center',
+          resizable: false,
+          slot: 'action',
+          showOverflowTooltip: true
+        }
+      ],
     };
   },
   computed: {
@@ -227,10 +353,12 @@ export default {
     openParam() {
       this.$refs.paramRefs.open(this.form.taskParam)
     },
-    
+
 
     chooseModal(data) {
       console.log(data)
+      let arr = deepClone(data)
+      this.$refs.table.setData([...arr, ...this.$refs.table.getData()]);
     },
 
 

+ 1 - 0
src/views/technology/production/components/parameter/components/user-search.vue

@@ -46,6 +46,7 @@
 
       <el-col v-bind="styleResponsive ? { lg: 4, md: 12 } : { span: 4 }">
         <div class="ele-form-actions">
+          
           <el-button
             type="primary"
             icon="el-icon-search"