Browse Source

公共查询组件,证照修改未完成

zhangqing 1 year ago
parent
commit
44a79dccda

+ 200 - 0
src/components/common/seekPage.vue

@@ -0,0 +1,200 @@
+<template>
+    <div class="index_box">
+        <el-form label-width="90px" :inline="true">
+            <el-form-item v-for="(item, i) in seekList" :key="i">
+                <el-form-item :label="item.label" :label-width="item.labelWidth + 'px'" v-if="i <= 2">
+                    <!-- input 输入 -->
+                    <div>
+                        <div v-if="item.type == 'input'">
+                            <el-input clearable v-model="defaultWhere[item.value]"
+                                :placeholder="item.placeholder || '请输入内容'"
+                                :style="{ width: item.width ? item.width + 'px' : '220px' }" />
+                        </div>
+                        <div v-if="item.type == 'select'">
+                            <el-select clearable v-model="defaultWhere[item.value]"
+                                :multiple="item.multiple ? item.multiple : false"
+                                :filterable="item.filterable ? item.filterable : true"
+                                :placeholder="item.placeholder || '请输入内容'"
+                                :style="{ width: item.width ? item.width + 'px' : '220px' }"
+                                >
+                                <el-option v-for="(op, i) in item.planList" :label="op.label"
+                                    :value="op.value" :key="i"></el-option>
+                            </el-select>
+                        </div>
+                        <div v-if="item.type == 'date'">
+                            <el-date-picker v-model="defaultWhere[item.value]" @visible-change="change"
+                                :type="item.dateType || 'daterange'" range-separator="至" start-placeholder="开始日期"
+                                end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss"
+                                :style="{ width: item.width ? item.width + 'px' : '220px' }">
+
+
+                            </el-date-picker>
+                        </div>
+                    </div>
+                </el-form-item>
+
+            </el-form-item>
+
+            <el-form-item>
+                <el-dropdown ref="dropdownref" trigger="click" :hide-on-click="false" v-model="dropdownVisible">
+                    <div v-if="seekList.length > 3">
+                        <span class="el-dropdown-link">
+                            更多选项<i class="el-icon-arrow-down el-icon--right"></i>
+                        </span>
+                        <el-dropdown-menu slot="dropdown" >
+                            <div class="padding">
+                                <el-form label-position="left">
+                                    <el-form-item v-for="(item, i) in deboListRow" :key="i" :inline="true"
+                                        label-position="left">
+                                        <el-form-item :label-width="item.labelWidth ? item.labelWidth : '90' + 'px'"
+                                            :inline="true" :label="item.label">
+                                            <div v-if="item.type == 'input'">
+                                                <el-input clearable v-model="defaultWhere[item.value]"
+                                                    :placeholder="item.placeholder || '请输入内容'"
+                                                    :style="{ width: item.width ? item.width + 'px' : '220px' }" />
+                                            </div>
+                                            <div v-if="item.type == 'select'">
+                                                <el-select clearable v-model="defaultWhere[item.value]"
+                                                    :multiple="item.multiple ? item.multiple : false"
+                                                    :filterable="item.filterable ? item.filterable : true"
+                                                    :placeholder="item.placeholder || '请输入内容'"
+                                                    :style="{ width: item.width ? item.width + 'px' : '220px' }"
+                                                    @visible-change="change" @change="handerChange">
+                                                    <el-option v-for="(op, i) in item.planList" :label="op.label"
+                                                        :value="op.value" :key="i"></el-option>
+                                                </el-select>
+                                            </div>
+
+                                            <div v-if="item.type == 'date'">
+                                                <el-date-picker v-model="defaultWhere[item.value]"
+                                                    @blur="change" :type="item.dateType || 'daterange'"
+                                                    range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
+                                                    value-format="yyyy-MM-dd HH:mm:ss"
+                                                    
+                                                    :style="{ width: item.width ? item.width + 'px' : '220px' }">
+
+
+                                                </el-date-picker>
+                                            </div>
+
+                                        </el-form-item>
+                                    </el-form-item>
+                                </el-form>
+                            </div>
+
+                        </el-dropdown-menu>
+                    </div>
+                </el-dropdown>
+
+
+            </el-form-item>
+
+            <el-form-item>
+                <el-button type="primary" icon="el-icon-search" class="ele-btn-icon" @click="search">
+                    查询
+                </el-button>
+                <el-button @click="reset" icon="el-icon-refresh-left" type="primary">重置</el-button>
+            </el-form-item>
+        </el-form>
+
+
+    </div>
+</template>
+
+<script>
+
+let defaultWhere = {};
+export default {
+    props: {
+        seekList: {
+            type: Array,
+            default: () => []
+        }
+    },
+
+    components: {
+
+    },
+    watch: {
+        seekList: {
+            handler(val) {
+
+                val.forEach(item => {
+
+                    defaultWhere[item.value] = null;
+
+                })
+
+                this.$nextTick(() => {
+
+                    if (Array.isArray(val) && val.length <= 3) {
+                        this.seekListRow = val
+                    } else if (Array.isArray(val) && val.length >= 3) {
+                        this.seekListRow = val.slice(0, 3);
+                        this.deboListRow = val.slice(3);
+                    }
+                })
+
+            },
+            deep: true,
+            immediate: true,
+        }
+    },
+
+    data() {
+
+
+        return {
+            defaultWhere: {},
+            dropdownVisible: true,
+
+            deboListRow: [],
+            seekListRow: []
+        }
+    },
+
+    computed: {
+        info() {
+            return this.$store.state.user.info;
+        },
+
+    },
+
+    created() {
+
+
+    },
+    methods: {
+
+        change(visible) {
+           
+            this.dropdownVisible = visible;
+            this.$refs.dropdownref.show()
+        },
+        handerChange() {
+            this.$refs.dropdownref.show()
+        },
+
+        search() {
+            this.$emit('search', this.defaultWhere);
+        },
+        // 重置
+        reset() {
+            this.defaultWhere = {};
+            this.search();
+        }
+
+        //  折叠悬浮中样式调整
+    },
+}
+</script>
+
+<style scoped>
+.index_box {
+    display: flex;
+}
+
+.padding {
+    padding: 20px;
+}
+</style>

