Browse Source

Merge remote-tracking branch 'origin/dev' into flowable

# Conflicts:
#	src/enum/dict.js
#	vue.config.js
qihao 2 years ago
parent
commit
864800c4de
50 changed files with 2635 additions and 3737 deletions
  1. 1 1
      .env
  2. BIN
      public/logo.png
  3. 38 0
      src/api/material/BOM.js
  4. 1 1
      src/api/material/list.js
  5. 36 0
      src/api/material/product.js
  6. 2 2
      src/api/workforceManagement/team.js
  7. 274 0
      src/components/select/bom/ProductModal.vue
  8. 102 0
      src/components/select/bom/product-search.vue
  9. 1 0
      src/enum/dict.js
  10. 7 0
      src/layout/index.vue
  11. 0 434
      src/views/classifyManage/itemInformation/add.vue
  12. 0 294
      src/views/classifyManage/itemInformation/components/AddDialog.vue
  13. 0 122
      src/views/classifyManage/itemInformation/components/ItemDetail.vue
  14. 0 302
      src/views/classifyManage/itemInformation/components/ItemForm.vue
  15. 0 202
      src/views/classifyManage/itemInformation/components/RowDetail.vue
  16. 0 353
      src/views/classifyManage/itemInformation/components/RowForm.vue
  17. 0 250
      src/views/classifyManage/itemInformation/components/item-list.vue
  18. 0 394
      src/views/classifyManage/itemInformation/components/item-match.vue
  19. 0 78
      src/views/classifyManage/itemInformation/components/item-search.vue
  20. 0 237
      src/views/classifyManage/itemInformation/components/match-mixins.js
  21. 0 411
      src/views/classifyManage/itemInformation/details.vue
  22. 0 112
      src/views/classifyManage/itemInformation/index.vue
  23. 9 1
      src/views/classifyManage/treeClassify/components/list-edit.vue
  24. 1 1
      src/views/factoryModel/station/components/edit.vue
  25. 80 9
      src/views/material/materialBOM/components/edit-dialog.vue
  26. 12 10
      src/views/material/materialBOM/components/view-dialog.vue
  27. 55 35
      src/views/material/product/components/MaterialAdd.vue
  28. 271 102
      src/views/material/product/components/MaterialModal.vue
  29. 29 2
      src/views/material/product/components/MoldInfo.vue
  30. 2 26
      src/views/material/product/components/TurnoverInfo.vue
  31. 449 0
      src/views/material/product/components/aridRegion.vue
  32. 1 1
      src/views/material/product/components/codeDialog.vue
  33. 442 0
      src/views/material/product/components/goodsAllocation.vue
  34. 37 5
      src/views/material/product/components/index-data.vue
  35. 12 8
      src/views/material/product/components/index-search.vue
  36. 8 0
      src/views/material/product/detail.vue
  37. 9 8
      src/views/system/dictionary/components/dict-edit.vue
  38. 1 1
      src/views/system/menu/index.vue
  39. 51 3
      src/views/system/organization/components/org-edit.vue
  40. 7 0
      src/views/system/organization/components/org-select.vue
  41. 234 289
      src/views/system/organization/components/org-user-edit.vue
  42. 333 0
      src/views/system/organization/components/staffSelection.vue
  43. 2 1
      src/views/system/organization/index.vue
  44. 40 19
      src/views/technology/production/components/user-search.vue
  45. 1 1
      src/views/technology/production/index.vue
  46. 60 6
      src/views/technology/route/components/production/index.vue
  47. 1 1
      src/views/technology/route/components/user-edit.vue
  48. 19 9
      src/views/workforceManagement/classes/components/timeTable.vue
  49. 2 1
      src/views/workforceManagement/team/components/edit.vue
  50. 5 5
      src/views/workforceManagement/team/components/staffSelection.vue

+ 1 - 1
.env

@@ -1,2 +1,2 @@
-VUE_APP_NAME=基础数据平台
+VUE_APP_NAME=工业互联网平台
 VUE_APP_API_BASE_URL=/api

BIN
public/logo.png


+ 38 - 0
src/api/material/BOM.js

