quwangxin пре 2 година
родитељ
комит
1143a7192b

+ 6 - 0
src/styles/transition/common.scss

@@ -57,3 +57,9 @@
   border-top: 4px solid #157a2c;
   color: #157a2c;
 }
+
+.ele-form-actions {
+  display: flex;
+  align-items: center;
+  justify-content: flex-end;
+}

+ 101 - 0
src/views/material/materialBOM/components/BOM-search.vue

@@ -0,0 +1,101 @@
+<!-- 搜索表单 -->
+<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="BOM编码">
+          <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="BOM名称">
+          <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.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.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.name" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { md: 12 } : { span: 12 }">
+        <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"
+            >重置</el-button
+          >
+        </div>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+  export default {
+    data () {
+      // 默认表单数据
+      const defaultWhere = {
+        name: '',
+        code: '',
+        appType: ''
+      };
+      return {
+        options: [
+          { value: 0, label: '全部' },
+          { value: 1, label: '业务字典' },
+          { value: 2, label: '数据字典' }
+        ],
+        defaultWhere,
+        // 表单数据
+        where: { ...defaultWhere }
+      };
+    },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive () {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
+    methods: {
+      /* 搜索 */
+      search () {
+        if (this.where.appType === 0) {
+          this.where.appType = '';
+        }
+        this.$emit('search', this.where);
+      },
+      /*  重置 */
+      reset () {
+        this.where = { ...this.defaultWhere };
+        this.search();
+      }
+    }
+  };
+</script>

+ 129 - 0
src/views/material/materialBOM/components/edit-dialog.vue

@@ -0,0 +1,129 @@
+<template>
+  <ele-modal :visible.sync="visible" :title="title" width="80%" @close="cancel">
+    <headerTitle title="基本信息"></headerTitle>
+    <el-form label-width="100px">
+      <el-row>
+        <el-col :span="8">
+          <el-form-item label="BOM编码">
+            <el-input placeholder="请输入"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="BOM名称">
+            <el-input placeholder="请输入"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="所属工厂">
+            <el-input placeholder="请输入"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="产品编码">
+            <el-input placeholder="请输入"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="产品名称">
+            <el-input placeholder="请输入"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="版本号">
+            <el-input placeholder="请输入"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="分类层级">
+            <el-input placeholder="请输入"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="基本数量">
+            <el-input placeholder="请输入"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="状态">
+            <el-input placeholder="请输入"></el-input>
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+    <ele-pro-table
+      ref="table"
+      :columns="columns"
+      :datasource="datasource"
+      height="calc(100vh - 350px)"
+      :need-page="false"
+    >
+      <!-- 表头工具栏 -->
+      <template v-slot:toolbar>
+        <el-button type="primary">添加</el-button>
+      </template>
+      <template v-slot:action>
+        <el-link type="primary">删除</el-link>
+      </template>
+    </ele-pro-table>
+
+    <div slot="footer" class="footer">
+      <el-button type="primary" @click="save">保存</el-button>
+      <el-button type="primary" @click="save">发布</el-button>
+      <el-button @click="cancel">返回</el-button>
+    </div>
+  </ele-modal>
+</template>
+
+<script>
+  export default {
+    data () {
+      return {
+        visible: false,
+        title: '',
+        row: {},
+        columns: [
+          {
+            type: 'index',
+            width: 55,
+            align: 'center'
+          },
+          {
+            label: '物料名称'
+          },
+          {
+            label: '物料编码'
+          },
+          {
+            label: '牌号'
+          },
+          {
+            label: '型号'
+          },
+          {
+            label: '需量(子)'
+          },
+          {
+            label: '单位'
+          },
+          {
+            action: 'action',
+            slot: 'action',
+            label: '操作'
+          }
+        ]
+      };
+    },
+    methods: {
+      open (type, row) {
+        this.title = type;
+        this.row = row;
+        this.visible = true;
+      },
+      save () {},
+      cancel () {},
+      datasource () {
+        return Promise.resolve([]);
+      }
+    }
+  };
+</script>

+ 147 - 0
src/views/material/materialBOM/index.vue

@@ -0,0 +1,147 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never">
+      <BOMSearch @search="reload" />
+      <ele-pro-table
+        ref="table"
+        :columns="columns"
+        :datasource="datasource"
+        class="dict-table"
+        tool-class="ele-toolbar-actions"
+      >
+        <!-- 表头工具栏 -->
+        <template v-slot:toolbar>
+          <el-button type="primary" @click="handelEdit('新建')">新建</el-button>
+          <el-button type="primary">复制</el-button>
+        </template>
+        <template v-slot:action="{ row }">
+          <el-link type="primary" @click="handelEdit('编辑', row)"
+            >编辑</el-link
+          >
+          <!-- <el-link>查看历史版本</el-link> -->
+          <el-link type="primary">删除</el-link>
+        </template>
+      </ele-pro-table>
+    </el-card>
+    <EditDialog ref="editDialogRef" />
+  </div>
+</template>
+
+<script>
+  import BOMSearch from './components/BOM-search.vue';
+  import EditDialog from './components/edit-dialog.vue';
+  import { listDictionaries, removeDictionary } from '@/api/system/dictionary';
+
+  export default {
+    name: 'SystemDictionary',
+    components: { BOMSearch, EditDialog },
+    data () {
+      return {
+        // 表格列配置
+        columns: [
+          {
+            columnKey: 'index',
+            type: 'index',
+            width: 45,
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'name',
+            label: 'BOM编码',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'name',
+            label: 'BOM名称',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'name',
+            label: '产品编码',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'name',
+            label: '产品名称',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'name',
+            label: '版本',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'name',
+            label: '状态',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'name',
+            label: '创建人',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'name',
+            label: '创建日期',
+            showOverflowTooltip: true
+          },
+          {
+            action: 'action',
+            slot: 'action',
+            label: '操作'
+          }
+        ]
+      };
+    },
+
+    methods: {
+      /* 表格数据源 */
+      datasource () {
+        // return;
+        return listDictionaries();
+      },
+      handelEdit (type, row) {
+        this.$refs.editDialogRef.open(type, row);
+      },
+      /* 刷新表格 */
+      reload (where) {
+        this.$refs.table.reload();
+        this.$refs.dictData.reload(where);
+      },
+      /* 显示编辑 */
+      openEdit (row) {},
+      /* 删除 */
+      remove () {
+        this.$confirm('确定要删除选中的字典吗?', '提示', {
+          type: 'warning'
+        })
+          .then(() => {
+            if (this.$refs.dictData.selection.length == 0) {
+              this.$message({
+                message: '当前未选择数据',
+                type: 'error'
+              });
+              return;
+            }
+            let ids = this.$refs.dictData.selection.map((item) => item.id);
+            const loading = this.$loading({ lock: true });
+
+            removeDictionary(ids, true)
+              .then((msg) => {
+                loading.close();
+                this.$message.success(msg);
+                this.reload();
+              })
+              .catch((e) => {
+                loading.close();
+                // this.$message.error(e.message);
+              });
+          })
+          .catch(() => {});
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped></style>

+ 14 - 5
src/views/material/product/components/product-search.vue

@@ -19,16 +19,16 @@
       </el-col>
       <el-col v-bind="styleResponsive ? { md: 5 } : { span: 4 }">
         <el-form-item label="牌号">
-          <el-input clearable v-model="where.name" placeholder="请输入" />
+          <el-input clearable v-model="where.brandNum" placeholder="请输入" />
         </el-form-item>
       </el-col>
       <el-col v-bind="styleResponsive ? { md: 5 } : { span: 4 }">
         <el-form-item label="型号">
-          <el-input clearable v-model="where.name" placeholder="请输入" />
+          <el-input clearable v-model="where.modelType" placeholder="请输入" />
         </el-form-item>
       </el-col>
       <el-col v-bind="styleResponsive ? { md: 4 } : { span: 4 }">
-        <el-form-item>
+        <div class="ele-form-actions" v-show="false">
           <el-button
             type="primary"
             icon="el-icon-search"
@@ -45,7 +45,7 @@
             size="medium"
             >重置</el-button
           >
-        </el-form-item>
+        </div>
       </el-col>
     </el-row>
   </el-form>
@@ -58,7 +58,8 @@
       const defaultWhere = {
         name: '',
         code: '',
-        appType: ''
+        brandNum: '',
+        modelType: ''
       };
       return {
         options: [
@@ -93,3 +94,11 @@
     }
   };
 </script>
+
+<style>
+  .ele-form-actions {
+    display: inline-block;
+    transform: translate(0);
+    transition: all;
+  }
+</style>

+ 19 - 52
src/views/material/product/index.vue

@@ -18,15 +18,12 @@
             :datasource="datasource"
             height="calc(100vh - 350px)"
             :need-page="false"
-            :toolkit="[]"
             :current.sync="current"
             highlight-current-row
             class="dict-table"
             tool-class="ele-toolbar-actions"
-            @done="done"
           >
             <!-- 表头工具栏 -->
-            <template v-slot:toolbar> </template>
             <template v-slot:action>
               <el-link>编辑</el-link>
             </template>
@@ -40,7 +37,7 @@
 <script>
   import AssetTree from '@/components/AssetTree';
   import ProductSearch from './components/product-search.vue';
-  import { listDictionaries, removeDictionary } from '@/api/system/dictionary';
+  import { getList } from '@/api/classifyManage/itemInformation';
 
   export default {
     name: 'SystemDictionary',
@@ -54,12 +51,11 @@
             type: 'index',
             width: 45,
             align: 'center',
-            showOverflowTooltip: true
+            reserveSelection: true
           },
           {
-            prop: 'name',
-            label: '产品编码',
-            showOverflowTooltip: true
+            prop: 'code',
+            label: '产品编码'
           },
           {
             prop: 'name',
@@ -67,24 +63,20 @@
             showOverflowTooltip: true
           },
           {
-            prop: 'name',
-            label: '牌号',
-            showOverflowTooltip: true
+            prop: 'brandNum',
+            label: '牌号'
           },
           {
-            prop: 'name',
-            label: '型号',
-            showOverflowTooltip: true
+            prop: 'modelType',
+            label: '型号'
           },
           {
-            prop: 'name',
-            label: '计量单位',
-            showOverflowTooltip: true
+            prop: 'measuringUnit',
+            label: '计量单位'
           },
           {
-            prop: 'name',
-            label: '包装单位',
-            showOverflowTooltip: true
+            prop: 'packingUnit',
+            label: '包装单位'
           },
           {
             action: 'action',
@@ -103,9 +95,13 @@
 
     methods: {
       /* 表格数据源 */
-      datasource () {
-        // return;
-        return listDictionaries();
+      datasource ({ page, where, limit }) {
+        return getList({
+          ...this.where,
+          pageNum: page,
+          size: limit,
+          categoryLevelGroupId: 9
+        });
       },
       /* 表格渲染完成回调 */
       done (res) {
@@ -122,35 +118,6 @@
       openEdit (row) {
         this.editData = row;
         this.showEdit = true;
-      },
-      /* 删除 */
-      remove () {
-        this.$confirm('确定要删除选中的字典吗?', '提示', {
-          type: 'warning'
-        })
-          .then(() => {
-            if (this.$refs.dictData.selection.length == 0) {
-              this.$message({
-                message: '当前未选择数据',
-                type: 'error'
-              });
-              return;
-            }
-            let ids = this.$refs.dictData.selection.map((item) => item.id);
-            const loading = this.$loading({ lock: true });
-
-            removeDictionary(ids, true)
-              .then((msg) => {
-                loading.close();
-                this.$message.success(msg);
-                this.reload();
-              })
-              .catch((e) => {
-                loading.close();
-                // this.$message.error(e.message);
-              });
-          })
-          .catch(() => {});
       }
     }
   };

+ 107 - 15
src/views/material/productLinkMaterial/components/link-material-dialog.vue

@@ -1,12 +1,12 @@
 <template>
-  <el-dialog :visible.sync="visible" title="">
-    <el-row :gutter="20">
+  <ele-modal :visible.sync="visible" title="" width="80%" @close="cancel">
+    <el-row :gutter="40">
       <el-col :span="12">
         <headerTitle>
           <template v-slot:title>
             可选
-            <el-button type="primary" size="small">关联</el-button>
-            <el-button type="primary" size="small" icon="icon-search"
+            <el-button type="primary" class="ml20" size="mini">关联</el-button>
+            <el-button type="primary" size="mini" icon="icon-search"
               >搜索</el-button
             >
           </template>
@@ -32,10 +32,11 @@
           </el-row>
         </el-form>
         <ele-pro-table
-          ref="table"
+          ref="tableRight"
           :columns="columns"
           :datasource="[]"
-          height="calc(100vh - 350px)"
+          cache-key="link-material-dialog"
+          height="45vh"
           :need-page="false"
         >
         </ele-pro-table>
@@ -44,35 +45,126 @@
         <headerTitle
           ><template v-slot:title
             >已关联
-            <el-button type="primary" size="small">取消关联</el-button>
-            <el-button type="primary" size="small" icon="icon-search"
+            <el-button type="primary" class="ml20" size="mini"
+              >取消关联</el-button
+            >
+            <el-button type="primary" size="mini" icon="icon-search"
               >搜索</el-button
             ></template
           ></headerTitle
-        ></el-col
-      >
+        >
+        <el-form label-width="60px">
+          <el-row>
+            <el-col :span="12">
+              <el-form-item label="分类">
+                <el-input placeholder="请输入"></el-input> </el-form-item
+            ></el-col>
+            <el-col :span="12">
+              <el-form-item label="编码">
+                <el-input placeholder="请输入"></el-input></el-form-item
+            ></el-col>
+            <el-col :span="12">
+              <el-form-item label="名称">
+                <el-input placeholder="请输入"></el-input></el-form-item
+            ></el-col>
+            <el-col :span="12">
+              <el-form-item label="型号">
+                <el-input placeholder="请输入"></el-input></el-form-item
+            ></el-col>
+          </el-row>
+        </el-form>
+        <ele-pro-table
+          ref="table"
+          :columns="columnsRight"
+          :datasource="[]"
+          height="45vh"
+          :need-page="false"
+          cache-key="link-material-dialog-right"
+        >
+        </ele-pro-table
+      ></el-col>
     </el-row>
-  </el-dialog>
+
+    <div slot="footer" class="footer">
+      <el-button type="primary" @click="save">保存</el-button>
+      <el-button @click="cancel">取消</el-button>
+    </div>
+  </ele-modal>
 </template>
 
 <script>
   export default {
     data () {
       return {
-        visible: true,
-        columns: []
+        visible: false,
+        columns: [
+          {
+            type: 'selection',
+            align: 'center'
+          },
+          {
+            label: '设备分类'
+          },
+          {
+            label: '设备编码'
+          },
+          {
+            label: '设备名称'
+          },
+          {
+            label: '型号'
+          }
+        ],
+        columnsRight: [
+          {
+            type: 'selection',
+            align: 'center'
+          },
+          {
+            label: '设备分类'
+          },
+          {
+            label: '设备编码'
+          },
+          {
+            label: '设备名称'
+          },
+          {
+            label: '型号'
+          },
+          {
+            label: '产能'
+          }
+        ],
+        row: {}
       };
     },
     methods: {
       open (type, row) {
+        this.row = row;
         switch (type) {
-          case value:
+          case 1:
             break;
 
           default:
             break;
         }
-      }
+
+        this.visible = true;
+      },
+      cancel () {
+        this.visible = false;
+      },
+      save () {}
     }
   };
 </script>
+
+<style lang="scss" scoped>
+  .ml20 {
+    margin-left: 20px;
+  }
+  .footer {
+    text-align: right;
+  }
+</style>

+ 1 - 1
vue.config.js

@@ -35,7 +35,7 @@ module.exports = {
         // target: 'http://192.168.3.35:8080', // kang杨威
         target: 'http://192.168.3.25:8080', // 黄峥嵘
         // target: 'http://192.168.3.41:8080', // 何江鹏
-        target: 'http://192.168.3.33:8080', // 谢一平
+        // target: 'http://192.168.3.33:8080', // 谢一平
         // target: 'http://192.168.3.64:8080', // 粟勋
         // target: 'http://192.168.3.34:8080', // 刘毅勋
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域