+ 4 - 0
src/main.js

@@ -27,9 +27,13 @@ Vue.directive('permissionccc',permissionccc)
 Vue.component('HeaderTitle', HeaderTitle);
 Vue.component('authSelection', authSelection);
 
+
 import Print from 'vue-printjs';
 Vue.use(Print);
 
+// 公共搜索文件
+import seekPage from '@/components/common/seekPage';
+Vue.component('seekPage', seekPage)
 
 // // register globally
 Vue.component('tinymce', TinymceEditor);

+ 97 - 58
src/views/documentManagement/certificateManagement/components/add-dialog.vue

@@ -5,10 +5,7 @@
       <el-row :gutter="15">
         <el-col v-bind="styleResponsive ? { sm: 12 } : { span: 12 }">
           <el-form-item prop="type" label="证件类型">
-            <DictSelection
-              v-model="form.type"
-              dictName="证件类型"
-            ></DictSelection>
+            <DictSelection v-model="form.type" dictName="证件类型"></DictSelection>
           </el-form-item>
         </el-col>
         <el-col v-bind="styleResponsive ? { sm: 12 } : { span: 12 }">
@@ -19,89 +16,83 @@
         <el-col v-bind="styleResponsive ? { sm: 12 } : { span: 12 }">
           <el-form-item label="等级:" prop="level">
             <el-select style="width: 100%" v-model="form.level" filterable>
-              <el-option
-                :label="item.label"
-                :value="item.value"
-                v-for="(item, index) in levelOptions"
-                :key="index"
-              >
+              <el-option :label="item.label" :value="item.value" v-for="(item, index) in levelOptions" :key="index">
               </el-option>
             </el-select>
           </el-form-item>
         </el-col>
         <el-col v-bind="styleResponsive ? { sm: 12 } : { span: 12 }">
           <el-form-item prop="status" label="状态">