@@ -75,3 +75,41 @@ export async function getVersionCode (categoryId) {
 
 
 
+// 工序列表  保存
+
+export async function saveBatch (data) {
+  const res = await request.post(`/main/bomtask/saveBatch`, data);
+  if (res.data.code == 0) {
+    return res.data.message;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 工序列表
+
+export async function bomTaskList (categoryId) {
+  const res = await request.get(`/main/bomtask/list/${categoryId}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+//  bom工序信息 删除
+export async function bomTaskDelete (data) {
+  const res = await request.delete(`/main/bomtask/delete`, { data });
+  if (res.data.code == 0) {
+    return res.data.message;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 获取工序下的产品bom信息
+
+export async function getByTaskId (categoryId, taskId) {
+  const res = await request.get(`main/category/getCategoryBomByTaskId/${categoryId}/${taskId}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 1 - 1
src/api/material/list.js

@@ -12,7 +12,7 @@ export async function getGroupPage(data) {
 }
 
 
-//  ==========  删除物料管理, 用到得相关接口,移到这     =============/
+//  ==========  物料管理   =============/
 
 
 // 根据分类组编码查询分类树信息

+ 36 - 0
src/api/material/product.js

@@ -38,3 +38,39 @@ export async function getCategoryBom (categoryId) {
   return Promise.reject(new Error(res.data.message));
 }
 
+// 周转车 货位
+export async function categoryVehicle (data) {
+  const res = await request.post(`/main/categoryvehicle/save`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+export async function categoryVehicleList (id) {
+  const res = await request.get(`/main/categoryvehicle/getByCategoryId/${id}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 干燥区 库位
+
+export async function aridRegion (data) {
+  const res = await request.post(`/main/aridregion/save`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+export async function aridRegionList (id) {
+  const res = await request.get(`/main/aridregion/getByCategoryId/${id}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+

+ 2 - 2
src/api/workforceManagement/team.js

@@ -16,8 +16,8 @@ export async function listFactoryLineByParentId(params) {
     return Promise.reject(new Error(res.data.message));
 }
 
-export async function listFactoryLine() {
-    const res = await request.get(`/main/factoryarea/listFactoryLine`);
+export async function listFactoryLine(data) {
+    const res = await request.post(`/main/factoryarea/listFactoryLine`,data);
     if (res.data.code == 0) {
         return res.data.data;
     }

+ 274 - 0
src/components/select/bom/ProductModal.vue

@@ -0,0 +1,274 @@
+<template>
+  <el-dialog :title="title" :visible.sync="visible" v-if="visible" :before-close="handleClose"
+    :close-on-click-modal="false" :close-on-press-escape="false" append-to-body width="75%">
+    <el-card shadow="never">
+      <ProductSearch @search="reload" ref="searchRef" />
+
+      <ele-split-layout width="244px" allow-collapse :right-style="{ overflow: 'hidden' }">
+        <div class="ele-border-lighter split-layout-right-content">
+          <el-tree :data="treeList" :props="defaultProps" ref="treeRef"
+            :default-expanded-keys="current && current.id ? [current.id] : []" :highlight-current="true" node-key="id"
+            @node-click="handleNodeClick"></el-tree>
+        </div>
+        <!-- 表格 -->
+        <template v-slot:content>
+          <ele-pro-table ref="table" :columns="columns" :datasource="datasource" row-key="id" height="calc(100vh - 350px)"
+            class="dict-table" @cell-click="cellClick">
+            <!-- 表头工具栏 -->
+            <template v-slot:action="{ row }">
+              <el-radio class="radio" v-model="radio" :label="row.id"><i></i></el-radio>
+            </template>
+          </ele-pro-table>
+        </template>
+      </ele-split-layout>
+    </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 ProductSearch from './product-search.vue'
+import { getMaterialList } from '@/api/material/list.js';
+import { getTreeByGroup } from '@/api/classifyManage';
+export default {
+  components: { ProductSearch },
+  data() {
+    return {
+      visible: false,
+
+      // 表格列配置
+      columns: [
+        {
+          columnKey: 'index',
+          type: 'index',
+          width: 45,
+          align: 'center',
+          reserveSelection: true
+        },
+        {
+          prop: 'code',
+          label: '编码'
+        },
+        {
+          prop: 'name',
+          label: '名称',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'brandNum',
+          label: '牌号'
+        },
+
+        {
+          prop: 'modelType',
+          label: '型号',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'specification',
+          label: '规格',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'measuringUnit',
+          label: '计量单位',
+          showOverflowTooltip: true,
+          minWidth: 90
+        },
+
+        {
+          prop: 'weightUnit',
+          label: '重量单位',
+          showOverflowTooltip: true,
+          minWidth: 90
+        },
+
+        {
+          prop: 'roughWeight',
+          label: '毛重',
+          showOverflowTooltip: true,
+          minWidth: 90
+        },
+
+        {
+          prop: 'netWeight',
+          label: '净重',
+          showOverflowTooltip: true,
+          minWidth: 90
+        },
+
+
+        {
+          prop: 'packingUnit',
+          align: 'center',
+          label: '包装单位',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'categoryLevelPath',
+          label: '分类',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+
+        {
+          action: 'action',
+          slot: 'action',
+          align: 'center',
+          label: '选择'
+        }
+      ],
+      title: null,
+      categoryLevelId: null,
+      radio: null,
+      idx: null,
+
+      isCategory: true,
+
+      current: {},
+
+      treeList: [],
+      treeLoading: false,
+
+      defaultProps: {
+        children: 'children',
+        label: 'name'
+      }
+    }
+  },
+
+  watch: {
+
+  },
+  methods: {
+    /* 表格数据源 */
+    datasource({ page, where, limit }) {
+      return getMaterialList({
+        ...where,
+        pageNum: page,
+        size: limit,
+        categoryLevelId: this.isCategory ? this.categoryLevelId : null,
+
+      });
+    },
+    handleNodeClick(data) {
+      this.isCategory = true
+      this.categoryLevelId = data.id;
+      this.$refs.table.reload({ pageNum: 1, where: {} });
+      this.$refs.searchRef.reset2()
+
+
+    },
+    /* 刷新表格 */
+    reload(where) {
+      this.isCategory = false
+      this.$refs.table.reload({ pageNum: 1, where: where });
+    },
+    open(item, title, type, idx) {
+      if (item) {
+        this.title = title
+        this.type = type
+        this.idx = idx
+
+        this.current = {
+          id: item.categoryId,
+          name: item.categoryName,
+          code: item.categoryCode
+        }
+        this.radio = item.categoryId
+
+        this.getTreeData();
+
+      }
+      this.visible = true
+    },
+
+
+    async getTreeData() {
+      try {
+        this.treeLoading = true;
+
+        const res = await getTreeByGroup({ type: this.type });
+        this.treeLoading = false;
+        if (res?.code === '0') {
+          this.treeList = res.data;
+
+          this.$nextTick(() => {
+            // 默认高亮第一级树节点
+            if (this.treeList[0]) {
+              this.rootTreeId = this.treeList[0].id
+              this.$nextTick(() => {
+                this.$refs.treeRef.setCurrentKey(this.treeList[0].id);
+              });
+
+            }
+          });
+          return this.treeList;
+        }
+      } catch (error) { }
+      this.treeLoading = false;
+    },
+
+
+
+
+
+
+    // 单击获取id
+    cellClick(row) {
+      this.current = row
+      this.radio = row.id
+    },
+    handleClose() {
+      this.visible = false
+      this.current = null
+      this.radio = ''
+    },
+    selected() {
+      if (!this.current) {
+        return this.$message.warning('请选择工作中心')
+      }
+      this.$emit('changeProduct', this.title, this.current, this.idx)
+      this.handleClose()
+    },
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.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>

+ 102 - 0
src/components/select/bom/product-search.vue

@@ -0,0 +1,102 @@
+<!-- 搜索表单 -->
+<template>
+  <el-form
+    label-width="77px"
+    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 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 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 v-model="where.modelType" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { md: 4 } : { md: 4 }">
+        <div class="ele-form-actions">
+          <el-button
+            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
+          >
+        </div>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+  export default {
+    data () {
+      // 默认表单数据
+      const defaultWhere = {
+        name: '',
+        code: '',
+        modelType: ''
+      };
+      return {
+        defaultWhere,
+        // 表单数据
+        where: { ...defaultWhere },
+        treeData:[]
+      };
+    },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive () {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
+    created() {
+    },
+    methods: {
+
+      /* 搜索 */
+      search () {
+        if (this.where.appType === 0) {
+          this.where.appType = '';
+        }
+        this.$emit('search', this.where);
+      },
+      /*  重置 */
+      reset () {
+        this.where = { ...this.defaultWhere };
+        this.search();
+      },
+      reset2 () {
+        this.where = { ...this.defaultWhere };
+
+      }
+    }
+  };
+</script>
+
+<style>
+  .ele-form-actions {
+    display: inline-block;
+    transform: translate(0);
+    transition: all;
+  }
+</style>

+ 1 - 0
src/enum/dict.js

@@ -38,6 +38,7 @@ export default {
   工艺参数单位: 'parameter_code',
   成型剂类别: 'forming_code',
   工位编码: 'Station coding',
+  机构类型: 'group_type',
   工作流任务分配规则的类型: 'bpm_task_assign_rule_type',
   工作流任务分配自定义脚本: 'bpm_task_assign_script'
 };

+ 7 - 0
src/layout/index.vue

@@ -340,4 +340,11 @@
       }
     }
   }
+
+  .ele-admin-layout .ele-admin-logo img  {
+    height: auto !important;
+    width: 80px !important;
+    margin-right: 5px;
+    max-height: 35px
+  }
 </style>

+ 0 - 434
src/views/classifyManage/itemInformation/add.vue

@@ -1,434 +0,0 @@
-<template>
-  <div class="ele-body">
-    <el-card shadow="never">
-      <div class="page-title">
-        <el-page-header @back="goBack">
-          <div slot="content" class="pageContent">
-            <div>{{ pageTitle }}</div>
-            <el-form class="topform">
-              <el-form-item label="物品类型" label-width="70px">
-                <el-select
-                  v-model="defaultNum"
-                  placeholder="请选择"
-                  :disabled="uneditable"
-                >
-                  <el-option
-                    v-for="item in typeList"
-                    :key="item.id"
-                    :label="item.value"
-                    :value="item.code"
-                    @click.native="chooseItem(item)"
-                  >
-                  </el-option>
-                </el-select>
-              </el-form-item>
-            </el-form>
-          </div>
-        </el-page-header>
-      </div>
-      <div class="table-container">
-        <div class="tree-col">
-          <ItemForm
-            ref="itemFormRef"
-            :itemForm="itemForm"
-            :prefix="prefix"
-            :defaultNum="defaultNum"
-          />
-        </div>
-        <div class="attribute-row">
-          <RowForm
-            ref="customFormRef"
-            :itemForm="itemForm"
-            :defaultNum="defaultNum"
-          />
-          <div
-            class="row-table"
-            v-if="defaultNum != '8' && defaultNum != '2' && defaultNum != '5'"
-          >
-            <ItemMatch
-              ref="itemMatchRef"
-              :defaultNum="defaultNum"
-              :typeList="typeList"
-            ></ItemMatch>
-          </div>
-          <div class="page-footer-btn mt20">
-            <el-button @click="goBack">取消</el-button>
-            <el-button type="primary" @click="submit">确定</el-button>
-          </div>
-        </div>
-      </div>
-    </el-card>
-  </div>
-</template>
-
-<script>
-  import ItemForm from './components/ItemForm';
-  import RowForm from './components/RowForm';
-  import ItemMatch from './components/item-match';
-  import dictMixins from '@/mixins/dictMixins';
-  import {
-    informationAdd,
-    getDetails,
-    informationEdit
-  } from '@/api/classifyManage/itemInformation';
-  import { getCode } from '@/api/codeManagement';
-  export default {
-    components: { ItemForm, RowForm, ItemMatch },
-    mixins: [dictMixins],
-    data () {
-      return {
-        pageTitle: '',
-        itemForm: {
-          categoryLevelPathId: [],
-          addList: [],
-          info: {
-            angle: 'notA'
-          },
-          unpack: 0,
-          urlIdList: [],
-          univalenceUnit: 'yuan',
-          expirationDateUnit: 'minute',
-          takeStockPattern: 1
-        },
-        defaultNum: '1',
-        selectNode: null,
-        classList: [],
-        changeData: [],
-        urlIdList: [],
-        requestData: {},
-        uneditable: false,
-        newCode: ''
-      };
-    },
-    computed: {
-      prefix () {
-        const obj =
-          (this.dict[this.dictEnum['分类编号']] || []).find(
-            (itm) => itm.dictCode === this.defaultNum
-          ) || {};
-        return obj && obj.dictValue;
-      },
-      typeList () {
-        const noList = this.dict[this.dictEnum['分类编号']] || [];
-
-        return (this.dict[this.dictEnum['类型用途']] || []).map((item) => {
-          const obj =
-            noList.find((itm) => itm.dictCode === item.dictCode) || {};
-          return {
-            ...item,
-            value: `${obj.dictValue} ${item.dictValue}`,
-            name: item.dictValue,
-            prefix: obj.dictValue,
-            code: item.dictCode
-          };
-        });
-      }
-    },
-    async created () {
-      await this.requestDict('分类编号');
-      await this.requestDict('类型用途');
-      this.pageTitle = this.$route.query.pageTitle;
-      if (this.pageTitle == '新建物品') {
-        this.selectNode = JSON.parse(this.$route.query.selectNode);
-        console.log('selectNode', this.selectNode);
-        if (this.selectNode) {
-          this.itemForm.categoryLevelPathId = this.selectNode.id;
-          if (this.selectNode.id != '0') {
-            this.defaultNum = this.selectNode.type;
-            this.setDefault(this.defaultNum);
-          }
-          this.itemForm.urlIdList = this.selectNode.urlIdList;
-        }
-      } else {
-        this.getDetilInfo(this.$route.query.id);
-      }
-      if (this.pageTitle == '编辑物品') {
-        this.uneditable = true;
-      } else {
-        this.uneditable = false;
-        this.getOrderCode();
-      }
-    },
-    methods: {
-      async getOrderCode () {
-        const data = await getCode('material_management');
-        this.newCode = data;
-        this.$set(this.itemForm, 'itemCode', data);
-      },
-
-      // 在 Input 值改变时触发
-      handleEdit (e) {
-        let value = e.replace(/^(0+)|[^\d]+/g, ''); // 以0开头或者输入非数字,会被替换成空
-        value = value.replace(/(\d{15})\d*/, '$1'); // 最多保留15位整数
-      },
-      goBack () {
-        this.$router.go(-1);
-      },
-
-      // 获取详情
-      async getDetilInfo (id) {
-        const data = await getDetails(id);
-        this.chooseItem({ code: data.type });
-        this.itemForm = data;
-        if (data.univalence) {
-          this.$set(this.itemForm, 'univalence', data.univalence);
-        } else {
-          this.$set(this.itemForm, 'univalence', 'null');
-        }
-        if (data.expirationDate) {
-          this.$set(this.itemForm, 'expirationDate', data.expirationDate);
-        } else {
-          this.$set(this.itemForm, 'expirationDate', 'null');
-        }
-        this.$set(
-          this.itemForm,
-          'info',
-          data.extendField ? JSON.parse(data.extendField) : { angle: 'notA' }
-        );
-        this.$set(this.itemForm, 'name', data.name);
-        this.$set(
-          this.itemForm,
-          'addList',
-          data.selfDefinedParameter ? JSON.parse(data.selfDefinedParameter) : []
-        );
-        this.itemForm.urlIdList = data.categoryLevelPathId
-          ? JSON.parse(data.categoryLevelPathId)
-          : [];
-        if (this.pageTitle == '编辑物品') {
-          // this.itemForm.itemCode = data.code.substring(3)
-          this.$set(this.itemForm, 'itemCode', data.code.substring(3));
-        } else {
-          this.$set(this.itemForm, 'isCitation', false);
-          this.$set(this.itemForm, 'itemCode', this.newCode);
-        }
-        this.$set(this.itemForm, 'unpack', data.unpack);
-        // this.itemForm.isTransferAssets = data.isTransferAssets
-        //   ? 'true'
-        //   : 'false';
-        for (const key in this.itemForm.categoryVoRelationMap) {
-          this.$refs.itemMatchRef &&
-            this.$refs.itemMatchRef.matchList(
-              key,
-              this.itemForm.categoryVoRelationMap
-            );
-        }
-
-        console.log(this.itemForm, 'itemForm');
-      },
-
-      // 改变物品类型
-      chooseItem (item) {
-        this.defaultNum = item.code;
-        this.initItemForm();
-        this.$refs.itemFormRef.$refs.formName.resetFields();
-        this.getOrderCode();
-        this.itemForm.type = item.code;
-        this.selectNode = null;
-        this.setDefault(item.code);
-      },
-
-      submit () {
-        const a1 = new Promise((resolve, reject) => {
-          this.$refs.itemFormRef.validateForm((valid) => {
-            if (valid) resolve();
-          });
-        });
-        const a2 = new Promise((resolve, reject) => {
-          this.$refs.customFormRef.validateForm((valid) => {
-            if (valid) resolve();
-          });
-        });
-        Promise.all([a1, a2]).then(() => {
-          this.$refs.itemMatchRef && this.$refs.itemMatchRef.mapAddList();
-
-          this.requestData = this.itemForm;
-          const { pathName, pathId } = this.$refs.itemFormRef.getText();
-          this.requestData.categoryLevelPath = pathName;
-          this.requestData.categoryLevelId = pathId;
-          this.requestData.type = this.defaultNum;
-          this.requestData.selfDefinedParameter = JSON.stringify(
-            this.requestData.addList
-          );
-          this.requestData.extendField = JSON.stringify(this.requestData.info);
-          this.requestData.code = this.prefix + this.requestData.itemCode;
-          this.requestData.classificationCode = this.defaultNum;
-          this.requestData.categoryLevelPathId = JSON.stringify(
-            this.requestData.urlIdList
-          );
-          this.requestData.expirationDate = this.itemForm.expirationDate
-            ? this.itemForm.expirationDate
-            : null;
-          this.requestData.univalence = this.itemForm.univalence
-            ? this.itemForm.univalence
-            : null;
-          this.requestData.categoryRelationPoList = (
-            (this.$refs.itemMatchRef && this.$refs.itemMatchRef.getMapList()) ||
-            []
-          ).map((i) => ({
-            ...i,
-            categoryId: i.id,
-            mainCategoryId: this.$route.query.id || ''
-          }));
-
-          //不传报错
-          this.requestData.iotProductSchema = '{}';
-          if (this.pageTitle == '编辑物品') {
-            this.requestData.id = this.$route.query.id;
-            delete this.requestData.categoryVoRelationMap;
-            this.$confirm(
-              '参数信息有变更,与当前已存在的台账信息参数不一致,确定后将同步已存在的台账信息参数 !',
-              '重要提示!',
-              {
-                confirmButtonText: '确定',
-                cancelButtonText: '取消',
-                type: 'warning',
-                center: true
-              }
-            )
-              .then(() => {
-                informationEdit(this.requestData).then((res) => {
-                  this.$message.success('物品编辑成功');
-                  this.$router.push({
-                    path: '/classifyManage/itemInformation'
-                  });
-                });
-              })
-              .catch(() => {});
-          } else {
-            informationAdd(this.requestData).then((res) => {
-              this.$message.success('物品新增成功');
-              this.$router.push({
-                path: '/classifyManage/itemInformation'
-              });
-            });
-          }
-        });
-      },
-
-      convertTreeData (data) {
-        this.changeData = data;
-        for (let i = 0; i < this.changeData.length; i++) {
-          if (this.changeData[i].children != undefined) {
-            const temp = this.changeData[i].children;
-            delete this.changeData[i].children;
-            this.changeData = this.changeData.concat(temp);
-          }
-        }
-      },
-
-      setDefault (val) {
-        this.$refs.itemMatchRef && this.$refs.itemMatchRef.setDefault(val);
-      },
-
-      initItemForm () {
-        this.itemForm = {
-          categoryLevelPathId: [],
-          addList: [],
-          info: { angle: 'notA' },
-          urlIdList: [],
-          univalenceUnit: 'yuan',
-          expirationDateUnit: 'minute',
-          takeStockPattern: 1
-        };
-      }
-    }
-  };
-</script>
-
-<style lang="scss" scoped>
-  .ele-body {
-    :deep(.page-title) {
-      border-bottom: 1px solid #eaeefb;
-      padding-bottom: 8px;
-      margin-bottom: 16px;
-      display: flex;
-      align-items: center;
-      .el-page-header__left {
-        display: flex;
-        align-items: center;
-      }
-      .pageContent {
-        display: flex;
-        align-items: center;
-        font-size: 18px;
-        color: #303133;
-        .topform {
-          // margin: 5px 0 0 30px;
-          margin-left: 30px;
-          display: flex;
-          align-items: center;
-
-          .el-form-item {
-            margin-bottom: 0;
-          }
-        }
-      }
-    }
-    .table-container {
-      flex: 1;
-      display: flex;
-      overflow: hidden;
-      .tree-col {
-        margin-right: 10px;
-        width: 30%;
-        min-width: 250px;
-        overflow: auto;
-        padding: 20px 20px 20px 0px;
-        background-color: #fff;
-        margin-top: 10px;
-        border: 1px solid #e6ebf5;
-        border-radius: 4px;
-        box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
-      }
-    }
-
-    :deep(.attribute-row) {
-      padding: 20px 5px;
-      background: #fff;
-      margin-top: 10px;
-      overflow: auto;
-      width: 70%;
-      border: 1px solid #e6ebf5;
-      border-radius: 4px;
-      box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
-      position: relative;
-      .row-table {
-        width: 100%;
-        margin: 20px auto 80px;
-        .table-box {
-          width: 100%;
-          margin: 10px auto;
-          // max-height:400px;
-          // overflow-y: auto;
-        }
-        .bom-top {
-          width: 100%;
-          display: flex;
-          align-items: center;
-          justify-content: flex-start;
-          .top-input {
-            margin-left: 20px;
-            display: flex;
-            align-items: center;
-            justify-content: flex-start;
-            .input-box {
-              width: 150px;
-              margin: 0 10px;
-            }
-          }
-        }
-      }
-      .page-footer-btn {
-        background: #fff;
-        z-index: 1;
-        position: absolute;
-        bottom: 20px;
-        right: 0px;
-        text-align: right;
-        width: 100%;
-        border-top: 1px solid #e6ebf5;
-        padding: 20px 20px 0 0;
-      }
-    }
-  }
-</style>

+ 0 - 294
src/views/classifyManage/itemInformation/components/AddDialog.vue

@@ -1,294 +0,0 @@
-<template>
-  <el-dialog
-    :title="dialogTitle"
-    :visible.sync="equipmentdialog"
-    :before-close="handleClose"
-    :close-on-click-modal="false"
-    :close-on-press-escape="false"
-    append-to-body
-    width="65%"
-  >
-    <div>
-      <el-row>
-        <el-col :span="6" class="tree_col">
-          <AssetTree
-            :props="defaultProps"
-            :default-expanded-keys="defaultExpandedKeys"
-            :expand-on-click-node="false"
-            node-key="id"
-            paramsType="type"
-            :type="typeValue"
-            :init="false"
-            ref="tree"
-            :highlight-current="true"
-            @handleNodeClick="handleNodeClick"
-          />
-        </el-col>
-        <el-col :span="18" class="table_col">
-          <ele-pro-table
-            ref="table"
-            :initLoad="false"
-            :columns="columns"
-            row-key="id"
-            :datasource="datasource"
-            :selection.sync="tableSelectionList"
-            height="calc(100vh - 265px)"
-            full-height="calc(100vh - 116px)"
-            tool-class="ele-toolbar-form"
-            cache-key="systemOrgUserTable"
-          >
-            <!-- 表头工具栏 -->
-            <template v-slot:toolbar>
-              <el-row>
-                <el-col :span="6">
-                  <el-input
-                    v-model="searchForm.searchKey"
-                    placeholder="输入物品编码或名称"
-                    size="small"
-                  ></el-input>
-                </el-col>
-                <el-col :span="6" style="margin-left: 10px">
-                  <el-button
-                    type="primary"
-                    size="small"
-                    @click="searchByKeyWords"
-                    >搜索</el-button
-                  >
-                  <el-button size="small" @click="reset">重置</el-button>
-                </el-col>
-              </el-row>
-            </template>
-          </ele-pro-table>
-        </el-col>
-      </el-row>
-    </div>
-    <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 { getList } from '@/api/classifyManage/itemInformation';
-  export default {
-    components: { AssetTree },
-    props: {
-      typeValue: {
-        type: String,
-        default: ''
-      },
-      mapList: {
-        type: Array,
-        default: []
-      },
-      dialogTitle: {
-        type: String,
-        default: ''
-      }
-    },
-    data () {
-      return {
-        treeLoading: false,
-        equipmentdialog: false,
-        defaultExpandedKeys: [],
-        tableData: [],
-        currentTreeData: {},
-        pagination: {
-          page: 1,
-          size: 10,
-          total: 0
-        },
-        searchForm: {},
-        defaultProps: {
-          children: 'children',
-          value: 'code',
-          label: 'name'
-        },
-        currentKey: null,
-        tableSelectionList: []
-      };
-    },
-    computed: {
-      columns () {
-        const privateList = [];
-        if (
-          this.dialogTitle != '选择设备' &&
-          this.dialogTitle != '选择备品备件'
-        ) {
-          privateList.push({
-            prop: 'brandNum',
-            label: '牌号'
-          });
-        }
-        if (this.dialogTitle != '选择物料') {
-          privateList.push({
-            prop: 'modelType',
-            label: '型号'
-          });
-        }
-        if (this.dialogTitle == '选择模具') {
-          privateList.push({
-            prop: 'shrinkageCoefficient',
-            label: '收缩系数',
-            formatter (_row, _column, cellValue) {
-              return JSON.parse(_row.extendField).shrinkageCoefficient;
-            }
-          });
-          privateList.push({
-            prop: 'dieBodyModel',
-            label: '大模体型号',
-            formatter (_row, _column, cellValue) {
-              return JSON.parse(_row.extendField).dieBodyModel;
-            }
-          });
-        }
-
-        return [
-          {
-            columnKey: 'selection',
-            align: 'center',
-            type: 'selection'
-          },
-          {
-            prop: 'code',
-            showOverflowTooltip: true,
-            label: '物品编码'
-          },
-          {
-            prop: 'name',
-            label: '物品名称'
-          },
-          ...privateList
-        ];
-      }
-    },
-    watch: {
-      equipmentdialog (val) {
-        if (val) {
-          this.$nextTick(() => {
-            this.$refs.tree.getTreeData();
-          });
-          // if(this.tableData.length)  this.$refs.tableRef.clearSelection()
-        }
-      },
-      typeValue (val) {
-        if (val) {
-          this.currentKey = null;
-        }
-      }
-    },
-    methods: {
-      datasource ({ page, where, limit }) {
-        return getList({
-          ...this.searchForm,
-          pageNum: page,
-          size: limit
-        }).then((res) => {
-          setTimeout(() => {
-            const keys = [];
-            this.mapList.forEach((item) => {
-              const row = res.list.find((i) => i.id === item.id);
-              if (row) {
-                keys.push(row.id);
-              }
-            });
-            this.$refs.table.setSelectedRowKeys(keys);
-          }, 100);
-
-          return res;
-        });
-      },
-      handleClose () {
-        this.equipmentdialog = false;
-        this.tableSelectionList = [];
-      },
-
-      handleCurrent (page) {
-        this.pagination.page = page;
-        this.handleList();
-      },
-      handleSize (size) {
-        this.pagination.page = 1;
-        this.pagination.size = size;
-        this.handleList();
-      },
-
-      handleSelectionChange (val) {
-        this.tableSelectionList = val;
-      },
-
-      toDelete (val) {
-        console.log('触发删除', val);
-      },
-
-      getRowKeys (row) {
-        return row.id;
-      },
-
-      // 确定
-      selected () {
-        this.$emit('submit', this.tableSelectionList);
-        this.handleClose();
-      },
-
-      // 树点击事件
-      handleNodeClick (data, node) {
-        if (data.id === this.currentTreeData.id) return;
-        this.currentTreeData = data;
-        this.searchForm.categoryLevelId = data.id;
-        this.$refs.table.reload();
-      },
-
-      // 弹窗 - 按关键字搜索
-      searchByKeyWords () {
-        if (!this.currentTreeData) {
-          this.$message.warning('请先选择设备!');
-          return;
-        }
-        this.pagination.page = 1;
-        this.$refs.table.reload();
-      },
-      // 重置
-      reset () {
-        this.pagination.page = 1;
-        this.searchForm.searchKey = '';
-        this.$refs.table.reload();
-      },
-
-      // 设置默认高亮行
-      setCurrentKey (id) {
-        this.currentKey = id;
-        this.$refs.tree.setCurrentKey(this.currentKey);
-      }
-    }
-  };
-</script>
-
-<style lang="scss" scoped>
-  .tree_col {
-    border: 1px solid #eee;
-    padding: 10px 0;
-    box-sizing: border-box;
-    height: 500px;
-    overflow: auto;
-  }
-  .table_col {
-    padding-left: 10px;
-    :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>

+ 0 - 122
src/views/classifyManage/itemInformation/components/ItemDetail.vue

@@ -1,122 +0,0 @@
-<template>
-  <el-form label-width="90px" class="formBox">
-    <el-form-item label="分类">
-      <span>{{ customForm.categoryLevelPath }}</span>
-    </el-form-item>
-    <el-form-item label="物品编码">
-      <span>{{ customForm.code }}</span>
-    </el-form-item>
-    <el-form-item label="物品名称">
-      <span>{{ customForm.name }}</span>
-    </el-form-item>
-    <el-form-item label="计量单位">
-      <span>{{ customForm.measuringUnit }}</span>
-    </el-form-item>
-    <el-form-item label="包装单位">
-      <span>{{ customForm.packingUnit }}</span>
-    </el-form-item>
-    <el-form-item label="参考单价">
-      <span
-        >{{ customForm.univalence }} {{ univalenceUnit }}/{{
-          customForm.measuringUnit
-        }}</span
-      >
-    </el-form-item>
-    <el-form-item label="保质期">
-      <span>{{ customForm.expirationDate }} {{ expirationDateUnit }}</span>
-    </el-form-item>
-    <el-form-item label="安全库存">
-      <span>{{ customForm.safeStock }}</span>
-    </el-form-item>
-    <el-form-item label="盘点模式" prop="itemMode">
-      <span>{{ inventoryMode[customForm.takeStockPattern] }}</span>
-    </el-form-item>
-    <!-- <el-form-item label="允许转资产" prop="isTransferAssets">
-             <span>{{customForm.isTransferAssets?'允许':'不允许'}}</span>
-         </el-form-item> -->
-    <el-form-item label="允许拆包" prop="unpack">
-      <span>{{ customForm.unpack ? '允许' : '不允许' }}</span>
-    </el-form-item>
-    <el-form-item label="描述" prop="itemRemark">
-      <span>{{ customForm.description }}</span>
-    </el-form-item>
-  </el-form>
-</template>
-
-<script>
-  export default {
-    props: {
-      customForm: {
-        type: Object,
-        default: {}
-      }
-    },
-    components: {},
-    data () {
-      return {
-        inventoryMode: ['逐个盘点', '批量盘点', '混合模式'],
-        priceList: [
-          { id: 0, value: '元', name: 'yuan' },
-          { id: 1, value: '万元', name: 'wanyuan' }
-        ],
-        dateList: [
-          { id: 0, value: '分钟', name: 'minute' },
-          { id: 1, value: '小时', name: 'hour' },
-          { id: 2, value: '天', name: 'day' },
-          { id: 3, value: '月', name: 'month' },
-          { id: 4, value: '年', name: 'year' }
-        ],
-        univalenceUnit: '',
-        expirationDateUnit: ''
-      };
-    },
-    watch: {
-      customForm (val) {
-        if (val) {
-          this.priceList.map((item) => {
-            if (item.name == val.univalenceUnit) {
-              this.univalenceUnit = item.value;
-            }
-          });
-          this.dateList.map((item) => {
-            if (item.name == val.expirationDateUnit) {
-              this.expirationDateUnit = item.value;
-            }
-          });
-        }
-      }
-    },
-    created () {},
-    methods: {}
-  };
-</script>
-
-<style lang="scss" scoped>
-  :deep(.formBox .el-form-item) {
-    margin-bottom: 17px;
-    .twobox {
-      width: 100%;
-      display: flex;
-      align-items: center;
-      justify-content: space-between;
-    }
-    .w60.el-input--medium {
-      width: 60%;
-      margin-right: 5px;
-    }
-    .el-input--small .el-input__inner {
-      height: 36px;
-      line-height: 36px;
-    }
-    .el-select.el-select--medium {
-      width: 100%;
-    }
-    .w40.el-select.el-select--medium {
-      width: 40%;
-    }
-    .el-radio {
-      display: block;
-      margin-top: 10px;
-    }
-  }
-</style>

+ 0 - 302
src/views/classifyManage/itemInformation/components/ItemForm.vue

@@ -1,302 +0,0 @@
-<template>
-  <el-form
-    :model="itemForm"
-    :rules="rules"
-    ref="formName"
-    label-width="90px"
-    class="formBox"
-  >
-    <el-form-item label="分类" prop="urlIdList" label-width="60px">
-      <!-- <el-tooltip class="item" effect="dark" content="Top Left 提示文字" placement="top-start"> -->
-      <el-cascader
-        :key="keyValue"
-        v-model="itemForm.urlIdList"
-        :options="classList"
-        :props="defaultProps"
-        separator="-"
-        filterable
-        ref="cascader"
-      >
-      </el-cascader>
-      <!-- </el-tooltip> -->
-    </el-form-item>
-    <el-form-item label="物品编码" prop="itemCode">
-      <el-input
-        placeholder="请输入"
-        v-model="itemForm.itemCode"
-        maxlength="9"
-        :disabled="itemForm.isCitation"
-      >
-        <template slot="prepend">{{ prefix }}</template>
-      </el-input>
-    </el-form-item>
-    <el-form-item label="物品名称" prop="name">
-      <el-input placeholder="请输入" v-model="itemForm.name"></el-input>
-    </el-form-item>
-    <el-form-item label="计量单位" prop="measuringUnit">
-      <el-input
-        placeholder="请输入"
-        v-model="itemForm.measuringUnit"
-      ></el-input>
-    </el-form-item>
-    <el-form-item label="包装单位" prop="packingUnit">
-      <el-input placeholder="请输入" v-model="itemForm.packingUnit"></el-input>
-    </el-form-item>
-    <!-- oninput="value=value.replace(/[^0-9.]/g,'')" -->
-    <el-form-item label="参考单价" prop="univalence">
-      <div class="twobox">
-        <el-input-number
-          placeholder="请输入"
-          v-model="itemForm.univalence"
-          :min="0"
-          style="width: 80%; margin-right: 10px"
-        ></el-input-number>
-        <DictSelection
-          dictName="金额单位"
-          v-model="itemForm.univalenceUnit"
-          class="w40"
-        ></DictSelection>
-        <!-- <el-select
-          v-model="itemForm.univalenceUnit"
-          placeholder="请选择"
-          class="w40"
-        >
-          <el-option
-            v-for="item in priceList"
-            :key="item.id"
-            :label="item.value"
-            :value="item.name"
-          >
-          </el-option>
-        </el-select> -->
-      </div>
-    </el-form-item>
-    <el-form-item label="保质期" prop="expirationDate">
-      <div class="twobox">
-        <el-input-number
-          placeholder="请输入"
-          type="number"
-          v-model="itemForm.expirationDate"
-          :min="0"
-          style="width: 80%; margin-right: 10px"
-        ></el-input-number>
-        <DictSelection
-          dictName="时间单位"
-          v-model="itemForm.expirationDateUnit"
-          class="w40"
-        ></DictSelection>
-        <!-- <el-select
-          v-model="itemForm.expirationDateUnit"
-          placeholder="请选择"
-          class="w40"
-        >
-          <el-option
-            v-for="item in dateList"
-            :key="item.id"
-            :label="item.value"
-            :value="item.name"
-          >
-          </el-option>
-        </el-select> -->
-      </div>
-    </el-form-item>
-    <el-form-item label="安全库存" prop="safeStock">
-      <el-input placeholder="请输入" v-model="itemForm.safeStock"></el-input>
-    </el-form-item>
-    <el-form-item label="盘点模式" prop="takeStockPattern">
-      <el-radio-group v-model="itemForm.takeStockPattern">
-        <el-radio :label="0">逐个盘点</el-radio>
-        <el-radio :label="1">批量盘点</el-radio>
-        <!-- <el-radio :label="2">混合模式</el-radio> -->
-      </el-radio-group>
-    </el-form-item>
-    <!--         <el-form-item label="允许转资产" prop="isTransferAssets">
-             <el-switch v-model="itemForm.isTransferAssets"
-                active-value="true"
-                inactive-value="false"
-             > </el-switch>
-         </el-form-item> -->
-    <el-form-item label="允许拆包" prop="unpack">
-      <el-switch
-        v-model="itemForm.unpack"
-        :active-value="1"
-        :inactive-value="0"
-        :disabled="itemForm.isCitation"
-      >
-      </el-switch>
-    </el-form-item>
-    <el-form-item label="描述" prop="description">
-      <el-input
-        type="textarea"
-        rows="3"
-        resize="none"
-        placeholder="请输入"
-        v-model="itemForm.description"
-      ></el-input>
-    </el-form-item>
-  </el-form>
-</template>
-
-<script>
-  import { getTreeByType } from '@/api/classifyManage';
-  import { debounce } from 'throttle-debounce';
-  // import dictMixins from "@/mixins/dictMixins"
-
-  export default {
-    // mixins:[dictMixins],
-    props: {
-      itemForm: {
-        type: Object,
-        default: {}
-      },
-      prefix: {
-        type: String,
-        default: ''
-      },
-      defaultNum: {
-        type: String,
-        default: ''
-      }
-    },
-
-    data () {
-      let validateCode = (rule, value, callback) => {
-        let reg = /[\u4e00-\u9fa5]/;
-        // console.log('reg.test(value)',reg.test(value))
-        if (reg.test(value)) {
-          callback(new Error('仅支持英文、数字及特殊字符'));
-        } else {
-          callback();
-        }
-      };
-      return {
-        classList: [],
-        rules: {
-          urlIdList: [
-            {
-              type: 'array',
-              required: true,
-              message: '请选择分类',
-              trigger: 'change'
-            }
-          ],
-          itemCode: [
-            { required: true, message: '请输入物品编码', trigger: 'blur' },
-            { validator: validateCode, trigger: 'blur' }
-          ],
-          name: [
-            { required: true, message: '请输入物品名称', trigger: 'blur' }
-          ],
-          measuringUnit: [
-            { required: true, message: '请输入计量单位', trigger: 'blur' }
-          ],
-          packingUnit: [
-            { required: true, message: '请输入包装单位', trigger: 'blur' }
-          ],
-          takeStockPattern: [
-            { required: true, message: '请选择一个盘点模式', trigger: 'change' }
-          ]
-        },
-        priceList: [
-          { id: 0, value: '元', name: 'yuan' },
-          { id: 1, value: '万元', name: 'wanyuan' }
-        ],
-        dateList: [
-          { id: 0, value: '分钟', name: 'minute' },
-          { id: 1, value: '小时', name: 'hour' },
-          { id: 2, value: '天', name: 'day' },
-          { id: 3, value: '月', name: 'month' },
-          { id: 4, value: '年', name: 'year' }
-        ],
-        // itemForm:{
-        //   priceType:1, dateType:1
-        // },
-        defaultProps: {
-          children: 'children',
-          value: 'id',
-          label: 'name'
-        },
-        keyValue: 0
-      };
-    },
-    watch: {
-      defaultNum: {
-        immediate: true,
-        handler () {
-          this.keyValue++;
-          this.getTreeList();
-        }
-      }
-    },
-    created () {
-      // this.requestDict('金额单位')
-      // this.requestDict('时间单位')
-      this.getTreeList = debounce(500, this.getTreeList);
-    },
-    methods: {
-      async getTreeList () {
-        const res = await getTreeByType(this.defaultNum);
-        if (res.code === '0') {
-          this.classList = res.data;
-        }
-      },
-      //子组件接收callback为父组件传过来的next()方法
-      validateForm (callback) {
-        // let flag = true;
-        //开始表单校验
-        this.$refs.formName.validate((valid) => {
-          callback(valid);
-        });
-      },
-
-      getText () {
-        // 获取节点下的汉字
-        let pathName = this.$refs.cascader
-          .getCheckedNodes()[0]
-          .pathLabels.toString();
-        let pathId = this.$refs.cascader.getCheckedNodes()[0].path;
-        pathId = pathId[pathId.length - 1];
-        //用for循环遍历获取的数据,并把逗号替换
-        for (let i = 0; i < pathName.length; i++) {
-          if (pathName[i] === ',') {
-            pathName = pathName.replace(pathName[i], '-');
-          }
-        }
-        return { pathName, pathId };
-      }
-    }
-  };
-</script>
-
-<style lang="scss" scoped>
-  .formBox :deep(.el-form-item) {
-    margin-bottom: 17px;
-    .twobox {
-      width: 100%;
-      display: flex;
-      align-items: center;
-      justify-content: space-between;
-    }
-    .el-form-item__content .el-cascader {
-      width: 100%;
-    }
-    .w60.el-input--medium {
-      width: 60%;
-      margin-right: 5px;
-    }
-    .el-input--small .el-input__inner {
-      height: 36px;
-      line-height: 36px;
-    }
-    .el-select.el-select--medium {
-      width: 100%;
-    }
-    .w40 {
-      width: 40% !important;
-    }
-    .el-radio {
-      display: block;
-      margin-top: 10px;
-    }
-  }
-</style>

+ 0 - 202
src/views/classifyManage/itemInformation/components/RowDetail.vue

@@ -1,202 +0,0 @@
-<template>
-  <el-form :model="customForm" ref="formCustom" class="row-form">
-    <el-row>
-      <el-col
-        :span="8"
-        v-if="defaultNum == '3' || defaultNum == '4' || defaultNum == '6'"
-      >
-        <el-form-item label="牌号" prop="brandNumber" label-width="60px">
-          <span>{{ customForm.brandNum }}</span>
-        </el-form-item>
-      </el-col>
-      <el-col
-        :span="8"
-        v-if="
-          defaultNum == '8' ||
-          defaultNum == '1' ||
-          defaultNum == '2' ||
-          defaultNum == '5' ||
-          defaultNum == '7'
-        "
-      >
-        <el-form-item label="规格" prop="gg" label-width="60px">
-          <span>{{ customForm.specification }}</span>
-        </el-form-item>
-      </el-col>
-      <el-col :span="8" v-if="defaultNum != '3'">
-        <el-form-item label="型号" prop="xh" label-width="60px">
-          <span>{{ customForm.modelType }}</span>
-        </el-form-item>
-      </el-col>
-      <el-col :span="8" v-if="defaultNum == '5'">
-        <el-form-item label="材质" prop="xh" label-width="60px">
-          <span>{{ extendField.texture }}</span>
-        </el-form-item>
-      </el-col>
-      <el-col :span="8" v-if="defaultNum == '1'">
-        <el-form-item label="标准产能" prop="bzcn" label-width="85px">
-          <span
-            >{{
-              extendField.standardCapacity ? extendField.standardCapacity : '-'
-            }}/小时</span
-          >
-        </el-form-item>
-      </el-col>
-      <el-col :span="8" v-if="defaultNum == '4'">
-        <el-form-item label="标准单重" prop="bzcn" label-width="85px">
-          <span
-            >{{
-              extendField.pieceWeight ? extendField.pieceWeight : '-'
-            }}KG</span
-          >
-        </el-form-item>
-      </el-col>
-      <el-col :span="8" v-if="defaultNum == '4'">
-        <el-form-item label="不良品率" prop="bzcn" label-width="85px">
-          <span
-            >{{
-              extendField.unqualifiedRate ? extendField.unqualifiedRate : '-'
-            }}%</span
-          >
-        </el-form-item>
-      </el-col>
-      <el-col :span="8" v-if="defaultNum == '2'">
-        <el-form-item label="角度" prop="bzcn" label-width="60px">
-          <span>{{ extendField.angle }}</span>
-        </el-form-item>
-      </el-col>
-      <el-col :span="8" v-if="defaultNum == '2' || defaultNum == '5'">
-        <el-form-item label="长" prop="bzcn" label-width="60px">
-          <span>{{ extendField.length ? extendField.length : '-' }}mm</span>
-        </el-form-item>
-      </el-col>
-      <el-col :span="8" v-if="defaultNum == '2' || defaultNum == '5'">
-        <el-form-item label="宽" prop="bzcn" label-width="60px">
-          <span>{{ extendField.width ? extendField.width : '-' }}mm</span>
-        </el-form-item>
-      </el-col>
-      <el-col :span="8" v-if="defaultNum == '2' || defaultNum == '5'">
-        <el-form-item label="高" prop="bzcn" label-width="60px">
-          <span>{{ extendField.high ? extendField.high : '-' }}mm</span>
-        </el-form-item>
-      </el-col>
-      <el-col :span="8" v-if="defaultNum == '6'">
-        <el-form-item label="大模体型号" prop="bzcn" label-width="95px">
-          <span>{{ extendField.dieBodyModel }}</span>
-        </el-form-item>
-      </el-col>
-      <el-col :span="8" v-if="defaultNum == '6'">
-        <el-form-item label="收缩系数" prop="bzcn" label-width="85px">
-          <span>{{ extendField.shrinkageCoefficient }}</span>
-        </el-form-item>
-      </el-col>
-      <el-col :span="8" v-if="defaultNum == '6'">
-        <el-form-item label="芯杆数量" prop="bzcn" label-width="85px">
-          <span>{{ extendField.mandrelNum }}</span>
-        </el-form-item>
-      </el-col>
-      <el-col :span="8" v-if="defaultNum == '6'">
-        <el-form-item label="模孔数量" prop="bzcn" label-width="85px">
-          <span>{{ extendField.dieHoleNum }}</span>
-        </el-form-item>
-      </el-col>
-      <el-col :span="8" v-if="defaultNum == '6'">
-        <el-form-item label="上冲头数量" prop="bzcn" label-width="95px">
-          <span>{{ extendField.upperPunchNum }}</span>
-        </el-form-item>
-      </el-col>
-      <el-col :span="8" v-if="defaultNum == '6'">
-        <el-form-item label="下冲头数量" prop="bzcn" label-width="95px">
-          <span>{{ extendField.lowerPunchNum }}</span>
-        </el-form-item>
-      </el-col>
-      <el-col :span="8" v-if="defaultNum == '6'">
-        <el-form-item label="最大冲压次数" prop="bzcn" label-width="105px">
-          <span>{{ extendField.maximumStampingTimes }}</span>
-        </el-form-item>
-      </el-col>
-      <el-col
-        :span="8"
-        v-for="(item, index) in selfDefinedParameter"
-        :key="index"
-      >
-        <el-form-item>
-          <div class="add-col">
-            <span class="col-input">{{ item.key }}</span>
-            <span class="col-input">{{ item.value }}</span>
-          </div>
-        </el-form-item>
-      </el-col>
-    </el-row>
-  </el-form>
-</template>
-
-<script>
-  export default {
-    props: {
-      customForm: {
-        type: Object,
-        default: {}
-      },
-      defaultNum: {
-        type: String,
-        default: '1'
-      }
-    },
-    components: {},
-    data () {
-      return {
-        angleList: [
-          { id: 0, value: '非A' },
-          { id: 1, value: 'A' }
-        ],
-        extendField: {},
-        selfDefinedParameter: []
-      };
-    },
-    watch: {
-      customForm (val) {
-        if (val) {
-          this.extendField = JSON.parse(val.extendField);
-          this.selfDefinedParameter = JSON.parse(val.selfDefinedParameter);
-        }
-      }
-    },
-    created () {},
-    methods: {}
-  };
-</script>
-
-<style lang="scss" scoped>
-  .row-form {
-    width: 100%;
-    display: flex;
-    align-items: center;
-    justify-content: flex-start;
-    flex-wrap: wrap;
-    border-bottom: 1px dashed #ccc;
-    .el-row {
-      width: 100%;
-    }
-    :deep(.el-form-item) {
-      margin-bottom: 15px;
-    }
-    :deep(.row-col) {
-      display: flex;
-      align-items: center;
-      justify-content: flex-start;
-      .el-input--medium {
-        width: 80%;
-        margin-right: 10px;
-      }
-    }
-    .add-col {
-      display: flex;
-      align-items: center;
-      margin-left: 20px;
-      .col-input {
-        margin-right: 5px;
-      }
-    }
-  }
-</style>

+ 0 - 353
src/views/classifyManage/itemInformation/components/RowForm.vue

@@ -1,353 +0,0 @@
-<template>
-  <el-form
-    :model="itemForm"
-    :rules="customRule"
-    ref="formCustom"
-    class="row-form"
-  >
-    <el-row class="row-box">
-      <el-col
-        :span="8"
-        v-if="defaultNum == '3' || defaultNum == '4' || defaultNum == '6'"
-      >
-        <el-form-item
-          label="牌号"
-          label-width="60px"
-          :prop="defaultNum == '3' ? 'brandNum' : ''"
-        >
-          <el-input v-model="itemForm.brandNum" placeholder="请输入"></el-input>
-        </el-form-item>
-      </el-col>
-      <el-col
-        :span="8"
-        v-if="
-          defaultNum == '8' ||
-          defaultNum == '1' ||
-          defaultNum == '2' ||
-          defaultNum == '5' ||
-          defaultNum == '7'
-        "
-      >
-        <el-form-item label="规格" prop="specification" label-width="60px">
-          <el-input
-            v-model="itemForm.specification"
-            placeholder="请输入"
-          ></el-input>
-        </el-form-item>
-      </el-col>
-      <el-col :span="8" v-if="defaultNum != '3'">
-        <el-form-item label="型号" prop="modelType" label-width="60px">
-          <el-input
-            v-model="itemForm.modelType"
-            placeholder="请输入"
-          ></el-input>
-        </el-form-item>
-      </el-col>
-      <el-col :span="8" v-if="defaultNum == '5'">
-        <el-form-item label="材质" prop="texture" label-width="60px">
-          <el-input
-            :disabled="itemForm.isCitation"
-            v-model="itemForm.info.texture"
-            placeholder="请输入"
-          ></el-input>
-        </el-form-item>
-      </el-col>
-      <el-col :span="8" v-if="defaultNum == '1'">
-        <el-form-item label="标准产能" label-width="85px">
-          <div class="row-col">
-            <el-input
-              type="number"
-              v-model="itemForm.info.standardCapacity"
-              placeholder="请输入"
-              ><span slot="suffix">/小时</span></el-input
-            >
-          </div>
-        </el-form-item>
-      </el-col>
-      <el-col :span="8" v-if="defaultNum == '4'">
-        <el-form-item label="标准单重" label-width="85px">
-          <el-input-number
-            style="width: 80%"
-            type="number"
-            v-model="itemForm.info.pieceWeight"
-            :min="0"
-            placeholder="请输入"
-          ></el-input-number>
-          <span class="spanbox">KG</span>
-        </el-form-item>
-      </el-col>
-      <el-col :span="8" v-if="defaultNum == '4'">
-        <el-form-item label="不良品率" label-width="85px">
-          <el-input-number
-            style="width: 85%"
-            type="number"
-            v-model="itemForm.info.unqualifiedRate"
-            :min="0"
-            :max="100"
-            placeholder="请输入"
-          ></el-input-number>
-          <span class="spanbox">%</span>
-        </el-form-item>
-      </el-col>
-      <el-col :span="8" v-if="defaultNum == '2'">
-        <el-form-item label="角度" label-width="60px">
-          <el-select v-model="itemForm.info.angle" placeholder="请选择">
-            <el-option
-              v-for="item in angleList"
-              :key="item.id"
-              :label="item.value"
-              :value="item.name"
-            >
-            </el-option>
-          </el-select>
-        </el-form-item>
-      </el-col>
-      <el-col :span="8" v-if="defaultNum == '2' || defaultNum == '5'">
-        <el-form-item label="长" label-width="60px">
-          <div>
-            <el-input-number
-              style="width: 80%; margin-right: 10px"
-              type="number"
-              v-model="itemForm.info.length"
-              :min="0"
-              placeholder="请输入"
-            ></el-input-number>
-            <span>mm</span>
-          </div>
-        </el-form-item>
-      </el-col>
-      <el-col :span="8" v-if="defaultNum == '2' || defaultNum == '5'">
-        <el-form-item label="宽" label-width="60px">
-          <div>
-            <el-input-number
-              style="width: 80%; margin-right: 10px"
-              type="number"
-              v-model="itemForm.info.width"
-              :min="0"
-              placeholder="请输入"
-            ></el-input-number>
-            <span>mm</span>
-          </div>
-        </el-form-item>
-      </el-col>
-      <el-col :span="8" v-if="defaultNum == '2' || defaultNum == '5'">
-        <el-form-item label="高" label-width="60px">
-          <div>
-            <el-input-number
-              style="width: 80%; margin-right: 10px"
-              type="number"
-              v-model="itemForm.info.high"
-              :min="0"
-              placeholder="请输入"
-            ></el-input-number>
-            <span>mm</span>
-          </div>
-        </el-form-item>
-      </el-col>
-      <el-col :span="8" v-if="defaultNum == '6'">
-        <el-form-item label="大模体型号" label-width="95px">
-          <el-input
-            v-model="itemForm.info.dieBodyModel"
-            placeholder="请输入"
-          ></el-input>
-        </el-form-item>
-      </el-col>
-      <el-col :span="8" v-if="defaultNum == '6'">
-        <el-form-item label="收缩系数" label-width="85px">
-          <el-input
-            v-model="itemForm.info.shrinkageCoefficient"
-            placeholder="请输入"
-          ></el-input>
-        </el-form-item>
-      </el-col>
-      <el-col :span="8" v-if="defaultNum == '6'">
-        <el-form-item label="芯杆数量" label-width="85px">
-          <el-input
-            v-model="itemForm.info.mandrelNum"
-            oninput="value=value.replace(/[^0-9.]/g,'')"
-            type="number"
-            placeholder="请输入"
-          ></el-input>
-        </el-form-item>
-      </el-col>
-      <el-col :span="8" v-if="defaultNum == '6'">
-        <el-form-item label="模孔数量" label-width="85px">
-          <el-input
-            v-model="itemForm.info.dieHoleNum"
-            type="number"
-            oninput="value=value.replace(/[^0-9.]/g,'')"
-            placeholder="请输入"
-          ></el-input>
-        </el-form-item>
-      </el-col>
-      <el-col :span="8" v-if="defaultNum == '6'">
-        <el-form-item label="上冲头数量" label-width="95px">
-          <el-input
-            v-model="itemForm.info.upperPunchNum"
-            type="number"
-            oninput="value=value.replace(/[^0-9.]/g,'')"
-            placeholder="请输入"
-          ></el-input>
-        </el-form-item>
-      </el-col>
-      <el-col :span="8" v-if="defaultNum == '6'">
-        <el-form-item label="下冲头数量" label-width="95px">
-          <el-input
-            v-model="itemForm.info.lowerPunchNum"
-            type="number"
-            oninput="value=value.replace(/[^0-9.]/g,'')"
-            placeholder="请输入"
-          ></el-input>
-        </el-form-item>
-      </el-col>
-      <el-col :span="8" v-if="defaultNum == '6'">
-        <el-form-item label="最大冲压次数" label-width="105px">
-          <el-input
-            v-model="itemForm.info.maximumStampingTimes"
-            type="number"
-            oninput="value=value.replace(/[^0-9.]/g,'')"
-            placeholder="请输入"
-          ></el-input>
-        </el-form-item>
-      </el-col>
-      <el-col :span="8" v-for="(item, index) in itemForm.addList" :key="index">
-        <el-form-item
-          :prop="'addList.' + index + '.key'"
-          :rules="{
-            required: true,
-            message: '自定义参数名称不能为空',
-            trigger: 'blur'
-          }"
-        >
-          <div class="add-col">
-            <el-input
-              class="col-input"
-              v-model="item.key"
-              placeholder="参数名称"
-            ></el-input>
-            <el-input
-              class="col-input"
-              v-model="item.value"
-              placeholder="参数值"
-            ></el-input>
-            <el-button type="text" @click="delt(item, index)"> 删除 </el-button>
-          </div>
-        </el-form-item>
-      </el-col>
-      <el-col :span="8" v-if="itemForm.addList && itemForm.addList.length < 10">
-        <el-form-item label-width="20px">
-          <el-button type="primary" @click="addItem">增加自定义参数</el-button>
-        </el-form-item>
-      </el-col>
-    </el-row>
-  </el-form>
-</template>
-
-<script>
-  export default {
-    props: {
-      itemForm: {
-        type: Object,
-        default: {}
-      },
-      defaultNum: {
-        type: String,
-        default: '1'
-      }
-    },
-    components: {},
-    data () {
-      return {
-        // customForm:{
-        //   addList:[]
-        // },
-        customRule: {
-          brandNum: [{ required: true, message: '请输入牌号', trigger: 'blur' }]
-        },
-        angleList: [
-          { id: 0, value: '非A', name: 'notA' },
-          { id: 1, value: 'A', name: 'A' }
-        ]
-      };
-    },
-    created () {},
-    methods: {
-      // 在 Input 值改变时触发
-      handleEdit (e) {
-        let value = e.replace(/^(0+)|[^\d]+/g, ''); // 以0开头或者输入非数字,会被替换成空
-      },
-      // 添加自定义参数
-      addItem () {
-        if (this.itemForm.addList.length < 10) {
-          let item = { key: '', value: '' };
-          this.itemForm.addList.push(item);
-        } else {
-          this.$message.warning('自定义参数最多添加10条');
-        }
-      },
-
-      // 删除自定义参数
-      delt (item, index) {
-        this.itemForm.addList.splice(index, 1);
-      },
-
-      //子组件接收callback为父组件传过来的next()方法
-      validateForm (callback) {
-        // let flag = true;
-        //开始表单校验
-        this.$refs.formCustom.validate((valid) => {
-          callback(valid);
-          // if (valid) {
-          //   flag = true
-          // } else {
-          //   return false;
-          // }
-        });
-        // 如果flag为true,则执行callback()
-        // if (flag) {
-        // callback();
-        // }
-      }
-    }
-  };
-</script>
-
-<style lang="scss" scoped>
-  .row-form {
-    width: 100%;
-    display: flex;
-    align-items: center;
-    justify-content: flex-start;
-    flex-wrap: wrap;
-    border-bottom: 1px dashed #ccc;
-    :deep(.row-box) {
-      .el-row {
-        width: 100%;
-      }
-      .el-form-item {
-        margin-bottom: 15px;
-      }
-      .row-col {
-        display: flex;
-        align-items: center;
-        justify-content: flex-start;
-        .el-input--medium {
-          width: 75%;
-          margin-right: 10px;
-        }
-      }
-      .spanbox {
-        display: inline-block;
-        margin-left: 10px;
-      }
-      .add-col {
-        display: flex;
-        align-items: center;
-        margin-left: 20px;
-        .col-input {
-          margin-right: 5px;
-        }
-      }
-    }
-  }
-</style>

+ 0 - 250
src/views/classifyManage/itemInformation/components/item-list.vue

@@ -1,250 +0,0 @@
-<template>
-  <div>
-    <!-- 数据表格 -->
-    <ele-pro-table
-      ref="table"
-      :initLoad="false"
-      :columns="columns"
-      :datasource="datasource"
-      height="calc(100vh - 265px)"
-      full-height="calc(100vh - 116px)"
-      tool-class="ele-toolbar-form"
-      cache-key="systemOrgUserTable"
-    >
-      <!-- 表头工具栏 -->
-      <template v-slot:toolbar>
-        <item-search @search="reload"> </item-search>
-      </template>
-      <!-- 操作列 -->
-      <template v-slot:action="{ row }">
-        <el-link
-          type="primary"
-          :underline="false"
-          icon="el-icon-edit"
-          @click="viewEdit(row)"
-        >
-          详情
-        </el-link>
-        <el-link
-          type="primary"
-          :underline="false"
-          icon="el-icon-edit"
-          @click="openEdit(row)"
-        >
-          编辑
-        </el-link>
-        <el-link
-          type="primary"
-          :underline="false"
-          icon="el-icon-unlock"
-          @click="openClone(row)"
-        >
-          克隆
-        </el-link>
-        <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>
-</template>
-
-<script>
-  import ItemSearch from './item-search.vue';
-  // import {
-  //   getUserPage,
-  //   removePersonnel,
-  //   unbindLoginName
-  // } from '@/api/system/organization';
-  import { getList, removeItem } from '@/api/classifyManage/itemInformation';
-
-  export default {
-    components: { ItemSearch },
-    props: {
-      // 机构id
-      organizationId: [Number, String],
-      // 全部机构
-      organizationList: Array,
-      current: {
-        type: Object,
-        default: () => ({})
-      }
-    },
-    data () {
-      return {};
-    },
-    computed: {
-      // 表格列配置
-      columns () {
-        const privateColumn = [];
-
-        if (!['8', '1', '2', '5', '6', '7'].includes(this.current?.type)) {
-          privateColumn.push({
-            prop: 'brandNum',
-            label: '牌号',
-            showOverflowTooltip: true
-          });
-        }
-        if (!['3'].includes(this.current?.type)) {
-          privateColumn.push({
-            prop: 'modelType',
-            label: '型号',
-            showOverflowTooltip: true
-          });
-        }
-        if (!['3', '4'].includes(this.current?.type)) {
-          privateColumn.push({
-            prop: 'specification',
-            label: '规格',
-            showOverflowTooltip: true
-          });
-        }
-
-        return [
-          {
-            columnKey: 'index',
-            type: 'index',
-            width: 45,
-            align: 'center',
-            showOverflowTooltip: true,
-            fixed: 'left'
-          },
-          {
-            prop: 'code',
-            label: '物品编码',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'name',
-            label: '物品名称',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'classificationCode',
-            label: '物品类型',
-            showOverflowTooltip: true
-          },
-          ...privateColumn,
-          {
-            prop: 'measuringUnit',
-            label: '计量单位',
-            sortable: 'custom',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'packingUnit',
-            label: '包装单位',
-            align: 'center'
-          },
-          {
-            prop: 'categoryLevelPath',
-            label: '分类',
-            showOverflowTooltip: true
-          },
-          {
-            columnKey: 'action',
-            label: '操作',
-            width: 250,
-            align: 'left',
-            resizable: false,
-            slot: 'action'
-          }
-        ];
-      }
-    },
-    methods: {
-      /* 表格数据源 */
-      datasource ({ page, limit, where }) {
-        console.log(this.where);
-        return getList({
-          ...where,
-          pageNum: page,
-          size: limit
-        });
-      },
-      /* 刷新表格 */
-      reload (where) {
-        this.$nextTick(() => {
-          this.$refs.table.reload({
-            pageNum: 1,
-            where: {
-              ...where,
-              categoryLevelId: this.current?.data?.id || this.current?.id
-            }
-          });
-        });
-      },
-      /* 显示详情 */
-      viewEdit (row) {
-        this.$router.push({
-          path: '/classifyManage/itemInformation/details',
-          query: {
-            id: row.id
-          }
-        });
-      },
-      /* 显示编辑 */
-      openEdit (row) {
-        this.$router.push({
-          path: '/classifyManage/itemInformation/add',
-          query: {
-            pageTitle: '编辑物品',
-            id: row.id
-          }
-        });
-      },
-      /* 显示编辑 */
-      openClone (row) {
-        this.$router.push({
-          path: '/classifyManage/itemInformation/add',
-          query: {
-            pageTitle: '克隆物品',
-            id: row.id
-          }
-        });
-      },
-      /* 删除 */
-      remove (row) {
-        const loading = this.$loading({ lock: true });
-        removeItem(id).then((msg) => {
-          loading.close();
-          this.$message.success(msg);
-          this.reload();
-        });
-      },
-      /* 更改状态 */
-      editStatus (row) {
-        const loading = this.$loading({ lock: true });
-        updateUserStatus(row.userId, row.status)
-          .then((msg) => {
-            loading.close();
-            this.$message.success(msg);
-          })
-          .catch((e) => {
-            loading.close();
-            row.status = !row.status ? 1 : 0;
-            this.$message.error(e.message);
-          });
-      }
-    },
-    watch: {
-      // 监听机构id变化
-      current: {
-        handler () {
-          console.log(this.current, 'current');
-          this.reload();
-        }
-      }
-    }
-  };
-</script>
-
-<style lang="scss" scoped></style>

+ 0 - 394
src/views/classifyManage/itemInformation/components/item-match.vue

@@ -1,394 +0,0 @@
-<template>
-  <div class="match-body">
-    <el-tabs v-model="activeName" type="card">
-      <el-tab-pane
-        label="匹配产品"
-        name="product"
-        v-if="defaultNum == '3' || defaultNum == '6'"
-      >
-        <!-- 数据表格 -->
-        <ele-pro-table
-          ref="table"
-          :columns="columns_product"
-          :datasource="productData"
-          :needPage="false"
-          height="calc(100vh - 265px)"
-          full-height="calc(100vh - 116px)"
-          tool-class="ele-toolbar-form"
-          cache-key="systemOrgUserTable"
-        >
-          <!-- 表头工具栏 -->
-          <template v-slot:toolbar>
-            <el-button type="primary" @click="clickAdd('4', '选择产品')"
-              >添加</el-button
-            >
-          </template>
-
-          <!-- 操作列 -->
-          <template v-slot:action="{ row, $index }">
-            <el-popconfirm
-              class="ele-action"
-              :title="`确认删除[${row.name}]吗?`"
-              @confirm="handleDelete($index, row)"
-            >
-              <template v-slot:reference>
-                <el-link type="danger" :underline="false" icon="el-icon-delete">
-                  删除
-                </el-link>
-              </template>
-            </el-popconfirm>
-          </template>
-        </ele-pro-table>
-      </el-tab-pane>
-      <el-tab-pane
-        label="匹配模具"
-        name="mould"
-        v-if="defaultNum == '1' || defaultNum == '4'"
-      >
-        <!-- 数据表格 -->
-        <ele-pro-table
-          ref="table"
-          :columns="columns_mould"
-          :datasource="mouldData"
-          :needPage="false"
-          height="calc(100vh - 265px)"
-          full-height="calc(100vh - 116px)"
-          tool-class="ele-toolbar-form"
-          cache-key="systemOrgUserTable"
-        >
-          <!-- 表头工具栏 -->
-          <template v-slot:toolbar>
-            <el-button type="primary" @click="clickAdd('6', '选择模具')"
-              >添加</el-button
-            >
-          </template>
-
-          <!-- 操作列 -->
-          <template v-slot:action="{ row, $index }">
-            <el-popconfirm
-              class="ele-action"
-              :title="`确认删除[${row.name}]吗?`"
-              @confirm="handleDelete($index, row)"
-            >
-              <template v-slot:reference>
-                <el-link type="danger" :underline="false" icon="el-icon-delete">
-                  删除
-                </el-link>
-              </template>
-            </el-popconfirm>
-          </template>
-        </ele-pro-table>
-      </el-tab-pane>
-      <el-tab-pane label="匹配备品备件" name="part" v-if="defaultNum == '1'">
-        <!-- 数据表格 -->
-        <ele-pro-table
-          ref="table"
-          :columns="columns_part"
-          :datasource="partData"
-          :needPage="false"
-          height="calc(100vh - 265px)"
-          full-height="calc(100vh - 116px)"
-          tool-class="ele-toolbar-form"
-          cache-key="systemOrgUserTable"
-        >
-          <!-- 表头工具栏 -->
-          <template v-slot:toolbar>
-            <el-button type="primary" @click="clickAdd('7', '选择备品备件')"
-              >添加</el-button
-            >
-          </template>
-
-          <!-- 操作列 -->
-          <template v-slot:action="{ row, $index }">
-            <el-popconfirm
-              class="ele-action"
-              :title="`确认删除[${row.name}]吗?`"
-              @confirm="handleDelete($index, row)"
-            >
-              <template v-slot:reference>
-                <el-link type="danger" :underline="false" icon="el-icon-delete">
-                  删除
-                </el-link>
-              </template>
-            </el-popconfirm>
-          </template>
-        </ele-pro-table>
-      </el-tab-pane>
-      <el-tab-pane label="BOM表" name="bom" v-if="defaultNum == '4'">
-        <!-- 数据表格 -->
-        <ele-pro-table
-          ref="table"
-          :columns="columns_bom"
-          :datasource="bomData"
-          :needPage="false"
-          height="calc(100vh - 265px)"
-          full-height="calc(100vh - 116px)"
-          tool-class="ele-toolbar-form"
-          cache-key="systemOrgUserTable"
-        >
-          <!-- 表头工具栏 -->
-          <template v-slot:toolbar>
-            <div class="bom-top">
-              <el-button type="primary" @click="clickAdd('3', '选择物料')"
-                >添加</el-button
-              >
-              <div class="top-input">
-                <span>基本数量</span>
-                <el-input
-                  class="input-box"
-                  @input="handleEdit"
-                  v-model="itemForm.basicNum"
-                  placeholder="请输入"
-                ></el-input>
-                <span>{{ itemForm.measuringUnit }}</span>
-              </div>
-            </div>
-          </template>
-
-          <!-- 操作列 -->
-          <template v-slot:action="{ row, $index }">
-            <el-popconfirm
-              class="ele-action"
-              :title="`确认删除[${row.name}]吗?`"
-              @confirm="handleDelete($index, row)"
-            >
-              <template v-slot:reference>
-                <el-link type="danger" :underline="false" icon="el-icon-delete">
-                  删除
-                </el-link>
-              </template>
-            </el-popconfirm>
-          </template>
-          <!-- 操作列 -->
-          <template v-slot:num="{ row, $index }">
-            <el-input
-              type="number"
-              v-model="row.num"
-              placeholder="请输入"
-              oninput="value=value.replace(/[^0-9.]/g,'')"
-            ></el-input>
-          </template>
-        </ele-pro-table>
-      </el-tab-pane>
-      <el-tab-pane
-        label="匹配设备"
-        name="facility"
-        v-if="defaultNum == '6' || defaultNum == '7'"
-      >
-        <!-- 数据表格 -->
-        <ele-pro-table
-          ref="table"
-          :columns="columns_facility"
-          :datasource="facilityData"
-          :needPage="false"
-          height="calc(100vh - 265px)"
-          full-height="calc(100vh - 116px)"
-          tool-class="ele-toolbar-form"
-          cache-key="systemOrgUserTable"
-        >
-          <!-- 表头工具栏 -->
-          <template v-slot:toolbar>
-            <el-button type="primary" @click="clickAdd('1', '选择设备')"
-              >添加</el-button
-            >
-          </template>
-
-          <!-- 操作列 -->
-          <template v-slot:action="{ row, $index }">
-            <el-popconfirm
-              class="ele-action"
-              :title="`确认删除[${row.name}]吗?`"
-              @confirm="handleDelete($index, row)"
-            >
-              <template v-slot:reference>
-                <el-link type="danger" :underline="false" icon="el-icon-delete">
-                  删除
-                </el-link>
-              </template>
-            </el-popconfirm>
-          </template>
-        </ele-pro-table>
-      </el-tab-pane>
-    </el-tabs>
-
-    <!-- 选择添加 -->
-    <AddDialog
-      ref="addDialogRef"
-      @submit="selectedEquipment"
-      :typeValue="typeValue"
-      :dialogTitle="dialogTitle"
-      :mapList="mapList"
-    />
-  </div>
-</template>
-
-<script>
-  import matchMixins from './match-mixins';
-  import AddDialog from './AddDialog.vue';
-  export default {
-    components: { AddDialog },
-    props: {
-      defaultNum: String,
-      typeList: {
-        type: Array,
-        default: () => []
-      }
-    },
-    mixins: [matchMixins],
-    data () {
-      return {
-        activeName: 'mould',
-        typeValue: '',
-        productData: [],
-        mouldData: [],
-        partData: [],
-        bomData: [],
-        facilityData: [],
-        dialogTitle: '',
-        mapList: []
-      };
-    },
-    methods: {
-      getMapList () {
-        return this.mapList;
-      },
-      setDefault (val) {
-        switch (val) {
-          case '3': {
-            this.activeName = 'product';
-            break;
-          }
-          case '1': {
-            this.activeName = 'mould';
-            break;
-          }
-          case '4': {
-            this.activeName = 'mould';
-            break;
-          }
-          case '6': {
-            this.activeName = 'product';
-            break;
-          }
-          case '7': {
-            this.activeName = 'facility';
-            break;
-          }
-          default:
-            break;
-        }
-      },
-      matchList (key, data) {
-        switch (key) {
-          case '1': {
-            this.facilityData = data[key];
-            break;
-          }
-          case '6': {
-            this.mouldData = data[key];
-            break;
-          }
-          case '7': {
-            this.partData = data[key];
-            break;
-          }
-          case '4': {
-            this.productData = data[key];
-            break;
-          }
-          case '3': {
-            this.bomData = data[key];
-            break;
-          }
-          default:
-            break;
-        }
-      },
-      //点击添加打开弹窗
-      clickAdd (val, name) {
-        this.$refs.addDialogRef.equipmentdialog = true;
-        if (val) {
-          this.typeValue = val;
-          this.dialogTitle = name;
-          this.mapAddList();
-        }
-      },
-      mapAddList () {
-        this.mapList = [];
-        if (this.defaultNum == '1') {
-          this.mapList = this.partData.concat(this.mouldData);
-        } else if (this.defaultNum == '6') {
-          this.mapList = this.facilityData.concat(this.productData);
-        } else if (this.defaultNum == '7') {
-          this.mapList = this.facilityData;
-        } else if (this.defaultNum == '3') {
-          this.mapList = this.productData;
-        } else if (this.defaultNum == '4') {
-          this.mapList = this.mouldData.concat(this.bomData);
-        }
-      },
-      handleDelete (index, row) {
-        switch (this.activeName) {
-          case 'product': {
-            this.productData.splice(index, 1);
-            break;
-          }
-          case 'mould': {
-            this.mouldData.splice(index, 1);
-            break;
-          }
-          case 'part': {
-            this.partData.splice(index, 1);
-            break;
-          }
-          case 'bom': {
-            this.bomData.splice(index, 1);
-            break;
-          }
-          case 'facility': {
-            this.facilityData.splice(index, 1);
-            break;
-          }
-          default:
-            break;
-        }
-        this.mapAddList();
-      },
-      // 选择的设备
-      selectedEquipment (val) {
-        switch (this.activeName) {
-          case 'product': {
-            this.productData = val;
-            break;
-          }
-          case 'mould': {
-            this.mouldData = val;
-            break;
-          }
-          case 'part': {
-            this.partData = val;
-            break;
-          }
-          case 'bom': {
-            this.bomData = val;
-            break;
-          }
-          case 'facility': {
-            this.facilityData = val;
-            break;
-          }
-          default:
-            break;
-        }
-      }
-    }
-  };
-</script>
-
-<style lang="scss" scoped>
-  .match-body {
-    :deep(.el-tabs__header) {
-      margin: 0 0 15px;
-    }
-  }
-</style>

+ 0 - 78
src/views/classifyManage/itemInformation/components/item-search.vue

@@ -1,78 +0,0 @@
-<!-- 搜索表单 -->
-<template>
-  <el-form
-    label-width="100px"
-    class="ele-form-search"
-    @keyup.enter.native="search"
-    @submit.native.prevent
-  >
-    <el-row :gutter="15">
-      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
-        <el-form-item label="物品编码:" prop="informationCode">
-          <el-input
-            clearable
-            placeholder="请输入"
-            v-model.trim="params.informationCode"
-          ></el-input>
-        </el-form-item>
-      </el-col>
-      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
-        <el-form-item label="物品名称:" prop="informationName">
-          <el-input
-            clearable
-            v-model="params.informationName"
-            placeholder="请输入"
-          ></el-input>
-        </el-form-item>
-      </el-col>
-      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
-        <div class="ele-form-actions">
-          <el-button
-            type="primary"
-            icon="el-icon-search"
-            class="ele-btn-icon"
-            @click="search"
-          >
-            查询
-          </el-button>
-          <el-button @click="reset">重置</el-button>
-        </div>
-      </el-col>
-    </el-row>
-  </el-form>
-</template>
-<script>
-  export default {
-    data () {
-      // 默认表单数据
-      const defaultParams = {
-        informationName: '',
-        informationCode: ''
-      };
-      return {
-        // 表单数据
-        params: { ...defaultParams }
-      };
-    },
-    computed: {
-      // 是否开启响应式布局
-      styleResponsive () {
-        return this.$store.state.theme.styleResponsive;
-      }
-    },
-    methods: {
-      /* 搜索 */
-      search () {
-        console.log(this.current);
-        this.$emit('search', {
-          ...this.params
-        });
-      },
-      /*  重置 */
-      reset () {
-        this.params = { ...this.defaultParams };
-        this.search();
-      }
-    }
-  };
-</script>

+ 0 - 237
src/views/classifyManage/itemInformation/components/match-mixins.js

@@ -1,237 +0,0 @@
-export default {
-  data () {
-    return {
-      columns_product: [
-        {
-          type: 'index',
-          label: '序号',
-          width: 80
-        },
-        {
-          prop: 'code',
-          label: '物品编码'
-        },
-        {
-          prop: 'name',
-          label: '物品名称'
-        },
-        {
-          prop: 'brandNum',
-          label: '牌号'
-        },
-        {
-          prop: 'modelType',
-          label: '型号'
-        },
-        {
-          prop: 'classificationCode',
-          label: '物品类型',
-          formatter: this.classificationCodeFormatter
-        },
-        {
-          prop: 'categoryLevelPath',
-          label: '分类'
-        },
-        {
-          columnKey: 'action',
-          label: '操作',
-          width: 150,
-          align: 'center',
-          slot: 'action',
-          fixed: 'right'
-        }
-      ],
-      columns_mould: [
-        {
-          type: 'index',
-          label: '序号',
-          width: 50
-        },
-        {
-          prop: 'code',
-          label: '物品编码'
-        },
-        {
-          prop: 'name',
-          label: '物品名称'
-        },
-        {
-          prop: 'brandNum',
-          label: '牌号'
-        },
-        {
-          prop: 'modelType',
-          label: '型号'
-        },
-        {
-          prop: 'shrinkageCoefficient',
-          label: '收缩系数',
-          formatter: this.shrinkFormatter
-        },
-        {
-          prop: 'dieBodyModel',
-          label: '大模体型号',
-          formatter: this.modleFormatter
-        },
-        {
-          prop: 'classificationCode',
-          label: '物品类型',
-          formatter: this.classificationCodeFormatter
-        },
-        {
-          prop: 'categoryLevelPath',
-          label: '分类'
-        },
-        {
-          columnKey: 'action',
-          label: '操作',
-          width: 150,
-          align: 'center',
-          slot: 'action',
-          fixed: 'right'
-        }
-      ],
-      columns_part: [
-        {
-          type: 'index',
-          label: '序号',
-          width: 50
-        },
-        {
-          prop: 'code',
-          label: '物品编码'
-        },
-        {
-          prop: 'name',
-          label: '物品名称'
-        },
-        {
-          prop: 'modelType',
-          label: '型号'
-        },
-        {
-          prop: 'classificationCode',
-          label: '物品类型',
-          formatter: this.classificationCodeFormatter
-        },
-        {
-          prop: 'categoryLevelPath',
-          label: '分类'
-        },
-        {
-          columnKey: 'action',
-          label: '操作',
-          width: 150,
-          align: 'center',
-          slot: 'action',
-          fixed: 'right'
-        }
-      ],
-      columns_bom: [
-        {
-          type: 'index',
-          label: '序号',
-          width: 50
-        },
-        {
-          prop: 'code',
-          label: '物品编码'
-        },
-        {
-          prop: 'name',
-          label: '物品名称'
-        },
-        {
-          prop: 'brandNum',
-          label: '牌号'
-        },
-        {
-          prop: 'classificationCode',
-          label: '物品类型',
-          formatter: this.classificationCodeFormatter
-        },
-        {
-          prop: 'categoryLevelPath',
-          label: '分类'
-        },
-        {
-          label: '数量',
-          columnKey: 'num',
-          width: 120,
-          slot: 'num'
-        },
-        {
-          columnKey: 'action',
-          label: '操作',
-          width: 150,
-          align: 'center',
-          slot: 'action',
-          fixed: 'right'
-        }
-      ],
-      columns_facility: [
-        {
-          type: 'index',
-          label: '序号',
-          width: 50
-        },
-        {
-          prop: 'code',
-          label: '物品编码'
-        },
-        {
-          prop: 'name',
-          label: '物品名称'
-        },
-        {
-          prop: 'classificationCode',
-          label: '物品类型',
-          formatter: this.classificationCodeFormatter
-        },
-        {
-          prop: 'categoryLevelPath',
-          label: '分类'
-        },
-        {
-          columnKey: 'action',
-          label: '操作',
-          width: 150,
-          align: 'center',
-          slot: 'action',
-          fixed: 'right'
-        }
-      ]
-    };
-  },
-  methods: {
-    // 物品类型格式化
-    classificationCodeFormatter (row) {
-      let itemName = '';
-      this.typeList.map((item) => {
-        if (item.code == row.type) {
-          itemName = item.name;
-        }
-      });
-      return itemName;
-    },
-
-    // 收缩系数格式化
-    shrinkFormatter (row) {
-      let shrink = '';
-      let extendField = JSON.parse(row.extendField);
-      if (extendField.hasOwnProperty('shrinkageCoefficient')) {
-        shrink = extendField.shrinkageCoefficient;
-      }
-      return shrink;
-    },
-
-    modleFormatter (row) {
-      let modle = '';
-      let extendField = JSON.parse(row.extendField);
-      if (extendField.hasOwnProperty('dieBodyModel')) {
-        modle = extendField.dieBodyModel;
-      }
-      return modle;
-    }
-  }
-};

+ 0 - 411
src/views/classifyManage/itemInformation/details.vue

@@ -1,411 +0,0 @@
-<template>
-  <div class="ele-body">
-    <el-card shadow="never">
-      <div class="page-title">
-        <el-page-header @back="goBack">
-          <div slot="content" class="pageContent">
-            <div>物品详情</div>
-            <el-form class="topform">
-              <el-form-item label="物品类型" label-width="70px">
-                <span>{{ itemValue }}</span>
-              </el-form-item>
-            </el-form>
-          </div>
-        </el-page-header>
-      </div>
-      <div class="table-container">
-        <div class="tree-col">
-          <ItemDetail ref="itemDetailRef" :customForm="customForm" />
-        </div>
-        <div class="attribute-row">
-          <RowDetail
-            ref="rowDetailRef"
-            :customForm="customForm"
-            :defaultNum="defaultNum"
-          />
-          <div
-            class="row-table"
-            v-if="defaultNum != '8' && defaultNum != '2' && defaultNum != '5'"
-          >
-            <el-tabs v-model="activeName" type="card">
-              <el-tab-pane
-                label="匹配产品"
-                name="product"
-                v-if="defaultNum == '3' || defaultNum == '6'"
-              >
-                <!-- 数据表格 -->
-                <ele-pro-table
-                  ref="table"
-                  :columns="columns_product"
-                  :datasource="productData"
-                  :needPage="false"
-                  height="calc(100vh - 265px)"
-                  full-height="calc(100vh - 116px)"
-                  tool-class="ele-toolbar-form"
-                  cache-key="systemOrgUserTable"
-                >
-                </ele-pro-table>
-              </el-tab-pane>
-              <el-tab-pane
-                label="匹配模具"
-                name="mould"
-                v-if="defaultNum == '1' || defaultNum == '4'"
-              >
-                <!-- 数据表格 -->
-                <ele-pro-table
-                  ref="table"
-                  :columns="columns_mould"
-                  :datasource="mouldData"
-                  :needPage="false"
-                  height="calc(100vh - 265px)"
-                  full-height="calc(100vh - 116px)"
-                  tool-class="ele-toolbar-form"
-                  cache-key="systemOrgUserTable"
-                >
-                </ele-pro-table>
-              </el-tab-pane>
-              <el-tab-pane
-                label="匹配备品备件"
-                name="part"
-                v-if="defaultNum == '1'"
-              >
-                <!-- 数据表格 -->
-                <ele-pro-table
-                  ref="table"
-                  :columns="columns_part"
-                  :datasource="partData"
-                  :needPage="false"
-                  height="calc(100vh - 265px)"
-                  full-height="calc(100vh - 116px)"
-                  tool-class="ele-toolbar-form"
-                  cache-key="systemOrgUserTable"
-                >
-                </ele-pro-table>
-              </el-tab-pane>
-              <el-tab-pane label="BOM表" name="bom" v-if="defaultNum == '4'">
-                <!-- 数据表格 -->
-                <ele-pro-table
-                  ref="table"
-                  :columns="columns_bom"
-                  :datasource="bomData"
-                  :needPage="false"
-                  height="calc(100vh - 265px)"
-                  full-height="calc(100vh - 116px)"
-                  tool-class="ele-toolbar-form"
-                  cache-key="systemOrgUserTable"
-                >
-                  <!-- 表头工具栏 -->
-                  <template v-slot:toolbar>
-                    <div class="bom-top">
-                      <div class="top-input">
-                        <span>基本数量</span>
-                        <div class="input-box">{{ customForm.basicNum }}</div>
-                        <span>{{ customForm.measuringUnit }}</span>
-                      </div>
-                    </div>
-                  </template>
-                  <!-- 操作列 -->
-                  <template v-slot:num="{ row, $index }">
-                    {{ row.num }}
-                  </template>
-                </ele-pro-table>
-              </el-tab-pane>
-              <el-tab-pane
-                label="匹配设备"
-                name="facility"
-                v-if="defaultNum == '6' || defaultNum == '7'"
-              >
-                <!-- 数据表格 -->
-                <ele-pro-table
-                  ref="table"
-                  :columns="columns_facility"
-                  :datasource="facilityData"
-                  :needPage="false"
-                  height="calc(100vh - 265px)"
-                  full-height="calc(100vh - 116px)"
-                  tool-class="ele-toolbar-form"
-                  cache-key="systemOrgUserTable"
-                >
-                </ele-pro-table>
-              </el-tab-pane>
-            </el-tabs>
-          </div>
-        </div>
-      </div>
-    </el-card>
-  </div>
-</template>
-
-<script>
-  import matchMixins from './components/match-mixins';
-  import ItemDetail from './components/ItemDetail';
-  import RowDetail from './components/RowDetail';
-  import dictMixins from '@/mixins/dictMixins';
-  import { getDetails } from '@/api/classifyManage/itemInformation';
-  export default {
-    components: { ItemDetail, RowDetail },
-    mixins: [dictMixins, matchMixins],
-    data () {
-      return {
-        // typeList: [
-        //   { id: 1, value: '1  生产设备', prefix: '1', code: 1 },
-        //   { id: 2, value: '2  舟皿', prefix: '2', code: 2 },
-        //   { id: 3, value: '5  周转车', prefix: '5', code: 5 },
-        //   { id: 4, value: '6  模具', prefix: '6', code: 6 },
-        //   { id: 5, value: '7  备品备件', prefix: '7', code: 7 },
-        //   { id: 6, value: '3  物料', prefix: '3', code: 3 },
-        //   { id: 7, value: '4  产品', prefix: '4', code: 4 },
-        //   { id: 8, value: '8  耗材', prefix: '8', code: 8 }
-        // ],
-        defaultNum: '1',
-        // itemForm:{
-        //   priceType:0, dateType:0,
-        // },
-        customForm: {
-          addList: []
-        },
-        activeName: 'product',
-        productData: [],
-        mouldData: [],
-        partData: [],
-        bomData: [],
-        facilityData: [],
-        pagination: {
-          page: 1,
-          size: 10,
-          total: 0
-        },
-        itemValue: ''
-      };
-    },
-    computed: {
-      prefix () {
-        const obj =
-          (this.dict[this.dictEnum['分类编号']] || []).find(
-            (itm) => itm.dictCode === this.defaultNum
-          ) || {};
-        return obj && obj.dictValue;
-      },
-      typeList () {
-        const noList = this.dict[this.dictEnum['分类编号']] || [];
-
-        return (this.dict[this.dictEnum['类型用途']] || []).map((item) => {
-          const obj =
-            noList.find((itm) => itm.dictCode === item.dictCode) || {};
-          return {
-            ...item,
-            value: `${obj.dictValue} ${item.dictValue}`,
-            name: item.dictValue,
-            prefix: obj.dictValue,
-            code: item.dictCode
-          };
-        });
-      }
-    },
-    async created () {
-      await this.requestDict('分类编号');
-      await this.requestDict('类型用途');
-      this.getDetilInfo(this.$route.query.id);
-    },
-    methods: {
-      async getDetilInfo (id) {
-        const data = await getDetails(id);
-        this.customForm = data;
-        this.defaultNum = data.type;
-        this.formatterValue(data.type);
-        this.setDefault(data.type);
-        for (const key in this.customForm.categoryVoRelationMap) {
-          this.matchList(key, this.customForm.categoryVoRelationMap);
-        }
-      },
-
-      formatterValue (code) {
-        this.typeList.map((item) => {
-          if (item.code == code) {
-            this.itemValue = item.value;
-          }
-        });
-      },
-
-      goBack () {
-        this.$router.go(-1);
-      },
-      // 显示默认选中的tab
-      setDefault (val) {
-        switch (val) {
-          case '3': {
-            this.activeName = 'product';
-            break;
-          }
-          case '1': {
-            this.activeName = 'mould';
-            break;
-          }
-          case '4': {
-            this.activeName = 'mould';
-            break;
-          }
-          case '6': {
-            this.activeName = 'product';
-            break;
-          }
-          case '7': {
-            this.activeName = 'facility';
-            break;
-          }
-          default:
-            break;
-        }
-      },
-
-      matchList (key, data) {
-        switch (key) {
-          case '1': {
-            this.facilityData = data[key];
-            break;
-          }
-          case '6': {
-            this.mouldData = data[key];
-            break;
-          }
-          case '7': {
-            this.partData = data[key];
-            break;
-          }
-          case '4': {
-            this.productData = data[key];
-            break;
-          }
-          case '3': {
-            this.bomData = data[key];
-            break;
-          }
-          default:
-            break;
-        }
-      },
-
-      handleDelete (index, row) {},
-
-      //点击添加打开弹窗
-      clickAdd () {
-        this.$refs.addDialogRef.equipmentdialog = true;
-      },
-
-      handleCurrent (page) {
-        this.pagination.page = page;
-        // this._getList(this.params)
-      },
-      handleSize (size) {
-        this.pagination.page = 1;
-        this.pagination.size = size;
-        // this._getList(this.params)
-      }
-
-      // 物品类型格式化
-      // classificationCodeFormatter (row) {
-      //   let itemName = '';
-      //   this.typeList.map((item) => {
-      //     if (item.code == row.type) {
-      //       itemName = item.value;
-      //     }
-      //   });
-      //   return itemName;
-      // }
-    }
-  };
-</script>
-
-<style lang="scss" scoped>
-  .ele-body {
-    :deep(.page-title) {
-      border-bottom: 1px solid #eaeefb;
-      padding-bottom: 8px;
-      margin-bottom: 16px;
-      display: flex;
-      align-items: center;
-      .el-page-header__left {
-        display: flex;
-        align-items: center;
-      }
-      .pageContent {
-        display: flex;
-        align-items: center;
-        font-size: 18px;
-        color: #303133;
-        .topform {
-          margin-left: 30px;
-          display: flex;
-          align-items: center;
-          .el-form-item {
-            margin-bottom: 0;
-          }
-        }
-      }
-    }
-    .table-container {
-      flex: 1;
-      display: flex;
-      overflow: hidden;
-      .tree-col {
-        margin-right: 10px;
-        width: 25%;
-        min-width: 250px;
-        overflow: auto;
-        padding: 20px 20px 20px 10px;
-        background-color: #fff;
-        margin-top: 10px;
-        border: 1px solid #e6ebf5;
-        border-radius: 4px;
-        box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
-      }
-    }
-
-    :deep(.attribute-row) {
-      padding: 20px 5px;
-      background: #fff;
-      margin-top: 10px;
-      overflow: auto;
-      flex: 1;
-      border: 1px solid #e6ebf5;
-      border-radius: 4px;
-      box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
-      position: relative;
-      .row-table {
-        width: 100%;
-        margin: 20px auto 0;
-        .table-box {
-          width: 100%;
-          margin: 10px auto;
-          min-height: 400px;
-        }
-        .bom-top {
-          width: 100%;
-          display: flex;
-          align-items: center;
-          justify-content: flex-start;
-          .top-input {
-            margin-left: 20px;
-            display: flex;
-            align-items: center;
-            justify-content: flex-start;
-            .input-box {
-              width: 150px;
-              margin: 0 10px;
-              display: inline-box;
-            }
-          }
-        }
-      }
-      .page-footer-btn {
-        background: #fff;
-        z-index: 1;
-        position: fixed;
-        bottom: 40px;
-        right: 80px;
-        text-align: right;
-        width: 50%;
-      }
-    }
-  }
-</style>

+ 0 - 112
src/views/classifyManage/itemInformation/index.vue

@@ -1,112 +0,0 @@
-<template>
-  <div class="ele-body">
-    <el-card shadow="never">
-      <ele-split-layout
-        width="256px"
-        allow-collapse
-        :right-style="{ overflow: 'hidden' }"
-      >
-        <div>
-          <!-- 操作按钮 -->
-          <ele-toolbar class="ele-toolbar-actions">
-            <div style="margin: 5px 0">
-              <el-button
-                size="small"
-                type="primary"
-                icon="el-icon-plus"
-                class="ele-btn-icon"
-                @click="openEdit()"
-              >
-                新建物品
-              </el-button>
-            </div>
-          </ele-toolbar>
-          <div class="ele-border-lighter sys-organization-list">
-            <asset-tree
-              @handleNodeClick="onNodeClick"
-              ref="commonTree"
-              :treeFormate="
-                (list) => {
-                  return [
-                    {
-                      children: list,
-                      id: '0',
-                      level: 0,
-                      name: '物品信息表',
-                      originId: null,
-                      originType: {},
-                      parentId: null,
-                      type: '',
-                      weight: 0
-                    }
-                  ];
-                }
-              "
-            />
-          </div>
-        </div>
-        <template v-slot:content>
-          <item-list :current="current" />
-        </template>
-      </ele-split-layout>
-    </el-card>
-  </div>
-</template>
-
-<script>
-  import itemList from './components/item-list';
-  import AssetTree from '@/components/AssetTree';
-
-  export default {
-    components: { itemList, AssetTree },
-    data () {
-      return {
-        treeData: [],
-        current: {}
-      };
-    },
-    created () {},
-    methods: {
-      onNodeClick (data, node) {
-        this.current = node;
-      },
-      openEdit () {
-        const data = this.$refs.commonTree.getSelectList();
-
-        if (data?.id) {
-          let node = this.$refs.commonTree.getInstance().getNode(data.id);
-          const urlIdList = [data.id];
-          while (node.parent?.data?.id) {
-            urlIdList.unshift(node.parent?.data?.id);
-            node = node.parent;
-          }
-          data.urlIdList = urlIdList.filter((i) => i !== '0');
-        }
-        this.$router.push({
-          path: '/classifyManage/itemInformation/add',
-          query: {
-            pageTitle: '新建物品',
-            selectNode: JSON.stringify(data)
-          }
-        });
-      }
-    }
-  };
-</script>
-<style lang="scss" scoped>
-  .sys-organization-list {
-    height: calc(100vh - 264px);
-    box-sizing: border-box;
-    border-width: 1px;
-    border-style: solid;
-    overflow: auto;
-  }
-
-  .sys-organization-list :deep(.el-tree-node__content) {
-    height: 40px;
-
-    & > .el-tree-node__expand-icon {
-      margin-left: 10px;
-    }
-  }
-</style>

+ 9 - 1
src/views/classifyManage/treeClassify/components/list-edit.vue

@@ -108,6 +108,7 @@
           >
           </DictSelection>
         </el-form-item>
+    
         <el-form-item label="本层排序:" prop="sortNum">
           <el-input
             clearable
@@ -148,7 +149,8 @@
         separate: '',
         sortNum: '',
         remark: '',
-        parentId: 0
+        parentId: 0,
+        rootCategoryLevelId: null,
       };
       return {
         visible: false,
@@ -166,6 +168,11 @@
             value: '2',
             label: '仓储组'
           },
+
+          { 
+            value: '3',
+            label: '物料组'
+          },
      
         
         ],
@@ -216,6 +223,7 @@
     created () {},
     methods: {
       open (data, parentData) {
+        this.formData.rootCategoryLevelId = this.$route.query.id
         this.parentData = parentData;
         this.data = data;
         this.visible = true;

+ 1 - 1
src/views/factoryModel/station/components/edit.vue

@@ -454,7 +454,7 @@ export default {
     },
     // 获取产线
     getlistFactoryLineByParentId() {
-      console.log(this.form.extInfo.workshopId);
+    
       listFactoryLineByParentId(this.form.extInfo.workshopId).then((res) => {
         console.log(res);
         this.options.productionLineId = res;

+ 80 - 9
src/views/material/materialBOM/components/edit-dialog.vue

@@ -47,14 +47,14 @@
           </el-form-item>
         </el-col> -->
 
-        <el-col :span="8">
+        <!-- <el-col :span="8">
           <el-form-item label="生产版本:" prop="produceVersionId">
             <el-select v-model="form.produceVersionId" filterable placeholder="请选择" :style="{ width: '100%' }">
               <el-option v-for="item in versionList" :key="item.id" :label="item.code + '-' + item.name" :value="item.id">
               </el-option>
             </el-select>
           </el-form-item>
-        </el-col>
+        </el-col> -->
 
 
         <el-col :span="8">
@@ -78,6 +78,12 @@
             </el-select>
           </el-form-item>
         </el-col>
+
+        <el-col :span="8">
+          <el-form-item label="工序" prop="taskId">
+            <el-input placeholder="请选择" @click.native="openTask" readonly v-model="form.taskName"></el-input>
+          </el-form-item>
+        </el-col>
       </el-row>
     </el-form>
     <ele-pro-table ref="table" :columns="columns" :datasource="tableData" height="calc(100vh - 550px)" :need-page="false">
@@ -91,6 +97,13 @@
       <template v-slot:subCode="{ row }">
         <el-input v-model="row.subCode" placeholder="请输入"></el-input>
       </template>
+
+      <template v-slot:isReworkBom="{ row }">
+        <el-select v-model="row.isReworkBom">
+          <el-option v-for="item in isReworkBomList" :key="item.value" :label="item.label" :value="item.value">
+          </el-option>
+        </el-select>
+      </template>
       <template v-slot:unit="{ row }">
         <DictSelection dictName="重量单位" v-model="row.unit"></DictSelection>
       </template>
@@ -114,6 +127,19 @@
 
     <ProductModal ref="productRefs" @changeProduct='determineChoose' />
 
+    <!-- 添加工序 -->
+
+    <ele-modal width="1720px" :visible="addDialog" :append-to-body="true" :close-on-click-modal="true"
+      @update:visible="closeAdd">
+      <Production :tableData="productionList" ref="ProductionCom" :isRadio="true" />
+      <template v-slot:footer>
+        <el-button @click="closeAdd">取消</el-button>
+        <el-button type="primary" @click="addParamrter">
+          添加
+        </el-button>
+      </template>
+    </ele-modal>
+
   </ele-modal>
 </template>
 
@@ -124,8 +150,9 @@ import factorySelect from '@/components/CommomSelect/factory-select.vue';
 import { getCode } from '@/api/codeManagement/index.js';
 import { getVersionCode, bomSave, bomUpdate, getById, detailPage } from '@/api/material/BOM';
 import { pageList } from '@/api/technology/version/version.js';
+import Production from '@/views/technology/route/components/production/index.vue'
 export default {
-  components: { ProductModal, factorySelect },
+  components: { ProductModal, factorySelect, Production },
   props: {
     statusOpt: Object
   },
@@ -153,11 +180,13 @@ export default {
         categoryCode: '',
         categoryId: '',
         categoryName: '',
+        isReworkBom: 0,
         version: '',
         categoryType: '',
         baseCount: '',
         baseCountUnit: '',
         status: '-1',
+        taskId: ''
 
       },
       removeSubBomIdList: [],
@@ -178,7 +207,11 @@ export default {
 
       ],
       tableData: [],
-      versionList: [],
+      // versionList: [],
+
+      productionList: [],
+      addDialog: false,
+
       columns: [
         {
           type: 'index',
@@ -197,6 +230,13 @@ export default {
           slot: 'categoryName',
           action: 'categoryName'
         },
+        {
+          label: '是否回收料',
+          prop: 'isReworkBom',
+          slot: 'isReworkBom',
+          action: 'isReworkBom'
+
+        },
         {
           label: '物料编码',
           prop: 'categoryCode'
@@ -210,12 +250,12 @@ export default {
           prop: 'modelType'
         },
         {
-          label: '净重',
+          label: '数量',
           slot: 'count',
           action: 'count'
         },
         {
-          label: '重量单位',
+          label: '单位',
           slot: 'unit',
           action: 'unit'
         },
@@ -238,6 +278,9 @@ export default {
 
         baseCount: [
           { validator: baseCountVa, trigger: 'blur' }
+        ],
+        taskId: [
+          { required: true, message: '请选择工序', trigger: 'blur' }
         ]
       },
 
@@ -245,13 +288,18 @@ export default {
       loading: false,
       // 是否是修改
       isUpdate: false,
+
+      isReworkBomList: [
+        { label: '否', value: 0 },
+        { label: '是', value: 1 }
+      ],
     };
   },
   methods: {
     async open(type, row) {
       this.title = type;
       this.row = row;
-      this.getVersionList()
+      // this.getVersionList()
       this.visible = true;
       if (type == '新建') {
         this._getCode();
@@ -282,6 +330,7 @@ export default {
         subCode,
         categoryId: '',
         categoryName: '',
+        isReworkBom: 0,
         brandNum: '',
         count: '',
         modelType: '',
@@ -294,7 +343,7 @@ export default {
     },
     selectProd() {
       this.$refs.productRefs.open(this.form, '选择产品', '9')
-      
+
     },
 
 
@@ -308,7 +357,7 @@ export default {
         this.$set(this.form, 'categoryId', row.id)
         this.$set(this.form, 'categoryCode', row.code)
         this.getVersion()
-       
+
 
       }
       else if (title == '选择物料') {
@@ -389,10 +438,32 @@ export default {
     async _getById(id) {
       const data = await getById(id);
       this.form = data;
+      this.productionList = [{ id: this.form.taskId, name: this.form.taskName }]
       this.form.status = this.form.status + ''
     },
 
 
+    openTask() {
+      this.addDialog = true
+    },
+
+    /*关闭选择参数*/
+    closeAdd() {
+      // this.$refs.ProductionCom.$refs.table.setSelectedRows([]);
+      this.addDialog = false;
+    },
+
+    addParamrter() {
+      let arr = this.$refs.ProductionCom.getRowData();
+      this.productionList = [arr]
+      this.form['taskId'] = arr.id
+      this.form['taskName'] = arr.name
+      this.addDialog = false;
+
+
+
+    }
+
   }
 };
 </script>

+ 12 - 10
src/views/material/materialBOM/components/view-dialog.vue

@@ -34,26 +34,28 @@
           </el-form-item>
         </el-col>
         <el-col :span="8">
-          <el-form-item label="版本号" prop="categoryName">
+          <el-form-item label="版本号" prop="version">
             {{ formData.version }}
           </el-form-item>
         </el-col>
+
         <el-col :span="8">
-          <el-form-item label="分类层级" prop="categoryType">
-            {{ formData.categoryType }}
-          </el-form-item>
-        </el-col>
-        <el-col :span="8">
-          <el-form-item label="基本数量" prop="categoryType">
+          <el-form-item label="基本数量" prop="baseCount">
             {{ formData.baseCount }}
             {{ formData.baseCountUnit }}
           </el-form-item>
         </el-col>
         <el-col :span="8">
-          <el-form-item label="状态" prop="categoryType">
+          <el-form-item label="状态" prop="status">
             {{ statusOpt[formData.status] }}
           </el-form-item>
         </el-col>
+
+        <el-col :span="8">
+          <el-form-item label="工序" prop="taskName">
+            {{ formData.taskName }}
+          </el-form-item>
+        </el-col>
       </el-row>
     </el-form>
     <ele-pro-table
@@ -122,11 +124,11 @@
             prop: 'model'
           },
           {
-            label: '净重',
+            label: '数量',
             prop: 'count'
           },
           {
-            label: '重量单位',
+            label: '单位',
             prop: 'unit'
             // },
             // {

+ 55 - 35
src/views/material/product/components/MaterialAdd.vue

@@ -1,12 +1,14 @@
 
 <template>
-    <ele-modal width="1060px" :visible="visible" v-if="visible" :append-to-body="true" :close-on-click-modal="true"
+    <ele-modal width="1160px" :visible="visible" v-if="visible" :append-to-body="true" :close-on-click-modal="true"
         custom-class="ele-dialog-form" title="物料BOM" @update:visible="updateVisible">
         <el-form ref="form" :model="form" :rules="rules" label-width="120px">
             <header-title title="物料BOM"> </header-title>
 
             <el-row>
+
                 <el-col :span="8">
+
                     <el-form-item label="BOM编码:" prop="code">
                         <el-input v-model="form.code" disabled />
                     </el-form-item>
@@ -33,15 +35,7 @@
                     </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%' }">
-                            <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">
@@ -79,17 +73,31 @@
                         <template v-slot:subCode="{ row }">
                             <el-input v-model="row.subCode" placeholder="请输入"></el-input>
                         </template>
+
+                        <template v-slot:isReworkBom="{ row }">
+                            <el-select v-model="row.isReworkBom">
+                                <el-option v-for="item in isReworkBomList" :key="item.value" :label="item.label"
+                                    :value="item.value">
+                                </el-option>
+                            </el-select>
+                        </template>
+
                         <template v-slot:unit="{ row }">
-                            <DictSelection dictName="重量单位" v-model="row.unit"></DictSelection>
+                            <DictSelection dictName="计量单位" v-model="row.unit"></DictSelection>
                         </template>
+
+
                         <template v-slot:count="{ row }">
-                            <el-input v-model="row.count" placeholder="请输入" @input="(value) =>
-                            (row.count = value.replace(
+                            <el-input v-model="row.count"  placeholder="请输入" @input="(value) =>
+                            (row.count =  value.replace(
                                 /^(-)*(\d+)\.(\d\d\d\d\d\d).*$/,
                                 '$1$2.$3'
                             ))
                                 "></el-input>
                         </template>
+
+
+
                         <template v-slot:categoryName="{ row, $index }">
                             <el-input :value="row.categoryName" placeholder="请选择"
                                 @click.native="categorySelect(row, $index)"></el-input>
@@ -114,7 +122,7 @@ import factorySelect from '@/components/CommomSelect/factory-select.vue';
 import { pageList } from '@/api/technology/version/version.js';
 import { getCode } from '@/api/codeManagement/index.js';
 import { bomSave, bomUpdate } from '@/api/material/BOM';
-import ProductModal from '@/views/technology/productParam/components/ProductModal.vue'
+import ProductModal from '@/components/select/bom/ProductModal.vue'
 export default {
     components: {
         factorySelect,
@@ -126,6 +134,7 @@ export default {
         // 修改回显的数据
         categoryId: [String, Number],
         data: Object,
+        taskId: [String, Number],
     },
     data() {
 
@@ -141,17 +150,18 @@ export default {
 
         const defaultForm = {
             id: null,
-
             code: '',
             name: '',
             version: '1.0',
             factoryId: '',
             type: 0,
             status: '',
-            produceVersionId: '',
+            isReworkBom: 0,
             baseCount: '',
             baseCountUnit: '',
-          
+            taskId: '',
+
+
 
         };
         return {
@@ -182,9 +192,7 @@ export default {
                     { required: true, message: '请选择状态', trigger: 'change' }
                 ],
 
-                produceVersionId: [
-                    { required: true, message: '请选择生产版本', trigger: 'change' }
-                ],
+
 
                 factoryId: [
                     { required: true, message: '请输入所属工厂', trigger: 'change' }
@@ -214,6 +222,13 @@ export default {
                     slot: 'categoryName',
                     action: 'categoryName'
                 },
+                {
+                    label: '是否回收料',
+                    prop: 'isReworkBom',
+                    slot: 'isReworkBom',
+                    action: 'isReworkBom'
+                 
+                },
                 {
                     label: '物料编码',
                     prop: 'categoryCode'
@@ -227,15 +242,18 @@ export default {
                     prop: 'modelType'
                 },
                 {
-                    label: '净重',
+                    label: '数量',
                     slot: 'count',
                     action: 'count'
                 },
                 {
-                    label: '重量单位',
+                    label: '单位',
                     slot: 'unit',
                     action: 'unit'
                 },
+
+
+
                 {
                     action: 'action',
                     slot: 'action',
@@ -250,6 +268,11 @@ export default {
                 { label: '生效', value: 1 }
             ],
 
+            isReworkBomList: [
+                { label: '否', value: 0 },
+                { label: '是', value: 1 }
+            ],
+
             // 提交状态
             loading: false,
             // 是否是修改
@@ -289,10 +312,13 @@ export default {
                 subCode,
                 categoryId: '',
                 categoryName: '',
+                isReworkBom: 0,
                 brandNum: '',
                 count: '',
                 modelType: '',
-                unit: ''
+                unit: '',
+                netWeight: '',
+                weightUnit: ''
             });
         },
 
@@ -303,15 +329,6 @@ export default {
             this.form.code = code;
         },
 
-        async getVersionList() {
-            const res = await pageList({
-                pageNum: 1,
-                size: 100
-            });
-
-            this.versionList = res.list;
-        },
-
         /* 保存编辑 */
         save() {
             this.$refs.form.validate((valid) => {
@@ -329,6 +346,7 @@ export default {
 
                 if (!this.isUpdate) {
                     delete this.form.id;
+                    this.form['taskId'] = this.taskId
                 }
 
                 const data = {
@@ -345,7 +363,7 @@ export default {
                     .then((msg) => {
                         this.loading = false;
                         this.$message.success(msg);
-                        this.$emit('done');
+                        this.$emit('done', this.form['taskId']);
                         this.visible = false
                     })
                     .catch((e) => {
@@ -357,7 +375,8 @@ export default {
 
 
         categorySelect(row, idx) {
-            this.$refs.productRefs.open(row, '选择物料', '1', idx)
+            // 3  type: 物料组
+            this.$refs.productRefs.open(row, '选择物料', 3, idx)
 
         },
 
@@ -367,6 +386,7 @@ export default {
                 this.$set(this.tableData[idx], 'categoryId', row.id)
                 this.$set(this.tableData[idx], 'categoryCode', row.code)
                 this.$set(this.tableData[idx], 'unit', row.measuringUnit)
+                this.$set(this.tableData[idx], 'weightUnit', row.weightUnit)
                 this.$set(this.tableData[idx], 'brandNum', row.brandNum)
                 this.$set(this.tableData[idx], 'modelType', row.modelType)
 
@@ -386,7 +406,7 @@ export default {
         async visible(visible) {
             if (visible) {
                 this._getCode()
-                this.getVersionList();
+
                 this.removeSubBomIdList = []
                 if (this.data) {
                     this.tableData = this.data.subDetailList

+ 271 - 102
src/views/material/product/components/MaterialModal.vue

@@ -1,11 +1,13 @@
 
 <template>
-    <ele-modal width="1160px" :visible="visible" v-if="visible" :append-to-body="true" :close-on-click-modal="true"
+    <ele-modal width="1260px" :visible="visible" v-if="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="120px">
             <el-row>
                 <el-col :span="8">
+
+
                     <el-form-item label="产品名称:" prop="name">
                         <el-input disabled v-model="form.name" readonly />
                     </el-form-item>
@@ -42,100 +44,131 @@
                 </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>
-
-            <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>
+
+            <el-button type="primary" size="small" style="margin-bottom: 10px;" @click="handleAddTab">添加工序</el-button>
+
+            <el-tabs v-model="tabsValue" type="card" closable @tab-click="handleTab" @tab-remove="removeTab">
+                <el-tab-pane v-for="(item, index) in tabsList" :key="item.id + index" :label="item.name" :name="item.id">
+
+
+
+                    <header-title title="物料BOM" style="margin-top: 10px">
+                        <div>
+                            <el-button size="small" icon="el-icon-plus" class="ele-btn-icon" type="primary"
+                                @click="handleAdd(item.id)">新增</el-button>
+                        </div>
+                    </header-title>
+
+                    <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="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:isReworkBom="{ row }">
+                                        {{ row.isReworkBom ? '是' : '否' }}
                                     </template>
-                                </el-popconfirm>
-                            </template>
-                        </ele-pro-table>
-                    </div>
-                </el-row>
-            </el-card>
+
+                                    <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-tab-pane>
+
+
+
+            </el-tabs>
+
+
+
+
+
+
         </el-form>
 
         <!-- 物料Bom -->
-        <MaterialAdd :visible.sync="materialShow" :data="current" :categoryId="categoryId" @done="done"
+        <MaterialAdd :visible.sync="materialShow" :taskId="taskId" :data="current" :categoryId="categoryId" @done="done"
             ref="materialAddRef">
         </MaterialAdd>
+
+        <!-- 添加工序 -->
+
+        <ele-modal width="1720px" :visible="addDialog" :append-to-body="true" :close-on-click-modal="true"
+            @update:visible="closeAdd">
+            <Production :tableData="tableData" ref="ProductionCom" />
+            <template v-slot:footer>
+                <el-button @click="closeAdd">取消</el-button>
+                <el-button type="primary" @click="addParamrter">
+                    添加
+                </el-button>
+            </template>
+        </ele-modal>
+
     </ele-modal>
 </template>
   
@@ -144,13 +177,15 @@
 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 { bomDelete, saveBatch, bomTaskList, bomTaskDelete, getByTaskId } from '@/api/material/BOM';
 import factorySelect from '@/components/CommomSelect/factory-select.vue';
+import Production from '@/views/technology/route/components/production/index.vue'
 
 export default {
     components: {
         MaterialAdd,
-        factorySelect
+        factorySelect,
+        Production
     },
     props: {
         // 弹窗是否打开
@@ -203,6 +238,15 @@ export default {
                     prop: 'categoryName',
                     action: 'categoryName'
                 },
+
+                {
+                    label: '是否回收料',
+                    prop: 'isReworkBom',
+                    action: 'isReworkBom',
+                    slot: 'isReworkBom',
+                    width: 95,
+                },
+
                 {
                     label: '物料编码',
                     prop: 'categoryCode'
@@ -216,13 +260,19 @@ export default {
                     prop: 'modelType'
                 },
                 {
-                    label: '净重',
+                    label: '数量',
                     prop: 'count'
                 },
                 {
-                    label: '重量单位',
+                    label: '计量单位',
                     prop: 'unit'
-                }
+                },
+
+         
+                {
+                    label: '单位',
+                    prop: 'weightUnit'
+                },
             ],
 
             statusList: [
@@ -238,7 +288,16 @@ export default {
 
             current: null,
 
-            materialShow: false
+            materialShow: false,
+
+            tabsList: [],
+            tableData: [],
+
+
+            taskId: null,
+
+            addDialog: false,
+            tabsValue: null
         };
     },
     computed: {
@@ -268,7 +327,8 @@ export default {
             this.versionList = res.list;
         },
 
-        handleAdd() {
+        handleAdd(id) {
+            this.taskId = id
             this.current = null;
             this.materialShow = true;
         },
@@ -278,9 +338,9 @@ export default {
             this.$emit('update:visible', value);
         },
 
-        async getCategoryBomFn() {
-            const res = await getCategoryBom(this.categoryId);
-            this.form.bomList = res.bomList;
+        async getCategoryBomFn(taskId) {
+            const res = await getByTaskId(this.categoryId, taskId);
+            this.form.bomList = res;
         },
 
         remove(row) {
@@ -294,9 +354,111 @@ export default {
                 });
         },
 
-        done() {
+        done(taskId) {
             this.materialShow = false
-            this.getCategoryBomFn();
+            this.getCategoryBomFn(taskId);
+        },
+
+        handleAddTab() {
+            this.tableData = this.tabsList
+            this.addDialog = true;
+        },
+
+        handleTab(e) {
+            this.getCategoryBomFn(e.name);
+        },
+
+        removeTab(targetName) {
+
+            this.$confirm('是否删除当前工序?', '提示', {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+            })
+                .then(() => {
+
+                    this.tabsList.forEach(e => {
+                        if (e.id == targetName) {
+                            bomTaskDelete([e.oldId]).then(res => {
+                                this.taskListHead()
+                            })
+                        }
+                    })
+                })
+                .catch(() => { });
+
+
+
+
+        },
+
+        /*关闭选择参数*/
+        closeAdd() {
+            this.$refs.ProductionCom.$refs.table.setSelectedRows([]);
+            this.addDialog = false;
+        },
+
+        addParamrter() {
+            let arr = [];
+            arr = this.$refs.ProductionCom.selection.map(m => {
+                return {
+                    sourceTaskId: m.id,
+                    ...m
+                }
+            })
+            if (arr.length == 0) {
+                this.addDialog = false;
+                return false
+            }
+            this.tabsList = arr
+            this.addDialog = false;
+            this.$refs.ProductionCom.$refs.table.setSelectedRows([]);
+            if (this.tabsList.length > 0) {
+                this.tabsValue = this.tabsList[0].id
+                this.saveBatchFn()
+            }
+
+
+
+        },
+
+        // 保存
+        saveBatchFn() {
+            let arr = [];
+            arr = this.tabsList.map(m => {
+                return {
+                    taskId: m.id,
+                    sort: m.sort,
+                    categoryId: this.categoryId
+                }
+            })
+
+            saveBatch(arr).then(res => {
+                this.taskListHead()
+            })
+        },
+
+        taskListHead(isFirst) {
+            console.log(isFirst)
+            bomTaskList(this.categoryId).then(res => {
+                let arr = []
+                arr = res.map(m => {
+                    return {
+                        oldId: m.id,
+                        sourceTaskId: m.id,
+                        id: m.taskId,
+                        name: m.taskName
+                    }
+                })
+                this.tabsList = arr
+
+                if (isFirst && this.tabsList.length > 0) {
+                    this.tabsValue = this.tabsList[0].id
+                    this.getCategoryBomFn(this.tabsList[0].id);
+                }
+            })
+
+
         },
 
     },
@@ -305,14 +467,17 @@ export default {
         async visible(visible) {
             if (visible) {
                 this.getVersionList();
+
                 if (this.data) {
                     this.categoryId = this.data.id;
-                    this.getCategoryBomFn();
+
                     this.$util.assignObject(this.form, {
                         ...this.data
                     });
                 } else {
                 }
+
+                this.taskListHead(true)
             } else {
                 this.$refs.form.clearValidate();
                 this.form = { ...this.defaultForm };
@@ -321,4 +486,8 @@ export default {
     }
 };
 </script>
+
+
+
+<style lang="scss" scoped></style>
   

+ 29 - 2
src/views/material/product/components/MoldInfo.vue

@@ -4,7 +4,7 @@
       <div class="divider">
         <div class="title">
           <div class="ele-bg-primary"></div>
-          <span>模具信息</span>
+          <span>工装模具信息</span>
         </div>
         <div class="ele-bg-primary ele-width"></div>
       </div>
@@ -53,13 +53,40 @@
           </el-form-item>
         </el-col>
 
-        <el-col :span="8">
+        <el-col :span="8" class="rx-sc">
           <el-form-item label="芯棒直径" prop="mandrelDiameter">
             <el-input v-model="form.mandrelDiameter">
             </el-input>
           </el-form-item>
         </el-col>
 
+        <el-col :span="24">
+         <div class="rx-sc">
+          <el-form-item label="长" prop="length">
+            <el-input v-model="form.length">
+              <template slot="append">mm</template>
+            </el-input>
+          </el-form-item>
+
+          <el-form-item label="宽" prop="breadth">
+            <el-input v-model="form.breadth">
+              <template slot="append">mm</template>
+            </el-input>
+          </el-form-item>
+
+          <el-form-item label="高" prop="altitude">
+            <el-input v-model="form.altitude">
+              <template slot="append">mm</template>
+            </el-input>
+          </el-form-item>
+          <el-form-item label="直径" prop="diameter">
+            <el-input v-model="form.diameter">
+              <template slot="append">mm</template>
+            </el-input>
+          </el-form-item>
+         </div>
+        </el-col>
+
       </el-row>
     </el-form>
   </div>

+ 2 - 26
src/views/material/product/components/TurnoverInfo.vue

@@ -9,11 +9,7 @@
         <div class="ele-bg-primary ele-width"></div>
       </div>
       <el-row :gutter="24">
-        <el-col :span="8">
-          <el-form-item label="层数" prop="levelNum">
-            <el-input v-model="form.levelNum" />
-          </el-form-item>
-        </el-col>
+
         <el-col :span="8">
           <el-form-item label="材质" prop="materialQuality">
             <DictSelection
@@ -25,27 +21,7 @@
             <!-- <el-input  v-model="form.materialQuality"/> -->
           </el-form-item>
         </el-col>
-        <el-col :span="8">
-          <el-form-item label="长" prop="vehicleLen">
-            <el-input v-model="form.vehicleLen">
-              <template slot="append">mm</template>
-            </el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :span="8">
-          <el-form-item label="宽" prop="wilde">
-            <el-input v-model="form.wilde">
-              <template slot="append">mm</template>
-            </el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :span="8">
-          <el-form-item label="高" prop="hight">
-            <el-input v-model="form.hight">
-              <template slot="append">mm</template>
-            </el-input>
-          </el-form-item>
-        </el-col>
+    
       </el-row>
     </el-form>
   </div>

+ 449 - 0
src/views/material/product/components/aridRegion.vue

@@ -0,0 +1,449 @@
+<template>
+  <ele-modal :visible.sync="visible" title="干燥区管理" width="60%" @close="cancel">
+
+
+    <el-form ref="form" :model="form" :rules="rules" label-width="140px">
+      <el-row>
+        <el-col :span="8">
+
+          <el-form-item label="行数" prop="levelNum">
+            <el-input v-model="form.levelNum" :disabled="form.positionList.length != 0" />
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="8">
+          <el-form-item label="列数" prop="lineNum">
+            <el-input v-model="form.lineNum" :disabled="form.positionList.length != 0" />
+          </el-form-item>
+        </el-col>
+
+
+        <el-col :span="8">
+          <el-form-item label="长" prop="regionLen">
+            <el-input v-model="form.regionLen" :disabled="form.positionList.length != 0">
+              <template slot="append">cm</template>
+            </el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="宽" prop="wilde">
+            <el-input v-model="form.wilde" :disabled="form.positionList.length != 0">
+              <template slot="append">cm</template>
+            </el-input>
+          </el-form-item>
+        </el-col>
+
+
+        <el-col :span="8">
+          <el-form-item label="位置" prop="region">
+            <el-input v-model="form.region">
+            </el-input>
+          </el-form-item>
+        </el-col>
+
+
+        <el-col :span="8">
+          <el-form-item>
+            <el-button size="small" v-if="form.positionList.length == 0" type="primary"
+              @click="handleHjCode">生成干燥区</el-button>
+            <el-button size="small" v-else type="primary" @click="addHjCode">添加干燥区</el-button>
+          </el-form-item>
+
+        </el-col>
+      </el-row>
+    </el-form>
+
+
+    <el-form :model="form" ref="tableForm" class="tableForm" :rules="tableFormRules">
+      <el-table ref="multipleTable" :data="form.positionList" tooltip-effect="dark" style="width: 100%" stripe
+        :header-cell-style="{ background: '#EEEEEE', border: 'none' }">
+
+
+        <el-table-column label="干燥区编号" prop="code" min-width="120">
+          <template slot-scope="{ row, $index }">
+            <el-form-item :prop="'positionList.' + $index + '.code'" :rules="tableFormRules.code">
+              <el-input placeholder="请输入" clearable v-model="row.code"></el-input>
+            </el-form-item>
+
+          </template></el-table-column>
+        <el-table-column label="干燥区长(cm)" min-width="120">
+          <template slot-scope="scope">
+            <el-form-item :prop="'positionList.' +
+              scope.$index +
+              'length'
+              " :rules="tableFormRules.length">
+              <el-input placeholder="请输入" type="number" v-model.number="scope.row.length
+                " clearable></el-input>
+            </el-form-item>
+
+          </template>
+        </el-table-column>
+        <el-table-column label="干燥区宽(cm)" min-width="120">
+          <template slot-scope="scope">
+            <el-form-item :prop="'positionList.' +
+              scope.$index +
+              '.breadth'
+              " :rules="tableFormRules.breadth">
+              <el-input placeholder="请输入" type="number" v-model.number="scope.row.breadth"></el-input>
+            </el-form-item>
+
+          </template>
+        </el-table-column>
+
+
+        <el-table-column label="基本干燥区面积(cm²)" min-width="120">
+          <template slot-scope="scope">
+            <el-form-item :prop="'positionList.' +
+              scope.$index +
+              '.area'
+              " :rules="tableFormRules.area">
+              <el-input placeholder="请输入" type="number" v-model.number="scope.row.area"></el-input>
+            </el-form-item>
+          </template>
+        </el-table-column>
+
+        <el-table-column label="操作" fixed="right">
+          <template slot-scope="{ $index, row }">
+            <el-button type="text" @click="removeGoods($index, row)">删除干燥区</el-button>
+          </template>
+        </el-table-column>
+
+
+      </el-table>
+    </el-form>
+
+
+    <div slot="footer" class="footer">
+      <el-button type="primary" @click="save">保存</el-button>
+      <el-button @click="cancel">取消</el-button>
+    </div>
+
+
+    <!-- 规则货架编号 -->
+    <el-dialog title="规则货架编号" append-to-body :visible.sync="hjCodeFalg" width="35%">
+      <el-form :model="hjForm">
+        <el-form-item label="规则类型" label-width="100px">
+          <el-radio-group v-model="hjForm.type">
+            <el-radio :label="1">字母</el-radio>
+            <el-radio :label="2">字母+数字</el-radio>
+            <el-radio :label="3">字母+数字(层级)</el-radio>
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item label="规则名称定义" label-width="100px">
+          <el-input v-model="hjForm.code" @input="handleInput"></el-input>
+          <span style="color: #dab8b8">注:只可输入大写A-Z</span>
+        </el-form-item>
+      </el-form>
+
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="hjCodeFalg = false">取 消</el-button>
+        <el-button @click="handleMine" type="primary">确 定</el-button>
+      </span>
+    </el-dialog>
+
+
+  </ele-modal>
+</template>
+    
+<script>
+import { aridRegion, aridRegionList } from '@/api/material/product';
+export default {
+
+  data() {
+
+
+    const defaultForm = {
+      categoryId: null,
+      levelNum: null,
+      lineNum: null,
+      hight: null,
+      wilde: null,
+      regionLen: null,
+      positionList: [],
+      removeIds: []
+    };
+
+    return {
+      visible: false,
+
+      form: {
+        ...defaultForm
+      },
+
+      code: '',
+
+      hjCodeFalg: false,
+
+      hjForm: { code: '', type: 1 },
+
+      rules: {
+        levelNum: [
+          { required: true, message: '请输入层数', trigger: 'blur' }
+        ],
+        lineNum: [
+          { required: true, message: '请输入列数', trigger: 'blur' }
+        ],
+        region: [
+        { required: true, message: '请输入位置', trigger: 'blur' }
+        ]
+      },
+
+      tableFormRules: {
+
+
+        code: [
+          // {
+          //     validator: (_rule, value, callback) => {
+          //       if (!value) {
+          //         return callback(new Error('请输入干燥区编码'));
+          //       }
+          //       if (value == this.code+ '-') {
+          //         return callback(new Error('请完善干燥区编码'));
+          //       }
+          //       callback();
+          //     },
+          //     trigger: 'blur'
+          //   }
+
+          {
+            required: true,
+            message: '请输入干燥区编码',
+            trigger: 'blur'
+          }
+        ]
+      }
+
+    };
+  },
+  created() {
+
+  },
+  computed: {
+
+
+
+
+  },
+  methods: {
+    open(row) {
+
+
+      this.visible = true;
+
+      this.code = row.code
+      this.form.categoryId = row.id
+      this.getList()
+    },
+    cancel() {
+      this.$refs.form.clearValidate();
+      this.form = { ...this.defaultForm };
+      this.form.positionList = []
+      this.visible = false;
+
+
+
+    },
+
+    getList() {
+      aridRegionList(this.form.categoryId).then(res => {
+        if (res) {
+          this.form = res
+          this.form['removeIds'] = []
+        }
+      })
+    },
+
+    removeGoods(idx, row) {
+      if (this.form.positionList.length == 1) {
+        return this.$message.error('至少保留一个干燥区!');
+      }
+
+      this.$confirm(`是否删除这个干燥区?`).then(async () => {
+        this.form.positionList.splice(idx, 1)
+
+
+        this.form['removeIds'].push(row.id)
+
+      })
+    },
+
+    handleHjCode() {
+
+      this.$refs.form.validate((valid) => {
+        if (valid) {
+          this.hjCodeFalg = true;
+        }
+      })
+
+
+    },
+
+
+    addHjCode() {
+      this.$prompt('请输入', '添加干燥区数', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        inputPattern: /[1-9]\d*/,
+        inputErrorMessage: '请输入正整数'
+      }).then(({ value }) => {
+
+        for (var i = 0; i < value; i++) {
+          let obj1111 = {
+            code: '',
+            length: this.form.regionLen ? Number(this.form.regionLen / Number(this.form.lineNum)).toFixed(0) : '',
+            breadth: this.form.wilde,
+            altitude: this.form.hight ? Number(this.form.hight / Number(this.form.levelNum)).toFixed(0) : '',
+            area: ''
+          };
+
+          this.form.positionList.push(obj1111)
+        }
+      }).catch(() => {
+
+
+
+      });
+    },
+
+    handleMine() {
+      this.$refs.form.clearValidate()
+      const ruleName = this.hjForm.code;
+      let preCode = 0;
+      let codeEng = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
+      let currentLetterIndex = 0;
+      this.form.positionList = []
+
+      if (ruleName.length > 0) {
+        // 计算初始索引
+        let multiplier = Math.pow(codeEng.length, ruleName.length - 1);
+        for (let i = 0; i < ruleName.length; i++) {
+          currentLetterIndex +=
+            (codeEng.indexOf(ruleName[i]) + 1) * multiplier;
+          multiplier /= codeEng.length;
+        }
+      }
+
+
+      if (this.hjForm.type == 3) {
+        for (let i = 0; i < this.form.levelNum; i++) {
+          // 获取当前字母
+          let index = currentLetterIndex;
+          let dividend = codeEng.length;
+          let remainder;
+          let quotient;
+          let code = '';
+
+
+          while (index > 0) {
+            remainder = index % dividend;
+            quotient = Math.floor(index / dividend);
+
+            if (remainder === 0) {
+              remainder = codeEng.length;
+              quotient--;
+            }
+            code = codeEng[remainder - 1] + code;
+            index = quotient;
+          }
+
+          for (let j = 0; j < this.form.lineNum; j++) {
+            let obj1111 = {
+              code: code + (j + 1),
+              length: this.form.regionLen ? Number(this.form.regionLen / Number(this.form.lineNum)).toFixed(0) : '',
+              breadth: this.form.wilde,
+              altitude: this.form.hight ? Number(this.form.hight / Number(this.form.levelNum)).toFixed(0) : '',
+              weightLimit: '',
+              area: ''
+            };
+
+            this.form.positionList.push(obj1111)
+
+
+
+          }
+
+
+
+          currentLetterIndex++; // 自增索引
+          this.hjCodeFalg = false
+        }
+
+      } else {
+        let num = Number(this.form.levelNum) * Number(this.form.lineNum)
+
+
+        for (let i = 0; i < num; i++) {
+          // 获取当前字母
+          let index = currentLetterIndex;
+          let dividend = codeEng.length;
+          let remainder;
+          let quotient;
+          let code = '';
+
+
+          while (index > 0) {
+            remainder = index % dividend;
+            quotient = Math.floor(index / dividend);
+
+            if (remainder === 0) {
+              remainder = codeEng.length;
+              quotient--;
+            }
+            code = codeEng[remainder - 1] + code;
+            index = quotient;
+          }
+
+
+
+
+          let obj1111 = {
+            code: this.hjForm.type === 1 ? code : ruleName + (i + 1),
+            length: this.form.regionLen ? Number(this.form.regionLen / Number(this.form.lineNum)).toFixed(0) : '',
+            breadth: this.form.wilde,
+            altitude: this.form.levelNum ? Number(this.form.hight / Number(this.form.levelNum)).toFixed(0) : '',
+            weightLimit: '',
+            area: ''
+          };
+          this.form.positionList.push(obj1111)
+
+
+          currentLetterIndex++; // 自增索引
+          this.hjCodeFalg = false
+        }
+      }
+
+
+
+    },
+
+    handleInput(event) {
+      // 只允许输入 A-Z 的大写字母
+      let filteredValue = this.hjForm.code.replace(/[^A-Z]/g, '');
+      this.hjForm.code = filteredValue;
+    },
+
+    save() {
+      this.$refs.tableForm.validate((valid) => {
+        if (valid) {
+
+
+          aridRegion(this.form).then(res => {
+            this.cancel()
+          })
+        }
+      })
+    }
+
+
+
+
+  }
+};
+</script>
+    
+<style lang="scss" scoped>
+.el-form-item {
+  margin-bottom: 20px !important;
+}
+</style>
+    

+ 1 - 1
src/views/material/product/components/codeDialog.vue

@@ -56,7 +56,7 @@ export default {
             loading: false,
 
             formData: {
-                leave: 'CX',
+                leave: 'CCSB',
                 leave2: null,
                 leave3: null,
                 code: null

+ 442 - 0
src/views/material/product/components/goodsAllocation.vue

@@ -0,0 +1,442 @@
+<template>
+  <ele-modal :visible.sync="visible" title="货位管理" width="60%" @close="cancel">
+
+
+    <el-form ref="form" :model="form" :rules="rules" label-width="140px">
+      <el-row>
+        <el-col :span="8">
+          <el-form-item label="层数" prop="levelNum">
+            <el-input v-model="form.levelNum" :disabled="form.positionList.length != 0" />
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="8">
+          <el-form-item label="列数" prop="lineNum">
+            <el-input v-model="form.lineNum" :disabled="form.positionList.length != 0" />
+          </el-form-item>
+        </el-col>
+
+
+        <el-col :span="8">
+          <el-form-item label="长" prop="vehicleLen">
+            <el-input v-model="form.vehicleLen" :disabled="form.positionList.length != 0">
+              <template slot="append">cm</template>
+            </el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="宽" prop="wilde">
+            <el-input v-model="form.wilde" :disabled="form.positionList.length != 0">
+              <template slot="append">cm</template>
+            </el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="高" prop="hight">
+            <el-input v-model="form.hight" :disabled="form.positionList.length != 0">
+              <template slot="append">cm</template>
+            </el-input>
+          </el-form-item>
+        </el-col>
+
+
+        <el-col :span="8">
+          <el-form-item>
+            <el-button size="small" v-if="form.positionList.length == 0" type="primary"
+              @click="handleHjCode">生成货位</el-button>
+            <el-button size="small" v-else type="primary" @click="addHjCode">添加货位</el-button>
+          </el-form-item>
+
+        </el-col>
+      </el-row>
+    </el-form>
+
+
+    <el-form :model="form" ref="tableForm" class="tableForm" :rules="tableFormRules">
+      <el-table ref="multipleTable" :data="form.positionList" tooltip-effect="dark" style="width: 100%" stripe
+        :header-cell-style="{ background: '#EEEEEE', border: 'none' }">
+
+
+        <el-table-column label="货位编号" prop="code" min-width="120">
+          <template slot-scope="{ row, $index }">
+            <el-form-item :prop="'positionList.' + $index + '.code'" :rules="tableFormRules.code">
+              <el-input placeholder="请输入" clearable v-model="row.code"></el-input>
+            </el-form-item>
+
+          </template></el-table-column>
+        <el-table-column label="货位长(cm)" min-width="120">
+          <template slot-scope="scope">
+            <el-form-item :prop="'positionList.' +
+              scope.$index +
+              'length'
+              " :rules="tableFormRules.length">
+              <el-input placeholder="请输入" type="number" v-model.number="scope.row.length
+                " clearable></el-input>
+            </el-form-item>
+
+          </template>
+        </el-table-column>
+        <el-table-column label="货位宽(cm)" min-width="120">
+          <template slot-scope="scope">
+            <el-form-item :prop="'positionList.' +
+              scope.$index +
+              '.breadth'
+              " :rules="tableFormRules.breadth">
+              <el-input placeholder="请输入" type="number" v-model.number="scope.row.breadth"></el-input>
+            </el-form-item>
+
+          </template>
+        </el-table-column>
+        <el-table-column label="货位高(cm)" min-width="120">
+          <template slot-scope="scope">
+            <el-form-item :prop="'positionList.' +
+              scope.$index +
+              '.altitude'
+              " :rules="tableFormRules.altitude">
+              <el-input placeholder="请输入" type="number" v-model.number="scope.row.altitude"></el-input>
+            </el-form-item>
+
+          </template>
+        </el-table-column>
+        <el-table-column label="限重(kg)" min-width="120">
+          <template slot-scope="scope">
+            <el-form-item :prop="'positionList.' +
+              scope.$index +
+              '.weightLimit'
+              " :rules="tableFormRules.weightLimit">
+              <el-input placeholder="请输入" type="number" v-model.number="scope.row.weightLimit"></el-input>
+            </el-form-item>
+          </template>
+        </el-table-column>
+        <el-table-column label="基本货位容积(cm³)" min-width="120">
+          <template slot-scope="scope">
+            <el-form-item :prop="'positionList.' +
+              scope.$index +
+              '.volume'
+              " :rules="tableFormRules.volume">
+              <el-input placeholder="请输入" type="number" v-model.number="scope.row.volume"></el-input>
+            </el-form-item>
+          </template>
+        </el-table-column>
+
+        <el-table-column label="操作" fixed="right">
+          <template slot-scope="{ $index, row }">
+            <el-button type="text" @click="removeGoods($index, row)">删除货架</el-button>
+          </template>
+        </el-table-column>
+
+
+      </el-table>
+    </el-form>
+
+
+    <div slot="footer" class="footer">
+      <el-button type="primary" @click="save">保存</el-button>
+      <el-button @click="cancel">取消</el-button>
+    </div>
+
+
+    <!-- 规则货架编号 -->
+    <el-dialog title="规则货架编号" append-to-body :visible.sync="hjCodeFalg" width="35%">
+      <el-form :model="hjForm">
+        <el-form-item label="规则类型" label-width="100px">
+          <el-radio-group v-model="hjForm.type">
+            <el-radio :label="1">字母</el-radio>
+            <el-radio :label="2">字母+数字</el-radio>
+            <el-radio :label="3">字母+数字(层级)</el-radio>
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item label="规则名称定义" label-width="100px">
+          <el-input v-model="hjForm.code" @input="handleInput"></el-input>
+          <span style="color: #dab8b8">注:只可输入大写A-Z</span>
+        </el-form-item>
+      </el-form>
+
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="hjCodeFalg = false">取 消</el-button>
+        <el-button @click="handleMine" type="primary">确 定</el-button>
+      </span>
+    </el-dialog>
+
+
+  </ele-modal>
+</template>
+  
+<script>
+import { categoryVehicle, categoryVehicleList } from '@/api/material/product';
+export default {
+
+  data() {
+    const defaultForm = {
+      categoryId: null,
+      levelNum: null,
+      lineNum: null,
+      hight: null,
+      wilde: null,
+      vehicleLen: null,
+      positionList: [],
+      removeIds: []
+    };
+
+    return {
+      visible: false,
+
+      form: {
+        ...defaultForm
+      },
+
+
+      hjCodeFalg: false,
+
+      hjForm: { code: '', type: 1 },
+
+      rules: {
+        levelNum: [
+          { required: true, message: '请输入层数', trigger: 'blur' }
+        ],
+        lineNum: [
+          { required: true, message: '请输入列数', trigger: 'blur' }
+        ],
+      },
+
+      tableFormRules: {
+        code: {
+          required: true,
+          message: '请输入货位编号',
+          trigger: 'blur'
+        },
+      }
+
+    };
+  },
+  created() {
+
+  },
+  computed: {
+
+
+
+
+  },
+  methods: {
+    open(row) {
+
+
+      this.visible = true;
+
+
+      this.form.categoryId = row.id
+      this.getList()
+    },
+    cancel() {
+      this.$refs.form.clearValidate();
+      this.form = { ...this.defaultForm };
+      this.form.positionList = []
+      this.visible = false;
+
+
+
+    },
+
+    getList() {
+      categoryVehicleList(this.form.categoryId).then(res => {
+        if (res) {
+          this.form = res
+          this.form['removeIds'] = []
+        }
+      })
+    },
+
+    removeGoods(idx, row) {
+      if (this.form.positionList.length == 1) {
+        return this.$message.error('至少保留一个货架!');
+      }
+
+      this.$confirm(`是否删除这个货架?`).then(async () => {
+        this.form.positionList.splice(idx, 1)
+
+
+        this.form['removeIds'].push(row.id)
+
+      })
+    },
+
+    handleHjCode() {
+
+      this.$refs.form.validate((valid) => {
+        if (valid) {
+          this.hjCodeFalg = true;
+        }
+      })
+
+
+    },
+
+
+    addHjCode() {
+      this.$prompt('请输入', '添加货位数', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        inputPattern: /[1-9]\d*/,
+        inputErrorMessage: '请输入正整数'
+      }).then(({ value }) => {
+
+        for (var i = 0; i < value; i++) {
+          let obj1111 = {
+            code: '',
+            length: this.form.vehicleLen ? Number(this.form.vehicleLen / Number(this.form.lineNum)).toFixed(0) : '',
+            breadth: this.form.wilde,
+            altitude: this.form.hight ? Number(this.form.hight / Number(this.form.levelNum)).toFixed(0) : '',
+            weightLimit: '',
+            volume: ''
+          };
+
+          this.form.positionList.push(obj1111)
+        }
+      }).catch(() => {
+
+
+
+      });
+    },
+
+    handleMine() {
+      this.$refs.form.clearValidate()
+      const ruleName = this.hjForm.code;
+      let preCode = 0;
+      let codeEng = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
+      let currentLetterIndex = 0;
+      this.form.positionList = []
+
+      if (ruleName.length > 0) {
+        // 计算初始索引
+        let multiplier = Math.pow(codeEng.length, ruleName.length - 1);
+        for (let i = 0; i < ruleName.length; i++) {
+          currentLetterIndex +=
+            (codeEng.indexOf(ruleName[i]) + 1) * multiplier;
+          multiplier /= codeEng.length;
+        }
+      }
+
+
+      if (this.hjForm.type == 3) {
+        for (let i = 0; i < this.form.levelNum; i++) {
+          // 获取当前字母
+          let index = currentLetterIndex;
+          let dividend = codeEng.length;
+          let remainder;
+          let quotient;
+          let code = '';
+
+
+          while (index > 0) {
+            remainder = index % dividend;
+            quotient = Math.floor(index / dividend);
+
+            if (remainder === 0) {
+              remainder = codeEng.length;
+              quotient--;
+            }
+            code = codeEng[remainder - 1] + code;
+            index = quotient;
+          }
+
+          for (let j = 0; j < this.form.lineNum; j++) {
+            let obj1111 = {
+              code: code + (j + 1),
+              length: this.form.vehicleLen ? Number(this.form.vehicleLen / Number(this.form.lineNum)).toFixed(0) : '',
+              breadth: this.form.wilde,
+              altitude: this.form.hight ? Number(this.form.hight / Number(this.form.levelNum)).toFixed(0) : '',
+              weightLimit: '',
+              volume: ''
+            };
+
+            this.form.positionList.push(obj1111)
+
+
+
+          }
+
+
+
+          currentLetterIndex++; // 自增索引
+          this.hjCodeFalg = false
+        }
+
+      } else {
+        let num = Number(this.form.levelNum) * Number(this.form.lineNum)
+
+
+        for (let i = 0; i < num; i++) {
+          // 获取当前字母
+          let index = currentLetterIndex;
+          let dividend = codeEng.length;
+          let remainder;
+          let quotient;
+          let code = '';
+
+
+          while (index > 0) {
+            remainder = index % dividend;
+            quotient = Math.floor(index / dividend);
+
+            if (remainder === 0) {
+              remainder = codeEng.length;
+              quotient--;
+            }
+            code = codeEng[remainder - 1] + code;
+            index = quotient;
+          }
+
+
+
+
+          let obj1111 = {
+            code: this.hjForm.type === 1 ? code : ruleName + (i + 1),
+            length: this.form.vehicleLen ? Number(this.form.vehicleLen / Number(this.form.lineNum)).toFixed(0) : '',
+            breadth: this.form.wilde,
+            altitude: this.form.levelNum ? Number(this.form.hight / Number(this.form.levelNum)).toFixed(0) : '',
+            weightLimit: '',
+            volume: ''
+          };
+          this.form.positionList.push(obj1111)
+
+
+          currentLetterIndex++; // 自增索引
+          this.hjCodeFalg = false
+        }
+      }
+
+
+
+    },
+
+    handleInput(event) {
+      // 只允许输入 A-Z 的大写字母
+      let filteredValue = this.hjForm.code.replace(/[^A-Z]/g, '');
+      this.hjForm.code = filteredValue;
+    },
+
+    save() {
+      this.$refs.tableForm.validate((valid) => {
+        if (valid) {
+          categoryVehicle(this.form).then(res => {
+            this.cancel()
+          })
+        }
+      })
+    }
+
+
+
+
+  }
+};
+</script>
+  
+<style lang="scss" scoped>
+.el-form-item {
+  margin-bottom: 20px !important;
+}
+</style>
+  

+ 37 - 5
src/views/material/product/components/index-data.vue

@@ -33,15 +33,15 @@
 
       </template>
       <template v-slot:action="{ row }">
-        <el-link type="primary" :underline="false" icon="el-icon-copy-document" @click="openEdit(row, 1)">
+        <el-link type="primary" :underline="false" @click="openEdit(row, 1)">
           复制
         </el-link>
-        <el-link type="primary" :underline="false" icon="el-icon-edit" @click="openEdit(row, 0)">
+        <el-link type="primary" :underline="false"  @click="openEdit(row, 0)">
           修改
         </el-link>
         <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 type="danger" :underline="false" >
               删除
             </el-link>
           </template>
@@ -63,6 +63,15 @@
         </el-link>
 
 
+        <el-link  type="primary" v-if="row.categoryLevelPathIdParent == 7" :underline="false"  @click="handAllocation(row)" >
+          货位
+        </el-link>
+
+        <el-link  type="primary" v-if="row.categoryLevelPathIdParent == 11" :underline="false"  @click="handleAridRegion(row)" >
+          干燥区
+        </el-link>
+
+
       </template>
     </ele-pro-table>
     <!-- 编辑弹窗 -->
@@ -79,6 +88,12 @@
 
     <linkMaterialDialog ref="linkMaterialDialogRef" @success="success" />
 
+    <!-- 货位 -->
+    <goodsAllocation ref="allocationRef"></goodsAllocation>
+    
+    <!-- 干燥区 -->
+    <aridRegion ref="aridRegionRef"></aridRegion>
+    
   </div>
 </template>
 
@@ -88,12 +103,16 @@ import MaterialModal from './MaterialModal.vue'
 import ParamEdit from '@/views/technology/productParam/components/user-edit.vue'
 import mouldDialog from './mouldDialog'
 import linkMaterialDialog from './link-material-dialog.vue';
+import goodsAllocation from './goodsAllocation.vue'
+import aridRegion from './aridRegion'
 export default {
   components: {
     MaterialModal,
     ParamEdit,
     mouldDialog,
-    linkMaterialDialog
+    linkMaterialDialog,
+    goodsAllocation,
+    aridRegion
   },
   props: {
     // 物料组id
@@ -211,7 +230,9 @@ export default {
       mouldShow: false,
       current: null,
 
-      rowCurrent: null
+      rowCurrent: null,
+
+  
 
     };
   },
@@ -297,6 +318,17 @@ export default {
       },
 
 
+      handAllocation(row) {
+        this.$refs.allocationRef.open(row)
+      },
+
+      handleAridRegion(row){
+        this.$refs.aridRegionRef.open(row)
+      }
+
+
+
+
 
   },
   watch: {

+ 12 - 8
src/views/material/product/components/index-search.vue

@@ -8,33 +8,37 @@
     @submit.native.prevent
   >
     <el-row :gutter="10">
+
+      
       <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
-        <el-form-item label="编码">
+        <el-form-item label="关键词">
           <el-input
             clearable
             size="small"
-            v-model="where.code"
-            placeholder="请输入"
+            v-model="where.searchKey"
+            placeholder="型号、牌号"
           />
         </el-form-item>
       </el-col>
+
+
+
       <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
-        <el-form-item label="名称">
+        <el-form-item label="编码">
           <el-input
             clearable
             size="small"
-            v-model="where.name"
+            v-model="where.code"
             placeholder="请输入"
           />
         </el-form-item>
       </el-col>
-
       <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
-        <el-form-item label="型号">
+        <el-form-item label="名称">
           <el-input
             clearable
             size="small"
-            v-model="where.modelType"
+            v-model="where.name"
             placeholder="请输入"
           />
         </el-form-item>

+ 8 - 0
src/views/material/product/detail.vue

@@ -213,6 +213,14 @@ export default {
         ],
         measuringUnit: [
           { required: true, message: '请选择计量单位', trigger: 'change' }
+        ],
+
+        weightUnit: [
+        { required: true, message: '请选择重量单位', trigger: 'change' }
+        ],
+
+        packingUnit: [
+        { required: true, message: '请选择包装单位', trigger: 'change' }
         ]
       },
       PathInfo: {},

+ 9 - 8
src/views/system/dictionary/components/dict-edit.vue

@@ -23,25 +23,26 @@
       style="margin-bottom: 10px"
     >
       <el-row>
+  
         <el-col :span="12">
-          <el-form-item label="字典名称:" prop="name">
+          <el-form-item label="字典值:" prop="code">
             <el-input
               clearable
-              :disabled="isUpdate"
+            
               :maxlength="20"
-              v-model="form.name"
-              placeholder="请输入字典名称"
+              v-model="form.code"
+              placeholder="请输入字典值"
             />
           </el-form-item>
         </el-col>
         <el-col :span="12">
-          <el-form-item label="字典值:" prop="code">
+          <el-form-item label="字典名称:" prop="name">
             <el-input
               clearable
-            
+              :disabled="isUpdate"
               :maxlength="20"
-              v-model="form.code"
-              placeholder="请输入字典值"
+              v-model="form.name"
+              placeholder="请输入字典名称"
             />
           </el-form-item>
         </el-col>

+ 1 - 1
src/views/system/menu/index.vue

@@ -139,7 +139,7 @@ export default {
           label: '权限编码',
           align: 'center',
           showOverflowTooltip: true,
-          width: 60
+          minWidth: 110
         },
 
         {

+ 51 - 3
src/views/system/organization/components/org-edit.vue

@@ -29,6 +29,29 @@
             />
           </el-form-item>
         </el-col>
+        <el-col :span="12">
+          <el-form-item
+            label="机构类型"
+            prop="type"
+            style="margin-bottom: 22px"
+          >
+            <DictSelection dictName="机构类型" clearable v-model="form.type" labelName='dictValue'>
+            </DictSelection>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item
+            label="负责人"
+            prop="manager"
+            style="margin-bottom: 22px"
+          >
+            <el-input
+              @click.native="openStaffSelection"
+              v-model="responsibleName"
+              placeholder="请选择"
+            ></el-input>
+          </el-form-item>
+        </el-col>
       </el-row>
     </el-form>
     <template v-slot:footer>
@@ -37,19 +60,25 @@
         保存
       </el-button>
     </template>
+    <staffSelection
+      ref="staffSelection"
+      @confirm="confirmStaffSelection"
+    ></staffSelection>
   </ele-modal>
 </template>
 
 <script>
   import OrgSelect from './org-select.vue';
   import OrgTypeSelect from './org-type-select.vue';
+  import staffSelection from './staffSelection.vue';
+
   import {
     addOrganization,
     updateOrganization
   } from '@/api/system/organization';
 
   export default {
-    components: { OrgSelect, OrgTypeSelect },
+    components: { OrgSelect, OrgTypeSelect, staffSelection },
     props: {
       // 弹窗是否打开
       visible: Boolean,
@@ -65,15 +94,19 @@
         id: null,
         parentId: null,
         name: '',
-        type: 1
+        type: '',
+        manager: []
       };
       return {
         defaultForm,
+        responsibleName: '',
         // 表单数据
         form: { ...defaultForm },
         // 表单验证规则
         rules: {
-          name: [{ required: true, message: '请输入机构名称', trigger: 'blur' }]
+          name: [{ required: true, message: '请输入机构名称', trigger: 'blur' }],
+          manager: [{ required: true, message: '请选择负责人', trigger: 'blur' }],
+          type: [{ required: true, message: '请选择机构类型', trigger: 'blur' }]
         },
         // 提交状态
         loading: false,
@@ -90,6 +123,7 @@
     methods: {
       /* 保存编辑 */
       save() {
+        console.log(this.form);
         this.$refs.form.validate((valid) => {
           if (!valid) {
             return false;
@@ -118,6 +152,17 @@
             });
         });
       },
+      //选择负责人
+      confirmStaffSelection(data) {
+        this.form.manager=JSON.parse(JSON.stringify(data))
+        this.responsibleName=data.map(item=>item.name).toString()
+      },
+      openStaffSelection() {
+        console.log(this.form.manager)
+        this.$refs.staffSelection.open(
+          JSON.parse(JSON.stringify(this.form.manager))||[]
+        );
+      },
       /* 更新visible */
       updateVisible(value) {
         this.$emit('update:visible', value);
@@ -131,6 +176,8 @@
               ...this.data,
               parentId: this.data.parentId == 0 ? '' : this.data.parentId ?? ''
             });
+            this.form.type=''+this.form.type //回显
+            this.responsibleName=this.data.manager&&this.data.manager.map(item=>item.name).toString()
             this.isUpdate = true;
           } else {
             this.form.parentId = this.parentId;
@@ -139,6 +186,7 @@
         } else {
           this.$refs.form.clearValidate();
           this.form = { ...this.defaultForm };
+          this.responsibleName=''
         }
       }
     }

+ 7 - 0
src/views/system/organization/components/org-select.vue

@@ -1,6 +1,7 @@
 <!-- 机构选择下拉框 -->
 <template>
   <ele-tree-select
+    ref="tree"
     clearable
     :value="value || ''"
     :data="data"
@@ -29,6 +30,12 @@
       /* 更新选中数据 */
       updateValue(value) {
         this.$emit('input', value);
+
+        let nodesInfo = []
+         nodesInfo = this.$refs['tree'].getHalfCheckedKeys()
+        nodesInfo.push(value)
+        this.$emit('checkedKeys', nodesInfo)
+
       }
     }
   };

+ 234 - 289
src/views/system/organization/components/org-user-edit.vue

@@ -1,185 +1,92 @@
 <!-- 用户编辑弹窗 -->
 <template>
-  <ele-modal
-    width="800px"
-    :visible="visible"
-    :close-on-click-modal="true"
-    custom-class="ele-dialog-form"
-    :title="isUpdate ? '修改人员' : '添加人员'"
-    @update:visible="updateVisible"
-  >
+  <ele-modal width="800px" :visible="visible" :close-on-click-modal="true" custom-class="ele-dialog-form"
+    :title="isUpdate ? '修改人员' : '添加人员'" @update:visible="updateVisible">
     <el-form ref="form" :model="form" :rules="rules" label-width="82px">
       <el-row :gutter="15">
         <el-col v-bind="styleResponsive ? { sm: 12 } : { span: 12 }">
           <el-form-item label="所属机构:">
-            <org-select
-              :data="organizationList"
-              placeholder="请选择所属机构"
-              v-model="form.groupId"
-            />
+            <org-select :data="organizationList" placeholder="请选择所属机构" v-model="form.groupId"
+              @checkedKeys="checkedKeys" />
           </el-form-item>
+
+          <el-form-item label="负责部门:">
+
+
+            <el-cascader class="ele-block" :options="organizationList" placeholder="请选择负责部门" :props="defaultProps"
+              collapse-tags v-model="deptTree" clearable></el-cascader>
+
+          </el-form-item>
+
+
+
           <el-form-item label="性别:" prop="sex">
-            <el-select
-              clearable
-              class="ele-block"
-              v-model="form.sex"
-              placeholder="请选择性别"
-            >
+            <el-select clearable class="ele-block" v-model="form.sex" placeholder="请选择性别">
               <el-option label="男" :value="1" />
               <el-option label="女" :value="2" />
             </el-select>
           </el-form-item>
           <el-form-item label="员工状态:" prop="status">
-            <el-select
-              clearable
-              class="ele-block"
-              v-model="form.status"
-              placeholder="请选择员工状态"
-            >
-              <el-option
-                v-for="item in statusOptions"
-                :key="item.value"
-                :label="item.label"
-                :value="item.value"
-              >
+            <el-select clearable class="ele-block" v-model="form.status" placeholder="请选择员工状态">
+              <el-option v-for="item in statusOptions" :key="item.value" :label="item.label" :value="item.value">
               </el-option>
             </el-select>
           </el-form-item>
 
           <el-form-item label="岗位:" prop="postName">
-            <el-input
-              clearable
-              :maxlength="100"
-              v-model="form.postName"
-              placeholder="请输入岗位"
-            />
+            <el-input clearable :maxlength="100" v-model="form.postName" placeholder="请输入岗位" />
           </el-form-item>
 
           <el-form-item label="工种:" prop="workTypeId">
             <DictSelection dictName="工种" clearable filterable v-model="form.workTypeId">
             </DictSelection>
           </el-form-item>
-          
-
-
-
 
           <el-form-item label="籍贯:" prop="city">
-            <regions-select
-              style="width: 100%"
-              v-model="city"
-              placeholder="请选择省市区"
-            />
+            <regions-select style="width: 100%" v-model="city" placeholder="请选择省市区" />
           </el-form-item>
           <el-form-item label="生日:" prop="age">
-            <el-date-picker
-              style="width: 100%"
-              clearable
-              v-model="form.birthday"
-              type="date"
-              value-format="yyyy-MM-dd"
-              placeholder="请选择日期"
-            >
+            <el-date-picker style="width: 100%" clearable v-model="form.birthday" type="date" value-format="yyyy-MM-dd"
+              placeholder="请选择日期">
             </el-date-picker>
           </el-form-item>
           <el-form-item label="入职时间:" prop="joinDate">
-            <el-date-picker
-              style="width: 100%"
-              clearable
-              v-model="form.joinDate"
-              type="date"
-              value-format="yyyy-MM-dd"
-              placeholder="请选择日期"
-            >
+            <el-date-picker style="width: 100%" clearable v-model="form.joinDate" type="date" value-format="yyyy-MM-dd"
+              placeholder="请选择日期">
             </el-date-picker>
           </el-form-item>
           <el-form-item label="毕业院校:" prop="school">
-            <el-input
-              clearable
-              :maxlength="100"
-              v-model="form.school"
-              placeholder="请输入毕业院校"
-            />
+            <el-input clearable :maxlength="100" v-model="form.school" placeholder="请输入毕业院校" />
           </el-form-item>
           <el-form-item label="微信号:" prop="wxId">
-            <el-input
-              clearable
-              :maxlength="100"
-              v-model="form.wxId"
-              placeholder="请输入微信号"
-            />
+            <el-input clearable :maxlength="100" v-model="form.wxId" placeholder="请输入微信号" />
           </el-form-item>
         </el-col>
         <el-col v-bind="styleResponsive ? { sm: 12 } : { span: 12 }">
           <el-form-item label="工号:" prop="jobNumber">
-            <el-input
-              clearable
-              type="text"
-              :maxlength="10"
-              v-model="form.jobNumber"
-              placeholder="请输入工号"
-              onkeyup="value=value.replace(/[^\x00-\xff]/g, '')"
-            />
+            <el-input clearable type="text" :maxlength="10" v-model="form.jobNumber" placeholder="请输入工号"
+              onkeyup="value=value.replace(/[^\x00-\xff]/g, '')" />
           </el-form-item>
           <el-form-item label="姓名:" prop="name">
-            <el-input
-              clearable
-              :maxlength="20"
-              v-model="form.name"
-              placeholder="请输入姓名"
-            />
+            <el-input clearable :maxlength="20" v-model="form.name" placeholder="请输入姓名" />
           </el-form-item>
           <el-form-item label="用户账号:">
-            <el-input
-              :disabled="true"
-              :maxlength="11"
-              v-model="form.loginName"
-              v-if="isUpdate && data.accountId"
-            />
-            <el-select
-              clearable
-              class="ele-block"
-              v-model="form.accountId"
-              filterable
-              placeholder="请选择用户账号"
-              v-else
-            >
-              <el-option
-                v-for="item in accountList"
-                :key="item.id"
-                :label="item.loginName"
-                :value="item.id"
-              >
+            <el-input :disabled="true" :maxlength="11" v-model="form.loginName" v-if="isUpdate && data.accountId" />
+            <el-select clearable class="ele-block" v-model="form.accountId" filterable placeholder="请选择用户账号" v-else>
+              <el-option v-for="item in accountList" :key="item.id" :label="item.loginName" :value="item.id">
               </el-option>
             </el-select>
           </el-form-item>
           <el-form-item label="手机号:" prop="phone">
-            <el-input
-              clearable
-              :maxlength="11"
-              v-model="form.phone"
-              placeholder="请输入手机号"
-            />
+            <el-input clearable :maxlength="11" v-model="form.phone" placeholder="请输入手机号" />
           </el-form-item>
           <el-form-item label="邮箱:" prop="email">
-            <el-input
-              clearable
-              :maxlength="100"
-              v-model="form.email"
-              placeholder="请输入邮箱"
-            />
+            <el-input clearable :maxlength="100" v-model="form.email" placeholder="请输入邮箱" />
           </el-form-item>
           <el-form-item label="年龄:" prop="age">
-            <el-input
-              type="number"
-              clearable
-              :maxlength="100"
-              v-model="form.age"
-              placeholder="请输入年龄"
-              onkeyup="value=value.replace(/[^\d.]/g,'')"
-            />
+            <el-input type="number" clearable :maxlength="100" v-model="form.age" placeholder="请输入年龄"
+              onkeyup="value=value.replace(/[^\d.]/g,'')" />
           </el-form-item>
-
         </el-col>
       </el-row>
     </el-form>
@@ -189,180 +96,218 @@
         保存
       </el-button>
     </template>
+
+
   </ele-modal>
 </template>
 
 <script>
-  import { emailReg, phoneReg } from 'ele-admin';
-  import OrgSelect from './org-select.vue';
-  import RoleSelect from '@/views/system/user/components/role-select.vue';
-  import RegionsSelect from '@/components/RegionsSelect/index.vue';
-  import { getNotBoundAccount } from '@/api/system/user';
-  import {
-    getUserDetail,
-    saveOrUpdateUser,
-    checkExistence
-  } from '@/api/system/organization';
-  export default {
-    components: { OrgSelect, RoleSelect, RegionsSelect },
-    props: {
-      // 弹窗是否打开
-      visible: Boolean,
-      // 修改回显的数据
-      data: Object,
-      // 全部机构
-      organizationList: Array,
-      // 机构id
-      organizationId: [Number, String]
-    },
-    data() {
-      const defaultForm = {
-        id: null,
-        groupId: null,
-        name: '',
-        sex: null,
-        email: '',
-        phone: '',
-        age: '',
-        accountId: '',
-        workTypeId: ''
-      };
-      return {
-        defaultForm,
-        // 表单数据
-        form: { ...defaultForm },
-        // 表单验证规则
-        rules: {
-          name: [{ required: true, message: '请输入姓名', trigger: 'blur' }],
-          sex: [{ required: true, message: '请选择性别', trigger: 'blur' }],
-          email: [
-            { pattern: emailReg, message: '邮箱格式不正确', trigger: 'blur' }
-          ],
-          phone: [
+import { emailReg, phoneReg } from 'ele-admin';
+import OrgSelect from './org-select.vue';
+import RoleSelect from '@/views/system/user/components/role-select.vue';
+import RegionsSelect from '@/components/RegionsSelect/index.vue';
+import { getNotBoundAccount } from '@/api/system/user';
+import {
+  getUserDetail,
+  saveOrUpdateUser,
+  checkExistence
+} from '@/api/system/organization';
+export default {
+  components: { OrgSelect, RoleSelect, RegionsSelect },
+  props: {
+    // 弹窗是否打开
+    visible: Boolean,
+    // 修改回显的数据
+    data: Object,
+    // 全部机构
+    organizationList: Array,
+    // 机构id
+    organizationId: [Number, String]
+  },
+  data() {
+    const defaultForm = {
+      id: null,
+      deptId: [
+      ],
+
+      groupId: null,
+      name: '',
+      sex: null,
+      email: '',
+      phone: '',
+      age: '',
+      accountId: '',
+      workTypeId: ''
+    };
+    return {
+      defaultForm,
+      // 表单数据
+      form: { ...defaultForm },
+      // 表单验证规则
+      rules: {
+        name: [{ required: true, message: '请输入姓名', trigger: 'blur' }],
+        sex: [{ required: true, message: '请选择性别', trigger: 'blur' }],
+        email: [
+          { pattern: emailReg, message: '邮箱格式不正确', trigger: 'blur' }
+        ],
+        phone: [
           { required: true, message: '请输入手机号', trigger: 'blur' },
-            { pattern: phoneReg, message: '手机号格式不正确', trigger: 'blur' }
-          ],
-          jobNumber: [
-            {
-              required: true,
-              trigger: 'blur',
-              validator: (_rule, value, callback) => {
-                if (!value) {
-                  return callback(new Error('请输入工号'));
-                }
-                checkExistence(this.form.jobNumber)
-                  .then((res) => {
-                    if (res != true && res != this.form.id) {
-                      callback(new Error('工号已经存在'));
-                    } else {
-                      callback();
-                    }
-                  })
-                  .catch(() => {
-                    callback();
-                  });
+          { pattern: phoneReg, message: '手机号格式不正确', trigger: 'blur' }
+        ],
+        jobNumber: [
+          {
+            required: true,
+            trigger: 'blur',
+            validator: (_rule, value, callback) => {
+              if (!value) {
+                return callback(new Error('请输入工号'));
               }
+              checkExistence(this.form.jobNumber)
+                .then((res) => {
+                  if (res != true && res != this.form.id) {
+                    callback(new Error('工号已经存在'));
+                  } else {
+                    callback();
+                  }
+                })
+                .catch(() => {
+                  callback();
+                });
             }
-          ],
-          status: [
-            { required: true, message: '请选择员工状态', trigger: 'blur' }
-          ]
-        },
-        // 提交状态
-        loading: false,
-        // 是否是修改
-        isUpdate: false,
-        city: '',
-        statusOptions: [
-          { value: 1, label: '全职' },
-          { value: 2, label: '兼职' },
-          { value: 3, label: '实习' },
-          { value: 4, label: '正式' },
-          { value: 5, label: '试用' },
-          { value: 6, label: '离职' }
-        ],
-        accountList: []
-      };
-    },
-    computed: {
-      // 是否开启响应式布局
-      styleResponsive() {
-        return this.$store.state.theme.styleResponsive;
-      }
-    },
-    methods: {
-      getAccountList() {
-        getNotBoundAccount().then((res) => {
-          this.accountList = res;
-        });
-      },
-      /* 保存编辑 */
-      save() {
-        this.$refs.form.validate((valid) => {
-          if (!valid) {
-            return false;
-          }
-          this.loading = true;
-          this.form.addressId = this.city
-            ? this.city[this.city.length - 1]
-            : '';
-          const data = {
-            ...this.form
-          };
-          if (!this.isUpdate) {
-            delete data.id;
           }
-          saveOrUpdateUser(data)
-            .then((msg) => {
-              this.loading = false;
-              if (this.isUpdate) {
-                this.$message.success('人员信息编辑成功');
-              } else {
-                this.$message.success('人员新增成功');
-              }
-              this.updateVisible(false);
-              this.$emit('done');
-            })
-            .catch((e) => {
-              this.loading = false;
-              // this.$message.error(e.message);
-            });
-        });
+        ],
+        status: [{ required: true, message: '请选择员工状态', trigger: 'blur' }]
       },
-      /* 更新visible */
-      updateVisible(value) {
-        this.$emit('update:visible', value);
+      // 提交状态
+      loading: false,
+      // 是否是修改
+      isUpdate: false,
+      city: '',
+      statusOptions: [
+        { value: 1, label: '全职' },
+        { value: 2, label: '兼职' },
+        { value: 3, label: '实习' },
+        { value: 4, label: '正式' },
+        { value: 5, label: '试用' },
+        { value: 6, label: '离职' }
+      ],
+      accountList: [],
+
+      deptTree: [],
+      defaultProps: {
+        multiple: true,
+        checkStrictly: true,
+        children: 'children',
+        value: 'id',
+        label: 'name'
       }
+    };
+  },
+  computed: {
+    // 是否开启响应式布局
+    styleResponsive() {
+      return this.$store.state.theme.styleResponsive;
+    }
+  },
+  methods: {
+    getAccountList() {
+      getNotBoundAccount().then((res) => {
+        this.accountList = res;
+      });
     },
-    watch: {
-      visible(visible) {
-        if (visible) {
-          this.getAccountList();
-          if (this.data) {
-            getUserDetail(this.data.id).then((res) => {
-              this.form = { ...res };
-              this.city = res.addressId ? res.addressId.toString() : null;
-              this.isUpdate = true;
-            });
-            // this.$util.assignObject(this.form, {
-            //   ...this.data,
-            //   password: ''
-            // });
-            // this.form = {...this.data}
-            // this.form.address = ["130000","130300","130304"]
-            // this.form.address = "130304"
-            // console.log('this.form',this.form)
-          } else {
-            this.city = null;
-            this.form.groupId = this.organizationId;
-            this.isUpdate = false;
-          }
+    /* 保存编辑 */
+    save() {
+      this.$refs.form.validate((valid) => {
+        if (!valid) {
+          return false;
+        }
+        this.loading = true;
+        this.form.addressId = this.city ? this.city[this.city.length - 1] : '';
+
+        if (this.deptTree.length > 0) {
+          this.deptTree.forEach(i => {
+            this.form.deptId.push(i[i.length - 1])
+          })
+
+          this.form['deptTree'] = JSON.stringify(this.deptTree)
+        }
+
+
+
+
+        const data = {
+          ...this.form
+        };
+        if (!this.isUpdate) {
+          delete data.id;
+        }
+        saveOrUpdateUser(data)
+          .then((msg) => {
+            this.loading = false;
+            if (this.isUpdate) {
+              this.$message.success('人员信息编辑成功');
+            } else {
+              this.$message.success('人员新增成功');
+            }
+            this.updateVisible(false);
+            this.$emit('done');
+          })
+          .catch((e) => {
+            this.loading = false;
+            // this.$message.error(e.message);
+          });
+      });
+    },
+    /* 更新visible */
+    updateVisible(value) {
+      this.$emit('update:visible', value);
+    },
+
+    checkedKeys(value) {
+      this.deptTree = []
+      this.deptTree.push(value)
+
+    },
+
+  },
+  watch: {
+    visible(visible) {
+      if (visible) {
+        this.getAccountList();
+        if (this.data) {
+          getUserDetail(this.data.id).then((res) => {
+            this.form = { ...res };
+
+            this.deptTree = []
+            this.form.deptId = []
+            if (this.form.deptTree) {
+              this.deptTree = JSON.parse(this.form.deptTree)
+            }
+
+
+
+            this.city = res.addressId ? res.addressId.toString() : null;
+            this.isUpdate = true;
+          });
+          // this.$util.assignObject(this.form, {
+          //   ...this.data,
+          //   password: ''
+          // });
+          // this.form = {...this.data}
+          // this.form.address = ["130000","130300","130304"]
+          // this.form.address = "130304"
+          // console.log('this.form',this.form)
         } else {
           this.city = null;
-          this.$refs.form.clearValidate();
-          this.form = { ...this.defaultForm };
+          this.form.groupId = this.organizationId;
+          this.isUpdate = false;
         }
+      } else {
+        this.city = null;
+        this.$refs.form.clearValidate();
+        this.form = { ...this.defaultForm };
       }
     }
-  };
+  }
+};
 </script>

+ 333 - 0
src/views/system/organization/components/staffSelection.vue

@@ -0,0 +1,333 @@
+<template>
+  <div class="container">
+    <!-- 单据弹窗 -->
+    <el-dialog
+      title="员工"
+      :before-close="handleClose"
+      :visible.sync="dialogVisible"
+      :close-on-click-modal="false"
+      :append-to-body="true"
+      width="80%"
+    >
+      <el-row class="zw-page">
+        <el-col :span="6" class="zw-page-left">
+          <el-card>
+            <div class="zw-card-header" slot="header">
+              <span class="zw-header-title details-title">部门</span>
+            </div>
+            <div class="zw-page-left-tree">
+              <el-container class="zw-container">
+                <el-tree
+                  ref="tree"
+                  :data="treeList"
+                  highlight-current
+                  node-key="id"
+                  :props="{ label: 'name' }"
+                  :expand-on-click-node="false"
+                  :default-expand-all="true"
+                  @node-click="handleNodeClick"
+                >
+                </el-tree>
+              </el-container>
+            </div>
+          </el-card>
+        </el-col>
+        <el-col :span="9" class="zw-page-main">
+          <el-card>
+            <div class="zw-card-header" slot="header">
+              <span class="zw-header-title details-title">员工明细 </span>
+            </div>
+            <div class="zw-page-main-list">
+              <el-container class="zw-container">
+                <el-table
+                  :data="staffList"
+                  tooltip-effect="dark"
+                  style="width: 100%"
+                  max-height="500"
+                  :header-cell-style="{
+                    background: '#F0F3F3',
+                    border: 'none'
+                  }"
+                >
+                  <el-table-column prop="code" label="姓名">
+                    <template slot-scope="{ row }">
+                      <div>{{ row.name }}</div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="工号">
+                    <template slot-scope="{ row }">
+                      <div>{{ row.jobNumber }}</div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column width="80" label="操作">
+                    <template slot-scope="{ row }">
+                      <el-button
+                        size="mini"
+                        type="primary"
+                        @click="choiceAsset(row)"
+                        :disabled="row.disabled"
+                        icon="el-icon-arrow-right"
+                        circle
+                      >
+                      </el-button>
+                    </template>
+                  </el-table-column>
+                </el-table>
+                <div
+                  v-if="staffList.length !== 0 && isMore"
+                  class="zw-page-list-more"
+                >
+                  <el-link @click="getMore()" type="primary"
+                    >更多<i class="el-icon-caret-bottom"></i>
+                  </el-link>
+                </div>
+              </el-container>
+            </div>
+          </el-card>
+        </el-col>
+        <el-col :span="9" class="zw-page-right">
+          <el-card>
+            <div class="zw-card-header" slot="header">
+              <span class="zw-header-title">已选员工</span>
+            </div>
+            <div class="zw-page-right-list">
+              <el-container class="zw-container">
+                <el-table
+                  :data="selectStafflist"
+                  tooltip-effect="dark"
+                  style="width: 100%"
+                  max-height="500"
+                  :header-cell-style="{
+                    background: '#F0F3F3',
+                    border: 'none'
+                  }"
+                >
+                  <el-table-column prop="code" label="姓名">
+                    <template slot-scope="{ row }">
+                      <div>{{ row.name }}</div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="工号">
+                    <template slot-scope="{ row }">
+                      <div>{{ row.jobNumber }}</div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column width="80" label="操作">
+                    <template slot-scope="scope">
+                      <el-button
+                        @click="deleteSelectStaff(scope.row, scope.$index)"
+                        size="mini"
+                        type="danger"
+                        >删除
+                      </el-button>
+                    </template>
+                  </el-table-column>
+                </el-table>
+              </el-container>
+            </div>
+          </el-card>
+        </el-col>
+      </el-row>
+      <div slot="footer" class="dialog-footer">
+        <el-button size="small" @click="handleClose">关 闭</el-button>
+        <el-button size="small" @click="sumbit" type="primary">确 认</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+<script>
+  import { listOrganizations, getUserPage } from '@/api/system/organization';
+  export default {
+    data() {
+      return {
+        form: {
+          groupId: null
+        },
+        treeList: [],
+        staffList: [],
+        selectStafflist: [], //已选员工
+        defaultProps: {
+          children: 'children',
+          label: 'name',
+          value: 'code'
+        },
+        pageNum: 1, //设备当前页数
+        size: 10,
+        isMore: false,
+        dialogVisible: false
+      };
+    },
+    created() {},
+    methods: {
+      open(selectedList) {
+
+        this.dialogVisible = true;
+        this.selectStafflist = selectedList;
+        this.getInfo();
+      },
+      //初始数据
+      async getInfo() {
+        let list = await listOrganizations();
+        this.treeList = this.$util.toTreeData({
+          data: list,
+          idField: 'id',
+          parentIdField: 'parentId'
+        });
+        //this.treeList = res.data;
+      },
+      //选择分类
+      handleNodeClick(data) {
+        this.staffList = [];
+
+        this.form.groupId = data.id;
+        let params = {
+          pageNum: 1,
+          size: this.size,
+          groupId: this.form.groupId
+        };
+        this.getStaffList(params);
+      },
+      //获取员工列表
+      async getStaffList(params) {
+        let res = await getUserPage(params);
+        let list = res.list;
+        if (list.length < res.count) {
+          this.isMore = true;
+        } else {
+          this.isMore = false;
+        }
+        list.forEach((el) => {
+          let _index = this.selectStafflist.findIndex((n) => n.id == el.id);
+          if (_index !== -1) {
+            el.disabled = true;
+          } else {
+            el.disabled = false;
+          }
+        });
+        this.staffList = [...this.staffList, ...list];
+        // this.pageNum = res.pageNum;
+      },
+      //查询更多员工
+      async getMore() {
+        this.pageNum = this.pageNum + 1;
+        let params = {
+          pageNum: this.pageNum,
+          size: this.size,
+          groupId: this.form.groupId
+        };
+        this.getStaffList(params);
+      },
+      //选择员工
+      choiceAsset(info) {
+        let data = JSON.parse(JSON.stringify(info));
+        this.selectStafflist.push(data);
+        info.disabled = true;
+      },
+      //删除已选员工
+      deleteSelectStaff(info, index) {
+        this.staffList.forEach((el) => {
+          if (el.id == info.id) {
+            el.disabled = false;
+          }
+        });
+        this.selectStafflist.splice(index, 1);
+      },
+      //保存
+      sumbit() {
+        if (this.selectStafflist.length === 0) {
+          this.$message.warning('请选择员工');
+        } else {
+          this.$emit(
+            'confirm',
+            JSON.parse(JSON.stringify(this.selectStafflist))
+          );
+          this.handleClose();
+        }
+      },
+      handleClose() {
+        this.staffList = [];
+        this.selectStafflist = [];
+        this.dialogVisible = false;
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .container {
+    padding: 10px 0;
+  }
+  .zw-container {
+    height: 500px;
+    overflow-y: auto;
+  }
+  .zw-header-title {
+    display: inline-block;
+    margin-right: 10px;
+    font-weight: 600;
+  }
+  .details-title {
+    line-height: 32px;
+    height: 32px;
+  }
+  .zw-page-list-p {
+    font-size: 14px;
+    margin-bottom: 18px;
+    display: flex;
+    justify-content: space-between;
+    // align-items: center;
+    .zw-page-list-right {
+      display: flex;
+    }
+  }
+  .zw-page {
+    background: #fff;
+    //padding: 20px 0;
+    height: 600px;
+    .zw-page-left {
+      padding: 0 10px;
+    }
+    .zw-page-main {
+      padding: 0 10px;
+      .zw-page-main-list {
+        span {
+          margin-right: 10px;
+        }
+        .zw-page-span-num {
+          font-size: 12px;
+          color: #157a2c;
+        }
+        .zw-page-p-operation {
+          text-align: right;
+          // width: 200px;
+        }
+        .zw-page-operation-num {
+          width: 100px;
+          margin: 0 10px;
+        }
+      }
+      .zw-page-list-more {
+        text-align: center;
+      }
+    }
+    .zw-page-right {
+      .zw-card-header {
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+        height: 32px;
+      }
+      span {
+        margin-right: 10px;
+      }
+      .zw-page-span-num {
+        font-size: 12px;
+        color: #157a2c;
+      }
+    }
+  }
+  .notes {
+    font-size: 12px;
+    color: #909090;
+  }
+</style>

+ 2 - 1
src/views/system/organization/index.vue

@@ -110,9 +110,10 @@
         this.loading = true;
         listOrganizations()
           .then((list) => {
+           let _list = list.filter((i) => i.name != '超级管理员')
             this.loading = false;
             this.data = this.$util.toTreeData({
-              data: list,
+              data: _list,
               idField: 'id',
               parentIdField: 'parentId'
             });

+ 40 - 19
src/views/technology/production/components/user-search.vue

@@ -17,19 +17,21 @@
           <el-input clearable v-model="where.name" placeholder="请输入" />
         </el-form-item>
       </el-col>
-      <!-- <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
-        <el-form-item label="性别:">
-          <el-select
-            clearable
-            v-model="where.sex"
-            placeholder="请选择"
-            class="ele-fluid"
-          >
-            <el-option label="男" :value="1" />
-            <el-option label="女" :value="2" />
-          </el-select>
-        </el-form-item>
-      </el-col> -->
+
+      <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 6 }">
+        <el-form-item label="控制码:" prop="controlId">
+            <el-select v-model="where.controlId" >
+              <el-option
+                v-for="item in controlList"
+                :key="item.id"
+                :label="item.name"
+                :value="item.id"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+     
 
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
         <div class="ele-form-actions">
@@ -47,20 +49,24 @@
     </el-row>
   </el-form>
 </template>
-
+  import control from '@/api/technology/control';
 <script>
+  import control from '@/api/technology/control';
   export default {
+
+  
     data() {
       // 默认表单数据
       const defaultWhere = {
         code: '',
-        name: ''
-        // nickname: '',
-        // sex: undefined
+        name: '',
+        controlId: null
+
       };
       return {
         // 表单数据
-        where: { ...defaultWhere }
+        where: { ...defaultWhere },
+        controlList: [],
       };
     },
     computed: {
@@ -69,6 +75,9 @@
         return this.$store.state.theme.styleResponsive;
       }
     },
+    created() {
+      this.getControlList()
+    },
     methods: {
       /* 搜索 */
       search() {
@@ -78,7 +87,19 @@
       reset() {
         this.where = { ...this.defaultWhere };
         this.search();
-      }
+      },
+
+      
+      getControlList(){
+         const params = {
+           pageNum: 1, size: -1
+         }
+         control.list().then(res=>{
+            this.controlList = res.list
+         })
+      },
+
+
     }
   };
 </script>

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

@@ -2,7 +2,7 @@
   <div class="ele-body">
     <el-card shadow="never">
       <!-- 搜索表单 -->
-      <user-search @search="reload" />
+      <user-search @search="reload"  />
       <!-- 数据表格 -->
       <ele-pro-table
         ref="table"

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

@@ -4,8 +4,9 @@
       <!-- 搜索表单 -->
       <user-search @search="reload" />
       <!-- 数据表格 -->
-
-      <ele-pro-table ref="table" :columns="columns" :datasource="datasource" :selection.sync="selection" row-key="id">
+    
+      <ele-pro-table ref="table" :columns="columns" :datasource="datasource" @selection-change="selectListChange"
+        row-key="id">
         <!-- 状态列 -->
 
         <!-- 操作列 -->
@@ -34,8 +35,17 @@ export default {
   },
   props: {
     tableData: {
-      type: Array
+      type: Array,
+      default: () => []
+    },
+
+    isRadio: {
+      type: Boolean,
+      default: false
     }
+
+
+
   },
   data() {
     return {
@@ -47,7 +57,7 @@ export default {
           width: 45,
           align: 'center',
           selectable: (row, index) => {
-            return !this.tableData.some((it) => it.sourceTaskId == row.id);
+            return !this.tableData.some((it) => it.sourceTaskId == row.id || it.id == row.id);
           },
 
           reserveSelection: true,
@@ -94,10 +104,16 @@ export default {
       // 是否显示编辑弹窗
       showEdit: false,
       // 是否显示参数弹窗
-      showSetting: false
+      showSetting: false,
+
+      rowData: []
     };
   },
 
+  mounted() {
+   
+  },
+
   methods: {
     /*配置工艺参数 */
     openSetting(row) {
@@ -164,11 +180,49 @@ export default {
             })
             .catch((e) => {
               loading.close();
+
+
+
+
+
+
               // this.$message.error(e.message);
             });
         })
         .catch(() => { });
-    }
+    },
+
+    // 表格某一行的单击事件
+    selectListChange(selection) {
+      if (this.isRadio) {
+        if (Array.isArray(selection) && selection.length > 1) {//点击勾选框
+          this.$refs.table.toggleRowSelection(selection[0], false);
+          this.$refs.table.toggleRowSelection(selection[1], true);
+
+        } else if (!Array.isArray(selection)) {//点击行
+          this.$refs.table.toggleRowSelection(selection, false);
+          this.$refs.table.toggleRowSelection(selection, true);
+
+        } else {
+          this.rowData = []
+          this.rowData = Array.isArray(selection) ? selection[0] : selection;
+        }
+      } else {
+        this.selection = selection
+      }
+
+
+
+    },
+
+    getRowData() {
+      return this.rowData
+    },
+
+
+
+
+
   }
 };
 </script>

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

@@ -65,7 +65,7 @@
 
 
 
-      </el-row>
+      </el-row>``
 
     </el-form>
 

+ 19 - 9
src/views/workforceManagement/classes/components/timeTable.vue

@@ -4,8 +4,9 @@
       cache-key="systemRoleTable17" class="time-form">
       <!-- 表头工具栏 -->
       <template v-slot:toolbar>
+        <!-- :disabled="canHandl ? true : false" -->
         <el-button size="small" type="primary" icon="el-icon-plus" class="ele-btn-icon" @click="handlAdd"
-          :disabled="canHandl ? true : false">
+         >
           新增
         </el-button>
       </template>
@@ -36,7 +37,7 @@
           trigger: 'change'
         }">
           <el-time-picker style="width: 100%" format="HH:mm" value-format="HH:mm:ss" placeholder="结束时间"
-            v-model="scope.row.endTime"  @change="changeEndTime">
+            v-model="scope.row.endTime" @change="changeEndTime">
           </el-time-picker>
           <!-- :picker-options="{
               selectableRange: setEndTime(scope)
@@ -212,19 +213,28 @@ export default {
         (reDate.test(s2) ? s2 : '1970-01-01 ' + s2).replace(/-/g, '/')
       );
       var ms = s2.getTime() - s1.getTime();
-      if (ms < 0) return 0;
-      result = Math.floor(ms / 1000 / 60 / 60); //小时
-      row.workHour = result;
-      this.$emit('timeAll', this.gettimeAll());
-      return result;
+      console.log(ms)
+      if (ms < 0) {
+         let time = 86400000 - s1.getTime() + s2.getTime()
+         result = (time / 1000 / 60 / 60).toFixed(1); //小时
+        row.workHour = result;
+        this.$emit('timeAll', this.gettimeAll());
+        return result
+      } else {
+        result = (ms / 1000 / 60 / 60).toFixed(1); //小时
+        row.workHour = result;
+        this.$emit('timeAll', this.gettimeAll());
+        return result;
+      }
+
     },
     // 获取工作日时常
     gettimeAll() {
       let result = 0;
       this.form.datasource.forEach((n) => {
-        result += n.workHour;
+        result += Number(n.workHour);
       });
-      return result;
+      return result.toFixed(2);
     },
     verification() {
       return new Promise((resolve, reject) => {

+ 2 - 1
src/views/workforceManagement/team/components/edit.vue

@@ -16,6 +16,7 @@
             </el-form-item>
           </el-col>
           <el-col :span="8">
+           
             <el-form-item label="车间:" prop="workshopId" style="margin-bottom: 22px">
               <el-select v-model="form.workshopId" @change="change_workshopId" multiple placeholder="请选择"
                 style="width: 100%">
@@ -263,7 +264,7 @@ export default {
     },
     // 获取产线
     getlistFactoryLineByParentId() {
-      return listFactoryLine().then((res) => {
+      return listFactoryLine(this.form.workshopId).then((res) => {
         this.options.productionLineId = res.map((n) => {
           return {
             value: n.id,

+ 5 - 5
src/views/workforceManagement/team/components/staffSelection.vue

@@ -35,7 +35,7 @@
         <el-col :span="9" class="zw-page-main">
           <el-card>
             <div class="zw-card-header" slot="header">
-              <span class="zw-header-title details-title">员工明细</span>
+              <span class="zw-header-title details-title">员工明细 </span>
             </div>
             <div class="zw-page-main-list">
               <el-container class="zw-container">
@@ -77,7 +77,7 @@
                   v-if="staffList.length !== 0 && isMore"
                   class="zw-page-list-more"
                 >
-                  <el-link @click="getMore(page)" type="primary"
+                  <el-link @click="getMore()" type="primary"
                     >更多<i class="el-icon-caret-bottom"></i>
                   </el-link>
                 </div>
@@ -204,13 +204,13 @@ export default {
         }
       });
       this.staffList = [...this.staffList, ...list];
-      this.pageNum = res.pageNum;
+      // this.pageNum = res.pageNum;
     },
     //查询更多员工
     async getMore() {
-      this.pageNum += 1;
+      this.pageNum = this.pageNum + 1;
       let params = {
-        pageNum: 1,
+        pageNum:this.pageNum,
         size: this.size,
         groupId: this.form.groupId
       };