-            <DictSelection
-              v-model="form.status"
-              dictName="规则状态"
-            ></DictSelection>
+            <DictSelection v-model="form.status" dictName="规则状态"></DictSelection>
           </el-form-item>
         </el-col>
         <el-col v-bind="styleResponsive ? { sm: 12 } : { span: 12 }">
           <el-form-item prop="holder" label="持证人">
-            <el-input
-              v-model="form.holder"
-              clearable
-              readonly
-              placeholder="请选择"
-              @click.native="openStaffSelection"
-            ></el-input>
+            <el-input v-model="form.holder" clearable readonly placeholder="请选择"
+              @click.native="openStaffSelection"></el-input>
           </el-form-item>
         </el-col>
         <el-col v-bind="styleResponsive ? { sm: 12 } : { span: 12 }">
           <el-form-item label="颁发时间">
-            <el-date-picker
-              style="width: 100%"
-              v-model="form.enactorTime"
-              type="date"
-              value-format="yyyy-MM-dd HH:mm:ss"
-              placeholder="选择日期"
-            >
+            <el-date-picker style="width: 100%" v-model="form.enactorTime" type="date"
+              value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择日期">
             </el-date-picker>
           </el-form-item>
         </el-col>
         <el-col v-bind="styleResponsive ? { sm: 12 } : { span: 12 }">
           <el-form-item prop="date" label="有效期至">
-            <el-date-picker
-              style="width: 100%"
-              v-model="form.date"
-              type="daterange"
-              range-separator="至"
-              start-placeholder="开始日期"
-              end-placeholder="结束日期"
-              value-format="yyyy-MM-dd HH:mm:ss"
-              :default-time="['00:00:00', '23:59:59']"
-            >
+            <el-date-picker style="width: 100%" v-model="form.date" type="daterange" range-separator="至"
+              start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss"
+              :default-time="['00:00:00', '23:59:59']">
             </el-date-picker>
           </el-form-item>
         </el-col>
         <el-col v-bind="styleResponsive ? { sm: 24 } : { span: 24 }">
           <el-form-item prop="fileObj" label="证照图片">
-            <fileUpload
-              v-model="form.fileObj"
-              module="main"
-              :showLib="true"
-              :limit="5"
-            />
+            <fileUpload v-model="form.fileObj" module="main" :showLib="true" :limit="5" />
           </el-form-item>
         </el-col>
         <el-col v-bind="styleResponsive ? { sm: 24 } : { span: 24 }">
           <el-form-item prop="remark" label="备注">
-            <el-input
-              placeholder="请输入"
-              v-model="form.remark"
-              type="textarea"
-              :rows="3"
-              :resize="`none`"
-            ></el-input>
+            <el-input placeholder="请输入" v-model="form.remark" type="textarea" :rows="3" :resize="`none`"></el-input>
           </el-form-item>
         </el-col>
       </el-row>
     </el-form>
-    <staffSelection
-      ref="staffSelection"
-      @confirm="confirmStaffSelection"
-    ></staffSelection>
+    <staffSelection ref="staffSelection" @confirm="confirmStaffSelection"></staffSelection>
+    <!-- <headerTitle title="关联产品" v-show="!isUpdate"></headerTitle> -->
+    <!-- <ele-pro-table ref="table" :needPage="false" :columns="columns" :datasource="form.datasource" class="time-form"
+      :toolkit="[]"> -->
+      <!-- 表头工具栏 -->
+      <!-- <template v-slot:toolbar>
+        <el-button
+              size="small"
+              type="primary"
+              icon="el-icon-plus"
+              class="ele-btn-icon"
+              @click="handParent('', -1)"
+              v-if="!isContractId"
+            >
+              新增
+            </el-button>
+      </template> -->
+      <!-- 操作列 -->
+      <!-- <template v-slot:action="scope">
+        <el-popconfirm v-if="!isContractId" class="ele-action" title="确定要删除吗?" @confirm="remove(scope.$index)">
+          <template v-slot:reference>
+            <el-link type="danger" :underline="false" icon="el-icon-delete">
+              删除
+            </el-link>
+          </template>
+        </el-popconfirm>
+      </template>
+    </ele-pro-table>
+    <product-list
+      ref="productListRef"
+      classType="1"
+      :is-get-inventory-total="true"
+      @changeParent="changeParent"
+    ></product-list> -->
     <div slot="footer" class="dialog-footer">
       <el-button size="small" @click="submit" type="primary">提 交</el-button>
       <el-button size="small" @click="close">关 闭</el-button>
@@ -115,11 +106,13 @@
   import fileUpload from '@/components/upload/fileUpload';
   import imgUpload from '@/components/upload/imgUpload';
   import { getCode } from '@/api/ruleManagement/matter';
+  import productList from './product-list.vue';
   export default {
     components: {
       fileUpload,
       imgUpload,
-      staffSelection
+      staffSelection,
+      productList
     },
     //注册组件
     data() {
@@ -168,7 +161,49 @@
           ]
         },
         form: { ...defaultForm },
-        title: '新增'
+        title: '新增',
+        columns: [{
+            width: 45,
+            type: 'index',
+            columnKey: 'index',
+            align: 'center',
+            fixed: 'left'
+          },
+          {
+            prop: 'productName',
+            label: '名称',
+            slot: 'productName',
+            headerSlot: 'headerProductName',
+            align: 'center',
+            fixed: 'left'
+          },
+          {
+            prop: 'productCode',
+            label: '编码',
+            slot: 'productCode',
+            align: 'center'
+          },
+          {
+            prop: 'productCategoryName',
+            label: '类型',
+            slot: 'productCategoryName',
+            align: 'center'
+          },
+          {
+            prop: 'specification',
+            label: '规格',
+            slot: 'specification',
+            align: 'center'
+          },
+          {
+          columnKey: 'action',
+          label: '操作',
+          width: 80,
+          align: 'left',
+          resizable: false,
+          slot: 'action',
+          showOverflowTooltip: true
+        }]
       };
     },
     computed: {
@@ -250,7 +285,11 @@
               this.loading = false;
             });
         });
-      }
+      },
+
+      handParent() {
+        this.$refs.productListRef.open(-1);
+      },
     }
   };
 </script>

+ 382 - 0
src/views/documentManagement/certificateManagement/components/product-list.vue

@@ -0,0 +1,382 @@
+<template>
+  <el-dialog
+    title="选择产品"
+    :visible.sync="visible"
+    v-if="visible"
+    :before-close="handleClose"
+    :close-on-click-modal="false"
+    top="5vh"
+    :close-on-press-escape="false"
+    append-to-body
+    width="70%"
+  >
+    <el-card shadow="never">
+      <searchProduct @search="reload"></searchProduct>
+      <ele-split-layout
+        width="244px"
+        allow-collapse
+        :right-style="{ overflow: 'hidden' }"
+      >
+        <div class="ele-border-lighter split-layout-right-content">
+          <productTree
+            @handleNodeClick="handleNodeClick"
+            :isFirstRefreshTable="isFirstRefreshTable"
+            ref="treeList"
+            :ids="ids"
+          />
+        </div>
+        <!-- 表格 -->
+        <template v-slot:content>
+          <ele-pro-table
+            ref="table"
+            :columns="columns"
+            :datasource="datasource"
+            row-key="id"
+            height="calc(100vh - 480px)"
+            class="dict-table"
+            @cell-click="cellClick"
+            :selection.sync="selection"
+            @done="tableDone"
+            :initLoad="!isFirstRefreshTable"
+          >
+            <!-- 表头工具栏 -->
+            <template v-slot:action="{ row }">
+              <el-radio class="radio" v-model="radio" :label="row.code"
+                ><i></i
+              ></el-radio>
+            </template>
+          </ele-pro-table>
+        </template>
+      </ele-split-layout>
+    </el-card>
+
+    <div slot="footer">
+      <el-button type="primary" size="small" @click="selected">选择</el-button>
+      <el-button size="small" @click="handleClose">关闭</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+  import { getList } from '@/api/classifyManage/itemInformation';
+  import searchProduct from './searchProduct.vue';
+  import productTree from './productTree.vue';
+  import { getByCode } from '@/api/system/dictionary-data';
+  import { lbjtList } from '@/enum/dict.js';
+
+  export default {
+    components: {
+      productTree,
+      searchProduct,
+    },
+    props: {
+      /*是否需要获取仓库产品数量*/
+      isGetInventoryTotal: {
+        type: Boolean,
+        default: false
+      },
+      /*已选择的产品*/
+      data: {
+        type: Array,
+        default: () => []
+      },
+      /*是否需要cBom*/
+      isShowCBom: {
+        type: Boolean,
+        default: false
+      },
+      typeIds:{
+        type: Array,
+        default: () => []
+      },
+      isFirstRefreshTable: {
+        type: Boolean,
+        default: false
+      },
+      ids:{
+        type: Array,
+        default: () => []
+      }
+    },
+
+    data() {
+      return {
+        visible: false,
+        currentIndex: null,
+        radio: null,
+        dictList: {},
+        selection: [],
+        ids:[]
+      };
+    },
+    watch: {},
+    computed: {
+      columns() {
+        return [
+          {
+            action: 'action',
+            slot: 'action',
+            align: 'center',
+            label: '选择',
+            reserveSelection: true,
+            show: this.currentIndex != -1
+          },
+          {
+            label: '选择',
+            show: this.currentIndex == -1,
+            width: 45,
+            type: 'selection',
+            columnKey: 'selection',
+            align: 'center',
+            reserveSelection: true
+          },
+          {
+            columnKey: 'index',
+            type: 'index',
+            width: 50,
+            align: 'center',
+            showOverflowTooltip: true,
+            label: '序号'
+          },
+          {
+            prop: 'code',
+            label: '编码',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'name',
+            label: '名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'imgCode',
+            align: 'center',
+            label: '图号/件号',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'componentAttribute',
+            align: 'center',
+            label: '属性类型',
+            showOverflowTooltip: true,
+            formatter: (row, column) => {
+              if(row.produceType){
+                return row.produceType.map(item=>{
+                  return lbjtList[item]
+                }).toString()
+              }
+          
+            },
+            minWidth: 110
+          },
+          // {
+          //   prop: 'extField.approvalNumber',
+          //   align: 'center',
+          //   label: '批准文号',
+          //   showOverflowTooltip: true,
+          //   minWidth: 110
+          // },
+          {
+            prop: 'extField.packingSpecification',
+            align: 'center',
+            label: '包装规格',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'brandNum',
+            align: 'center',
+            label: '牌号',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'modelType',
+            label: '型号',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'specification',
+            label: '规格',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'measuringUnit',
+            label: '计量单位',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 90
+          },
+
+          {
+            prop: 'weightUnit',
+            label: '重量单位',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 90
+          },
+
+          {
+            prop: 'roughWeight',
+            label: '毛重',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 90
+          },
+
+          {
+            prop: 'netWeight',
+            label: '净重',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 90
+          },
+
+          {
+            prop: 'packingUnit',
+            align: 'center',
+            label: '包装单位',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'categoryLevelPath',
+            label: '分类',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+      
+        ];
+      }
+    },
+    methods: {
+      getDictV(code, val) {
+        if (!this.dictList[code]) return '';
+        return this.dictList[code].find((item) => item.value == val)?.label;
+      },
+      async getDictList(code) {
+        let { data: res } = await getByCode(code);
+        this.dictList[code] = res.map((item) => {
+          let values = Object.keys(item);
+          return {
+            value: values[0],
+            label: item[values[0]]
+          };
+        });
+      },
+      open(currentIndex) {
+        this.currentIndex = currentIndex;
+        this.visible = true;
+        this.getDictList('productionType');
+      },
+      /* 表格数据源 */
+      datasource({ page, limit, where, order }) {
+        return getList({
+          pageNum: page,
+          size: limit,
+          ...where
+        });
+      },
+
+      /* 刷新表格 */
+      reload(where) {
+        where.categoryLevelId = this.curNodeData?.id;
+
+        this.$refs.table.reload({ pageNum: 1, where: where });
+      },
+
+      handleNodeClick(data, node) {
+        this.curNodeData = data;
+        this.$nextTick(()=>{
+          this.reload({ categoryLevelId: data.id });
+        })
+      },
+
+      // 单击获取id
+      cellClick(row) {
+        if (this.currentIndex == -1) return;
+        this.current = row;
+        this.radio = row.id;
+      },
+      getSelectionCbom(rows = []) {
+        this.$emit('getSelectionCbom', rows);
+        this.handleClose();
+      },
+      handleClose() {
+        this.visible = false;
+        this.current = null;
+        this.selection = [];
+        this.$refs.table.clearSelection();
+        this.radio = '';
+      },
+
+      async selected() {
+        if (!this.current && !this.selection.length) {
+          return this.$message.warning('请至少选择一条数据');
+        }
+        if (this.currentIndex != -1) {
+          if (
+            this.data
+              .map((item) => item.productCode)
+              .includes(this.current.code)
+          ) {
+            return this.$message.error('选择的物品已经存在列表了');
+          }
+        } else {
+          if (
+            this.selection.some((item) =>
+              this.data.some((i) => i.productCode == item.code)
+            )
+          ) {
+            return this.$message.error('选择的物品已经存在列表了');
+          }
+        }
+
+        let list = this.currentIndex == -1 ? this.selection : [this.current];
+        console.log(list,'list')
+        this.$emit('changeParent', list, this.currentIndex);
+        this.handleClose();
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+:deep(.success-row) {
+    background: #f0f9eb;
+  }
+    .tree_col {
+    border: 1px solid #eee;
+    padding: 10px 0;
+    box-sizing: border-box;
+    height: 500px;
+    overflow: auto;
+  }
+
+  .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;
+  }
+
+  .topsearch {
+    margin-bottom: 15px;
+  }
+</style>

+ 187 - 0
src/views/documentManagement/certificateManagement/components/productTree.vue

@@ -0,0 +1,187 @@
+<template>
+  <div class="tree-wrapper">
+    <el-tree
+      :data="treeList"
+      :props="defaultProps"
+      v-loading="treeLoading"
+      :node-key="nodeKey"
+      ref="tree"
+      :highlight-current="true"
+      :expand-on-click-node="false"
+      @node-click="handleNodeClick"
+      :default-expanded-keys="defaultExpandedKeys"
+      v-bind="$attrs"
+      :default-expand-all="defaultExpandAll"
+    >
+    </el-tree>
+  </div>
+</template>
+
+<script>
+  import { getInfoByIds,getTreeByIds, getTreeByGroup } from '@/api/classifyManage/index';
+  // let originId = '';
+  // let originType = '';
+  export default {
+    props: {
+      // treeList私有化处理
+      treeFormate: {
+        type: Function,
+        default: null
+      },
+      defaultProps: {
+        type: Object,
+        default: function () {
+          return {
+            children: 'children',
+            value: 'id',
+            label: 'name'
+          };
+        }
+      },
+      defaultExpandAll: {
+        type: Boolean,
+        default: function () {
+          return false;
+        }
+      },
+      // 初始请求treeList
+      init: {
+        type: Boolean,
+        default: true
+      },
+
+      isFirstRefreshTable: {
+        type: Boolean,
+        default: true
+      },
+      id: {
+        type: String,
+        default: '0'
+      },
+      nodeKey: {
+        type: String,
+        default: 'id'
+      },
+      typeIds: {
+        type: Array,
+        default: () => []
+      },
+      ids:{
+        type: Array,
+        default: () => []
+      }
+      // appendRoot: {
+      //   type: Boolean,
+      //   default: false
+      // },
+    },
+    data() {
+      return {
+        defaultExpandedKeys: [],
+        treeList: [],
+        treeLoading: false,
+        parentName: '',
+        parentId: '',
+        currentKey: ''
+      };
+    },
+    mounted() {
+      if (this.init) {
+        this.getTreeData();
+      }
+    },
+    methods: {
+      getInstance() {
+        return this.$refs.tree;
+      },
+      // 获取树结构数据
+      async getTreeData(params = {}) {
+        try {
+          this.treeLoading = true;
+          let data = {};
+          if (this.typeIds.length > 0) {
+            let res = await getInfoByIds(this.typeIds.toString());
+            data= res.data
+          }else if(this.ids.length > 0){
+            let res = await getTreeByIds({ ids: this.ids.join(',') });
+            data= res.data
+
+          } else {
+            params.type = 1
+            data = await getTreeByGroup(params);
+          }
+          console.log(data,'data')
+          this.treeLoading = false;
+          // this.$emit('setRootId', data[0].id);
+          this.treeList = this.$util.toTreeData({
+            data: data || [],
+            idField: 'id',
+            parentIdField: 'parentId'
+          });
+          this.defaultExpandedKeys = [this.treeList[0].id || ''];
+          this.$nextTick(() => {
+            // 默认高亮第一级树节点
+            if (this.treeList[0] && this.isFirstRefreshTable) {
+              this.setCurrentKey(this.treeList[0].id);
+              this.handleNodeClick(
+                this.treeList[0],
+                this.$refs.tree.getCurrentNode()
+              );
+            }
+          });
+          return this.treeList;
+        } catch (error) {
+          console.error(error);
+        }
+        this.treeLoading = false;
+      },
+      // 递归 - 往树children里面添加parentName
+      // _setParentName (tree) {
+      //   let data = tree;
+      //   for (let i = 0; i < data.length; i++) {
+      //     if (data[i].parentId === '0') {
+      //       this.parentName = data[i].name;
+      //       originId = data[i].id;
+      //       originType = data[i].type;
+      //     }
+
+      //     data[i]['originId'] = originId;
+      //     data[i]['originType'] = originType;
+      //     data[i]['parentId'] = data[i]['parentId'];
+      //     if (data[i].children && data[i].children.length > 0) {
+      //       this._setParentName(data[i].children);
+      //     }
+      //   }
+      //   return data;
+      // },
+
+      handleNodeClick(data, node) {
+        this.$emit('handleNodeClick', data, node);
+      },
+      // 设置默认高亮行
+      setCurrentKey(id) {
+        this.currentKey = id;
+        this.$refs.tree.setCurrentKey(this.currentKey);
+      },
+
+      // 获取树的选中状态
+      getSelectList() {
+        const selectList = this.$refs.tree.getCurrentNode();
+        return selectList;
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .tree-wrapper {
+    width: 100%;
+    height: 100%;
+    overflow: auto;
+
+    :deep(.el-tree) {
+      display: inline-block;
+      min-width: 100%;
+    }
+  }
+</style>

+ 139 - 0
src/views/documentManagement/certificateManagement/components/searchProduct.vue

@@ -0,0 +1,139 @@
+<!-- 搜索表单 -->
+<template>
+  <el-form
+    size="small"
+    label-width="60px"
+    class="ele-form-search"
+    @keyup.enter.native="search"
+    @submit.native.prevent
+  >
+    <el-row :gutter="10">
+      <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
+        <el-form-item label="编码">
+          <el-input
+            clearable
+            size="small"
+            v-model="where.code"
+            placeholder="请输入"
+          />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
+        <el-form-item label="名称">
+          <el-input
+            clearable
+            size="small"
+            v-model="where.name"
+            placeholder="请输入"
+          />
+        </el-form-item>
+      </el-col>
+
+      <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
+        <el-form-item label="型号">
+          <el-input
+            clearable
+            size="small"
+            v-model="where.modelType"
+            placeholder="请输入"
+          />
+        </el-form-item>
+      </el-col>
+
+      <el-col v-bind="styleResponsive ? { md: 6 } : { span: 4 }">
+        <el-form-item>
+          <el-button
+            size="small"
+            type="primary"
+            icon="el-icon-search"
+            class="ele-btn-icon"
+            @click="search"
+          >
+            查询
+          </el-button>
+
+          <el-button
+            @click="reset"
+            icon="el-icon-refresh"
+            class="ele-btn-icon"
+            size="medium"
+            >重置</el-button
+          >
+          <slot></slot>
+        </el-form-item>
+      </el-col>
+    </el-row>
+    <el-row :gutter="10">
+      <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
+        <el-form-item label="牌号">
+          <el-input
+            clearable
+            size="small"
+            v-model="where.brandNum"
+            placeholder="请输入"
+          />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
+        <el-form-item label="规格">
+          <el-input
+            clearable
+            size="small"
+            v-model="where.specification"
+            placeholder="请输入"
+          />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
+        <el-form-item label="关键字">
+          <el-input
+            clearable
+            size="small"
+            v-model="where.searchKey"
+            placeholder="请输入"
+          />
+        </el-form-item>
+      </el-col>
+      
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+  export default {
+    data() {
+      // 默认表单数据
+      const defaultWhere = {
+        name: '',
+        code: '',
+        brandNum: '',
+        modelType: '',
+        specification: '',
+        searchKey:''
+      };
+      return {
+        defaultWhere,
+        // 表单数据
+        where: { ...defaultWhere },
+        loading: false
+      };
+    },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
+    methods: {
+      /* 搜索 */
+      search() {
+        this.$emit('search', this.where);
+      },
+      /*  重置 */
+      reset() {
+        this.where = { ...this.defaultWhere };
+        this.search();
+      }
+    }
+  };
+</script>

+ 61 - 4
src/views/technology/production/index.vue

@@ -2,7 +2,10 @@
   <div class="ele-body">
     <el-card shadow="never">
       <!-- 搜索表单 -->
-      <user-search @search="reload" />
+      <!-- <user-search @search="reload" /> -->
+      <seek-page :seekList="seekList" @search="reload"></seek-page>
+ 
+
       <!-- 数据表格 -->
       <ele-pro-table ref="table" :columns="columns" :datasource="datasource" :selection.sync="selection" row-key="id" :pageSize="this.$store.state.tablePageSize" @columns-change="handleColumnChange"
       :cache-key="cacheKeyUrl">
@@ -80,6 +83,7 @@ import SampleParam from './components/sampleParam.vue'
 import producetask from '@/api/technology/production';
 import control from '@/api/technology/control';
 import importDialog from "@/components/upload/import-dialog.vue";
+import work from '@/api/technology/work';
 
 export default {
   name: 'technologyProduction',
@@ -169,7 +173,6 @@ export default {
       showSetting: false,
       controlList: [],
 
-
       typeList: [
         {
           value: 1,
@@ -201,8 +204,54 @@ export default {
       sampleShow: false,
       taskId: null,
       cacheKeyUrl: 'abfad404-technology-production',
+      controlListNewList: [], //给公共组件使用
+      workCenterList:[], //工作中心列表
+
     };
   },
+  computed: {
+    seekList() {
+      return [
+        {
+          label: "工序编码:",
+          value: "code",
+          type: "input",
+          placeholder: '',
+        },
+        {
+          label: "工序名称:",
+          value: "name",
+          type: "input",
+          placeholder: '',
+        },
+        {
+          label: "控制码:",
+          value: "controlId",
+          type: "select",
+          placeholder: '',
+          planList: this.controlListNewList
+        },
+        {
+          label: "工序类型:",
+          value: "type",
+          type: "select",
+          placeholder: '',
+          planList: this.typeList
+        },
+        {
+          label: "工作中心:",
+          value: "workCenterId",
+          type: "select",
+          placeholder: '',
+          planList: this.workCenterList
+        },
+      ]
+    }
+  },
+  created() {
+    this.getControlList()
+    this.getListWorkCenter()
+  },
   methods: {
 
     typeLabel(type) {
@@ -243,7 +292,8 @@ export default {
         pageNum: 1, size: -1
       }
       control.list().then(res => {
-        this.controlList = res.list
+        this.controlList = res.list;
+        this.controlListNewList = res.list.map(m => ({ label: m.name, value: m.id }));
       })
     },
 
@@ -299,7 +349,14 @@ export default {
     },
     uploadFile () {
       this.$refs.importDialogRef.open();
-    }
+    },
+
+    // 获取工作中心
+    getListWorkCenter() {
+        work.list({ pageNum: 1, size: -1 }).then((res) => {
+          this.workCenterList = res.list.map((m) => ({ label: m.name, value: m.id }));
+        });
+      },
   }
 };
 </script>