Pārlūkot izejas kodu

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend into dev

汪钰 3 gadi atpakaļ
vecāks
revīzija
f4c624e76a
30 mainītis faili ar 1105 papildinājumiem un 1767 dzēšanām
  1. 40 0
      src/api/material/list.js
  2. 18 42
      src/api/system/file/index.js
  3. 3 16
      src/components/AssetTree/index.vue
  4. 3 1
      src/components/header-title/index.vue
  5. 108 0
      src/components/upload/fileUpload.vue
  6. 101 0
      src/components/upload/imgUpload.vue
  7. 5 1
      src/config/setting.js
  8. 4 1
      src/router/index.js
  9. 4 1
      src/store/index.js
  10. 2 2
      src/store/modules/user.js
  11. 32 0
      src/utils/file.js
  12. 9 9
      src/views/material/list/components/list-edit.vue
  13. 10 36
      src/views/material/list/index.vue
  14. 151 0
      src/views/material/manage/components/GroupDialog.vue
  15. 0 163
      src/views/material/manage/components/dict-data-edit.vue
  16. 0 476
      src/views/material/manage/components/dict-edit.vue
  17. 9 7
      src/views/material/manage/components/index-data.vue
  18. 1 10
      src/views/material/manage/components/index-search.vue
  19. 8 9
      src/views/material/manage/index.vue
  20. 152 0
      src/views/material/manage/manageMaterial.vue
  21. 0 163
      src/views/material/product/components/dict-data-edit.vue
  22. 0 227
      src/views/material/product/components/dict-data.vue
  23. 0 476
      src/views/material/product/components/dict-edit.vue
  24. 19 36
      src/views/material/product/components/product-search.vue
  25. 64 90
      src/views/material/product/index.vue
  26. 78 0
      src/views/material/productLinkMaterial/components/link-material-dialog.vue
  27. 95 0
      src/views/material/productLinkMaterial/components/product-search.vue
  28. 171 0
      src/views/material/productLinkMaterial/index.vue
  29. 17 0
      src/views/test/index.vue
  30. 1 1
      vue.config.js

+ 40 - 0
src/api/material/list.js

@@ -0,0 +1,40 @@
+import request from '@/utils/request';
+
+// 获取列表
+export async function getGroupPage (data) {
+  const res = await request.get('/main/categorylevelgroup/page', {
+    params: data
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 新建保存
+export async function saveItemGroup (data) {
+  const res = await request.post('/main/categorylevelgroup/save', data);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+
+// 编辑
+export async function updateItemGroup(data) {
+    const res = await request.put(`/main/categorylevelgroup/update`, data);
+    if (res.data.code == 0) {
+        return res.data.message;
+    }
+    return Promise.reject(new Error(res.data.message));
+}
+
+// 删除
+export async function removeItem (data) {
+  const res = await request.delete('/main/categorylevelgroup/delete', { data });
+  if (res.data.code == 0) {
+    return res.data.message;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 18 - 42
src/api/system/file/index.js

@@ -4,40 +4,26 @@ import request from '@/utils/request';
  * 上传文件
  * @param file 文件
  */
-export async function uploadFile(file) {
+export async function uploadFile (data) {
   const formData = new FormData();
-  formData.append('file', file);
-  const res = await request.post('/file/upload', formData);
-  if (res.data.code === 0) {
-    return res.data.data;
-  }
-  return Promise.reject(new Error(res.data.message));
-}
-
-/**
- * 上传 base64 文件
- * @param base64 文件数据
- * @param fileName 文件名称
- */
-export async function uploadBase64File(base64, fileName) {
-  const formData = new FormData();
-  formData.append('base64', base64);
-  if (fileName) {
-    formData.append('fileName', fileName);
-  }
-  const res = await request.post('/file/upload/base64', formData);
-  if (res.data.code === 0 && res.data.data) {
-    return res.data.data;
+  formData.append('multiPartFile', data.multiPartFile);
+  formData.append('module', data.module);
+  const res = await request.post('/main/file/upload', formData);
+  if (res.data.code === '0') {
+    return res.data;
   }
   return Promise.reject(new Error(res.data.message));
 }
 
 /**
- * 分页查询文件上传记录
+ * 获取文件
  */
-export async function pageFiles(params) {
-  const res = await request.get('/file/page', { params });
-  if (res.data.code === 0) {
+export async function getFile (params) {
+  const res = await request.get('/main/file/getFile', {
+    params,
+    headers: { requestType: 'blob' }
+  });
+  if (res.data.code === '0') {
     return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
@@ -46,22 +32,12 @@ export async function pageFiles(params) {
 /**
  * 删除文件
  */
-export async function removeFile(id) {
-  const res = await request.delete('/file/remove/' + id);
-  if (res.data.code === 0) {
-    return res.data.message;
-  }
-  return Promise.reject(new Error(res.data.message));
-}
-
-/**
- * 批量删除文件
- */
-export async function removeFiles(data) {
-  const res = await request.delete('/file/remove/batch', {
+export async function removeFile (data) {
+  const res = await request.post(
+    `/main/file/delete?fileId=${data.fileId}`,
     data
-  });
-  if (res.data.code === 0) {
+  );
+  if (res.data.code === '0') {
     return res.data.message;
   }
   return Promise.reject(new Error(res.data.message));

+ 3 - 16
src/components/AssetTree/index.vue

@@ -17,7 +17,7 @@
 </template>
 
 <script>
-  import { getTreeByPid, getTreeByType } from '@/api/classifyManage';
+  import { getTreeByPid } from '@/api/classifyManage';
   // let originId = '';
   // let originType = '';
   export default {
@@ -40,7 +40,7 @@
       defaultExpandAll: {
         type: Boolean,
         default: function () {
-          return true
+          return true;
         }
       },
       // 初始请求treeList
@@ -48,15 +48,6 @@
         type: Boolean,
         default: true
       },
-      // 接口分父级id 和 类型筛选
-      paramsType: {
-        type: String,
-        default: 'id'
-      },
-      type: {
-        type: String,
-        default: ''
-      },
       id: {
         type: String,
         default: '0'
@@ -92,12 +83,8 @@
       async getTreeData () {
         try {
           this.treeLoading = true;
-          const requestApi =
-            this.paramsType === 'type'
-              ? getTreeByType.bind(null, this.type)
-              : getTreeByPid.bind(null, this.id);
 
-          const res = await requestApi();
+          const res = await getTreeByPid(this.id);
           this.treeLoading = false;
           if (res?.code === '0') {
             this.treeList = res.data;

+ 3 - 1
src/components/header-title/index.vue

@@ -3,7 +3,9 @@
     <div class="title">
       <div class="left">
         <div class="ele-bg-primary box"></div>
-        <span :style="{ 'font-size': size }">{{ title }}</span>
+        <slot name="title"
+          ><span :style="{ 'font-size': size }">{{ title }}</span></slot
+        >
       </div>
       <div class="right">
         <slot />

+ 108 - 0
src/components/upload/fileUpload.vue

@@ -0,0 +1,108 @@
+<template>
+  <el-upload
+    class="upload-demo"
+    action="#"
+    :http-request="handlRequest"
+    :before-remove="beforeRemove"
+    :on-remove="handleRemove"
+    multiple
+    :before-upload="beforeUpload"
+    :file-list="fileList"
+  >
+    <slot>
+      <el-button size="small" type="primary">点击上传</el-button>
+    </slot>
+  </el-upload>
+</template>
+
+<script>
+  import { uploadFile, removeFile } from '@/api/system/file/index.js';
+  import { getImageUrl, getImagePath } from '@/utils/file';
+  export default {
+    props: {
+      value: {
+        type: Array,
+        default: () => []
+      },
+      // 所属模块
+      module: {
+        type: String,
+        required: true
+      },
+      // 限制数量
+      limit: {
+        type: Number,
+        default: -1
+      },
+      // 限制大小 mb
+      size: {
+        type: Number,
+        default: 10
+      }
+    },
+    computed: {
+      fileList: {
+        set (val) {
+          console.log(val);
+          this.$emit(
+            'input',
+            val.map((item) => ({
+              ...item,
+              url: getImagePath(item.url)
+            }))
+          );
+        },
+        get () {
+          const arr = this.value.map((item) => ({
+            ...item,
+            url: getImageUrl(item.url)
+          }));
+          return arr;
+        }
+      }
+    },
+
+    methods: {
+      beforeRemove (file) {
+        if (file.id) {
+          return removeFile({
+            fileId: file.id
+          }).then(() => {
+            return true;
+          });
+        } else {
+          return true;
+        }
+      },
+      handleRemove (file, fileList) {
+        this.fileList = fileList;
+      },
+      beforeUpload (file) {
+        if (file.size / 1024 / 1024 > this.size) {
+          this.$message.error(`大小不能超过 ${this.size}MB`);
+          return false;
+        }
+
+        if (this.limit > 0 && this.fileList.length === this.limit) {
+          this.$message.error(`最多上传 ${this.limit}个文件`);
+          return false;
+        }
+        return uploadFile({
+          module: this.module,
+          multiPartFile: file
+        }).then((res) => {
+          if (res.data) {
+            this.$emit('input', [
+              ...this.value,
+              { ...file, url: res.data.storePath, ...res.data }
+            ]);
+          }
+          return res.data;
+        });
+      },
+      handlRequest () {
+        return Promise.resolve();
+      }
+    }
+  };
+</script>

+ 101 - 0
src/components/upload/imgUpload.vue

@@ -0,0 +1,101 @@
+<template>
+  <ele-image-upload
+    v-model="images"
+    :limit="limit"
+    :drag="true"
+    :multiple="true"
+    :upload-handler="uploadHandler"
+    @upload="onUpload"
+  >
+  </ele-image-upload>
+</template>
+
+<script>
+  import EleImageUpload from 'ele-admin/es/ele-image-upload';
+  import { getImageUrl, getImagePath } from '@/utils/file';
+  import { uploadFile } from '@/api/system/file/index';
+
+  export default {
+    components: { EleImageUpload },
+    props: {
+      // 所属模块
+      module: {
+        type: String,
+        required: true
+      },
+      // 限制数量
+      limit: {
+        type: Number,
+        default: -1
+      },
+      value: {
+        type: Array,
+        default: () => []
+      }
+    },
+    data () {
+      return {};
+    },
+    computed: {
+      images: {
+        set (val) {
+          this.$emit(
+            'input',
+            val.map((item) => ({
+              ...item,
+              url: getImagePath(item.url)
+            }))
+          );
+        },
+        get () {
+          const arr = this.value.map((item) => ({
+            ...item,
+            url: getImageUrl(item.url)
+          }));
+
+          return arr;
+        }
+      }
+    },
+    methods: {
+      /* 上传事件 */
+      uploadHandler (file) {
+        const item = {
+          file,
+          uid: file.uid,
+          name: file.name,
+          progress: 0,
+          status: null
+        };
+        if (!file.type.startsWith('image')) {
+          this.$message.error('只能选择图片');
+          return;
+        }
+        if (file.size / 1024 / 1024 > 2) {
+          this.$message.error('大小不能超过 2MB');
+          return;
+        }
+        this.$emit('input', [...this.value, item]);
+        this.onUpload(item);
+      },
+      /* 上传 item */
+      async onUpload (item) {
+        // 模拟上传
+        item.status = 'uploading';
+        item.progress = 20;
+
+        const res = await uploadFile({
+          module: this.module,
+          multiPartFile: item.file
+        });
+        if (res.data) {
+          item.url = res.data.storePath;
+          item.id = res.data.id;
+
+          item.progress === 100;
+          item.status = 'done';
+        }
+      }
+    }
+  };
+</script>

+ 5 - 1
src/config/setting.js

@@ -3,6 +3,8 @@ export const API_BASE_URL = process.env.VUE_APP_API_BASE_URL;
 
 // 项目名称
 export const PROJECT_NAME = process.env.VUE_APP_NAME;
+// 系统名称
+export const SYSTEM_NAME = 'main-data';
 
 // 不显示侧栏的路由
 export const HIDE_SIDEBARS = [];
@@ -102,7 +104,9 @@ export const TAB_KEEP_ALIVE = true;
 export const TOKEN_HEADER_NAME = 'Authorization';
 
 // token 存储的名称
-export const TOKEN_STORE_NAME = 'access_token';
+export const TOKEN_STORE_NAME = window.__POWERED_BY_QIANKUN__
+  ? 'access_token'
+  : `${SYSTEM_NAME}-access_token`;
 
 // 主题配置存储的名称
 export const THEME_STORE_NAME = 'theme';

+ 4 - 1
src/router/index.js

@@ -8,11 +8,14 @@ import { WHITE_LIST, REDIRECT_PATH, LAYOUT_PATH } from '@/config/setting';
 import store from '@/store';
 import { getToken } from '@/utils/token-util';
 import { routes, getMenuRoutes } from './routes';
+import { SYSTEM_NAME } from '@/config/setting';
 
 Vue.use(VueRouter);
 
 const router = new VueRouter({
-  base: window.__POWERED_BY_QIANKUN__ ? '/page-main-data/' : '/main-data/',
+  base: window.__POWERED_BY_QIANKUN__
+    ? `/page-${SYSTEM_NAME}/`
+    : `/${SYSTEM_NAME}/`,
   routes,
   mode: 'history',
   scrollBehavior () {

+ 4 - 1
src/store/index.js

@@ -10,6 +10,7 @@ import theme from './modules/theme';
 import team from './modules/team';
 import createPersistedState from 'vuex-persistedstate';
 
+import { SYSTEM_NAME } from '@/config/setting';
 Vue.use(Vuex);
 
 export default new Vuex.Store({
@@ -25,7 +26,9 @@ export default new Vuex.Store({
   getters,
   plugins: [
     createPersistedState({
-      key: 'vuex-main',
+      key: window.__POWERED_BY_QIANKUN__
+        ? `vuex-${SYSTEM_NAME}`
+        : `private-vuex-${SYSTEM_NAME}`,
       storage: window.sessionStorage,
       paths: ['user']
     })

+ 2 - 2
src/store/modules/user.js

@@ -105,8 +105,8 @@ export default {
     //动态路由
     async fetchUserInfo ({ commit }) {
       const result = await getResourcesTree().catch(() => {});
-      const list = result.filter((i) => i.path === '/page-main-data');
-      if (!list.length) {
+      const list = result?.filter((i) => i.path === '/page-main-data');
+      if (!list?.length) {
         return {};
       }
 

+ 32 - 0
src/utils/file.js

@@ -0,0 +1,32 @@
+import { getToken } from './token-util';
+import { TOKEN_HEADER_NAME } from '@/config/setting';
+
+// 获取图片反显url
+export function getImageUrl (path) {
+  if (process.env.NODE_ENV === 'development') {
+    return `http://192.168.3.51:18086/main/file/getFile?${TOKEN_HEADER_NAME}=${getToken()}&objectName=${path}`;
+  } else {
+    return `/main/file/getFile?${TOKEN_HEADER_NAME}=${getToken()}&objectName=${path}`;
+  }
+}
+// 从反显url上获取接口需要path
+export function getImagePath (url) {
+  if (!url) {
+    return '';
+  }
+
+  const match = url.match(/&objectName=([\S\s]*)/);
+
+  return (match && match[1].split('&')[0]) || '';
+}
+
+// 下载方法
+export function download (data, name) {
+  const a = document.createElement('a');
+  const url = window.URL.createObjectURL(new Blob([data]));
+  const filename = name;
+  a.href = url;
+  a.download = filename;
+  a.click();
+  window.URL.revokeObjectURL(url);
+}

+ 9 - 9
src/views/material/list/components/list-edit.vue

@@ -33,9 +33,9 @@
           </el-form-item>
         </el-col>
         <el-col :span="12">
-          <el-form-item label="分类树" prop="categoryLevelName">
+          <el-form-item label="分类树" prop="categoryLevelRootName">
             <el-input
-              v-model="form.categoryLevelName"
+              v-model="form.categoryLevelRootName"
                @click.native="chooseCategory"
             />
           </el-form-item>
@@ -55,7 +55,7 @@
 
 <script>
   import CategoryDialog from './CategoryDialog.vue'
-  import { addUsers, putUsers } from '@/api/system/user';
+  import { saveItemGroup , updateItemGroup } from '@/api/material/list';
 
   export default {
     components: {
@@ -72,7 +72,8 @@
         id: null,
         name: '',
         code: '',
-        categoryLevelName: ''
+        categoryLevelRootName: '',
+        categoryLevelRootId:''
       };
       return {
         defaultForm,
@@ -86,7 +87,7 @@
           name: [
             { required: true, message: '请输入物料组名称', trigger: 'blur' }
           ],
-          categoryLevelName: [
+          categoryLevelRootName: [
             { required: true, message: '请选择所属分类', trigger: 'change' }
           ]
         },
@@ -107,9 +108,8 @@
            this.$refs.categoryRefs.open()
       },
       changeCategory(row){
-        console.log('rrr',row)
-         this.$set(this.form,'categoryLevelName',row.name)
-         this.$set(this.form,'categoryLevelId',row.id)
+         this.$set(this.form,'categoryLevelRootName',row.name)
+         this.$set(this.form,'categoryLevelRootId',row.id)
       },
       /* 保存编辑 */
       save() {
@@ -124,7 +124,7 @@
           const data = {
             ...this.form
           };
-          const saveOrUpdate = this.isUpdate ? putUsers : addUsers;
+          const saveOrUpdate = this.isUpdate ? updateItemGroup : saveItemGroup;
           saveOrUpdate(data)
             .then((msg) => {
               this.loading = false;

+ 10 - 36
src/views/material/list/index.vue

@@ -24,30 +24,6 @@
             新建
           </el-button>
         </template>
-
-        <template v-slot:roleList="{ row }">
-          <el-tag
-            v-for="item in row.roleList"
-            :key="item.id"
-            size="mini"
-            type="primary"
-            :disable-transitions="true"
-          >
-            {{ item.name }}
-          </el-tag>
-        </template>
-        <!-- 状态列 -->
-        <template v-slot:enable="{ row }">
-          <el-switch
-            v-model="row.enable"
-            active-color="#13ce66"
-            inactive-color="#ff4949"
-            :active-value="1"
-            :inactive-value="0"
-            @change="changeEnable(row)"
-          >
-          </el-switch>
-        </template>
         <!-- 操作列 -->
         <template v-slot:action="{ row }">
           <el-link
@@ -83,7 +59,7 @@
 </template>
 
 <script>
-  import { pageUsers } from '@/api/system/user';
+  import { getGroupPage , removeItem } from '@/api/material/list';
   import ListEdit from './components/list-edit.vue';
   export default {
     name: 'MaterialList',
@@ -104,27 +80,24 @@
             label: '序号'
           },
           {
-            prop: 'loginName',
+            prop: 'name',
             label: '物料组名称',
-            // sortable: 'custom',
             showOverflowTooltip: true,
             minWidth: 110
           },
           {
-            columnKey: 'roleList',
+            prop: 'code',
             label: '物料组编码',
             showOverflowTooltip: true,
-            minWidth: 110,
-            slot: 'roleList'
+            minWidth: 110
           },
           {
-            prop: 'createTime',
+            prop: 'categoryLevelRootName',
             label: '关联分类树',
-            // sortable: 'custom',
             showOverflowTooltip: true,
             minWidth: 110,
-            formatter: (_row, _column, cellValue) => {
-              return this.$util.toDateString(cellValue);
+            formatter:(_row, _column, cellValue) => {
+              return _row.categoryLevelRootName+'分类';
             }
           },
           {
@@ -135,6 +108,7 @@
             resizable: false,
             slot: 'action',
             showOverflowTooltip: true
+
           }
         ],
         // 表格选中数据
@@ -148,7 +122,7 @@
     methods: {
       /* 表格数据源 */
       datasource ({ page, limit, where, order }) {
-        return pageUsers({ ...where, ...order, pageNum: page, size: limit });
+        return getGroupPage({ ...where, ...order, pageNum: page, size: limit });
       },
       /* 刷新表格 */
       reload (where) {
@@ -163,7 +137,7 @@
       /* 删除 */
       remove (row) {
         const loading = this.$loading({ lock: true });
-        deleteUsers([row.id])
+        removeItem([row.id])
           .then((msg) => {
             loading.close();
             this.$message.success(msg);

+ 151 - 0
src/views/material/manage/components/GroupDialog.vue

@@ -0,0 +1,151 @@
+<template>
+  <el-dialog
+    title="选择物料组"
+    :visible.sync="groupVisible"
+    :before-close="handleClose"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    append-to-body
+    width="60%"
+  >
+    <div>
+      <el-row>
+        <el-col :span="24" class="table_col">
+          <el-table
+            :data="tableData"
+            height="450"
+            highlight-current-row
+            @row-click="single"
+          >
+            <el-table-column label="物料组名称" prop="name" width="200"></el-table-column>
+            <el-table-column label="物料组编码" prop="code"></el-table-column>
+            <el-table-column label="分类树" prop="categoryLevelRootName">
+               <template slot-scope="scope">
+                   {{scope.row.categoryLevelRootName+'分类'}}
+               </template>
+            </el-table-column>
+            <el-table-column label="选择" align="center">
+               <template slot-scope="scope">
+            	 <el-radio class="radio" v-model="radio" :label="scope.row.id"><i></i></el-radio>
+               </template>
+            </el-table-column>
+          </el-table>
+         <div class="pagination">
+            <el-pagination
+              background
+              layout="total, sizes, prev, pager, next, jumper"
+              :total="total"
+              :page-sizes="[10, 20, 50, 100]"
+              :page-size="pagination.size"
+              :current-page.sync="pagination.pageNum"
+              @current-change="handleCurrent"
+              @size-change="handleSize"
+            >
+            </el-pagination>
+          </div>
+        </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 { getGroupPage } from '@/api/material/list';
+export default {
+  data () {
+    return {
+      groupVisible: false,
+      tableData: [],
+      search:{},
+      pagination: {
+        pageNum: 1,
+        size: 10,
+      },
+      total: 0,
+      radio: '',
+      current:null
+    }
+  },
+
+  watch: {
+
+  },
+  methods: {
+    open(item){
+      if(item){
+        this.current = item
+        this.radio = item.id
+      }
+      this.groupVisible = true
+      this.getList()
+    },
+
+    // 单击获取id
+    single (row) {
+        this.current = row
+        this.radio = row.id
+    },
+
+    handleClose () {
+      this.groupVisible = false
+      this.current = null
+      this.radio = ''
+    },
+    handleCurrent (page) {
+      this.pagination.pageNum = page
+      this.getList()
+    },
+    handleSize (size) {
+      this.pagination.pageNum = 1
+      this.pagination.size = size
+      this.getList()
+    },
+    getList(){
+      let params = {...this.pagination}
+      getGroupPage(params).then(res=>{
+         this.tableData = res.list
+         this.total = res.count
+      })
+    },
+    selected(){
+       if(!this.current){
+         return this.$message.warning('请选择物料组')
+       }
+       this.$emit('changeMaterial',this.current)
+       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>

+ 0 - 163
src/views/material/manage/components/dict-data-edit.vue

@@ -1,163 +0,0 @@
-<!-- 字典项编辑弹窗 -->
-<template>
-  <ele-modal
-    width="460px"
-    :visible="visible"
-    :close-on-click-modal="true"
-    :title="isUpdate ? '修改字典项' : '添加字典项'"
-    @update:visible="updateVisible"
-  >
-    <el-form :model="form" ref="form" :rules="rules" label-width="96px">
-      <el-form-item label="字典项名称:" prop="dictDataName">
-        <el-input
-          clearable
-          :maxlength="20"
-          v-model="form.dictDataName"
-          placeholder="请输入字典项名称"
-        />
-      </el-form-item>
-      <el-form-item label="字典项值:" prop="dictDataCode">
-        <el-input
-          clearable
-          :maxlength="20"
-          v-model="form.dictDataCode"
-          placeholder="请输入字典项值"
-        />
-      </el-form-item>
-      <el-form-item label="排序号:" prop="sortNumber">
-        <el-input-number
-          :min="0"
-          :max="9999"
-          v-model="form.sortNumber"
-          placeholder="请输入排序号"
-          controls-position="right"
-          class="ele-fluid ele-text-left"
-        />
-      </el-form-item>
-      <el-form-item label="备注:">
-        <el-input
-          :rows="4"
-          type="textarea"
-          :maxlength="200"
-          v-model="form.comments"
-          placeholder="请输入备注"
-        />
-      </el-form-item>
-    </el-form>
-    <template v-slot:footer>
-      <el-button @click="updateVisible(false)">取消 </el-button>
-      <el-button type="primary" :loading="loading" @click="save">
-        保存
-      </el-button>
-    </template>
-  </ele-modal>
-</template>
-
-<script>
-  import {
-    addDictionaryData,
-    updateDictionaryData
-  } from '@/api/system/dictionary-data';
-
-  export default {
-    // props: {
-    //   // 弹窗是否打开
-    //   visible: Boolean,
-    //   // 修改回显的数据
-    //   data: Object,
-    //   // 字典id
-    //   dictId: Object
-    // },
-    props: ['visible', 'data', 'dictId'],
-    data() {
-      const defaultForm = {
-        dictDataId: null,
-        dictDataName: '',
-        dictDataCode: '',
-        sortNumber: '',
-        comments: ''
-      };
-      return {
-        defaultForm,
-        // 表单数据
-        form: { ...defaultForm },
-        // 表单验证规则
-        rules: {
-          dictDataName: [
-            {
-              required: true,
-              message: '请输入字典项名称',
-              trigger: 'blur'
-            }
-          ],
-          dictDataCode: [
-            {
-              required: true,
-              message: '请输入字典项值',
-              trigger: 'blur'
-            }
-          ],
-          sortNumber: [
-            {
-              required: true,
-              message: '请输入排序号',
-              trigger: 'blur'
-            }
-          ]
-        },
-        // 提交状态
-        loading: false,
-        // 是否是修改
-        isUpdate: false
-      };
-    },
-    methods: {
-      /* 保存编辑 */
-      save() {
-        this.$refs.form.validate((valid) => {
-          if (!valid) {
-            return false;
-          }
-          this.loading = true;
-          const saveOrUpdate = this.isUpdate
-            ? updateDictionaryData
-            : addDictionaryData;
-          saveOrUpdate({
-            ...this.form,
-            dictId: this.dictId
-          })
-            .then((msg) => {
-              this.loading = false;
-              console.log(msg);
-              this.$message.success(msg);
-              this.updateVisible(false);
-              this.$emit('done');
-            })
-            .catch((e) => {
-              this.loading = false;
-              // this.$message.error(e.message);
-            });
-        });
-      },
-      /* 更新visible */
-      updateVisible(value) {
-        this.$emit('update:visible', value);
-      }
-    },
-    watch: {
-      visible(visible) {
-        if (visible) {
-          if (this.data) {
-            this.$util.assignObject(this.form, this.data);
-            this.isUpdate = true;
-          } else {
-            this.isUpdate = false;
-          }
-        } else {
-          this.$refs.form.clearValidate();
-          this.form = { ...this.defaultForm };
-        }
-      }
-    }
-  };
-</script>

+ 0 - 476
src/views/material/manage/components/dict-edit.vue

@@ -1,476 +0,0 @@
-<!-- 字典编辑弹窗 -->
-<template>
-  <ele-modal
-    width="800px"
-    :maxable="true"
-    :visible="visible"
-    :close-on-click-modal="true"
-    :title="isUpdate ? '修改字典' : '添加字典'"
-    @update:visible="updateVisible"
-  >
-    <div class="divider">
-      <div class="title">
-        <div class="ele-bg-primary"></div>
-        <span>基本信息</span>
-      </div>
-      <div class="ele-bg-primary" style="width: 100%; height: 2px"></div>
-    </div>
-    <el-form
-      ref="form"
-      :model="form"
-      :rules="rules"
-      label-width="85px"
-      style="margin-bottom: 10px"
-    >
-      <el-row>
-        <el-col :span="12">
-          <el-form-item label="字典名称:" prop="name">
-            <el-input
-              clearable
-              :disabled="isUpdate"
-              :maxlength="20"
-              v-model="form.name"
-              placeholder="请输入字典名称"
-            />
-          </el-form-item>
-        </el-col>
-        <el-col :span="12">
-          <el-form-item label="字典值:" prop="code">
-            <el-input
-              clearable
-              :disabled="isUpdate"
-              :maxlength="20"
-              v-model="form.code"
-              placeholder="请输入字典值"
-            />
-          </el-form-item>
-        </el-col>
-        <el-col :span="12">
-          <el-form-item label="应用类型:" prop="appType">
-            <el-radio-group v-model="form.appType">
-              <el-radio :label="1">业务字典</el-radio>
-              <el-radio :label="2">数据字典</el-radio>
-            </el-radio-group>
-          </el-form-item>
-        </el-col>
-        <el-col :span="12">
-          <el-form-item label="是否启用:" prop="enable">
-            <el-radio-group v-model="form.enable">
-              <el-radio :label="1">是</el-radio>
-              <el-radio :label="0">否</el-radio>
-            </el-radio-group>
-          </el-form-item>
-        </el-col>
-        <!-- <el-col :span="12">
-          <el-form-item label="排序号:" prop="sortNumber">
-            <el-input-number
-              :min="0"
-              :max="9999"
-              v-model="form.sortNumber"
-              controls-position="right"
-              placeholder="请输入排序号"
-              class="ele-fluid ele-text-left"
-            />
-          </el-form-item>
-        </el-col> -->
-
-        <el-col :span="24">
-          <el-form-item label="备注:">
-            <el-input
-              :rows="4"
-              type="textarea"
-              :maxlength="200"
-              v-model="form.remark"
-              placeholder="请输入备注"
-            />
-          </el-form-item>
-        </el-col>
-      </el-row>
-    </el-form>
-    <div class="divider">
-      <div class="title">
-        <div class="ele-bg-primary"></div>
-        <span>字典项配置</span>
-      </div>
-      <div class="ele-bg-primary" style="width: 100%; height: 2px"></div>
-    </div>
-    <div style="margin: 5px 0">
-      <el-button
-        size="small"
-        type="primary"
-        icon="el-icon-plus"
-        class="ele-btn-icon"
-        @click="pushArr"
-      >
-        添加
-      </el-button>
-
-      <!-- <el-button
-        size="small"
-        type="danger"
-        icon="el-icon-delete"
-        class="ele-btn-icon"
-        @click="removeArr"
-      >
-        删除
-      </el-button> -->
-    </div>
-    <el-table
-      :data="tableData"
-      border
-      style="width: 100%"
-      @selection-change="handleSelectionChange"
-    >
-      <el-table-column prop="code" label="字典项编码">
-        <template slot-scope="scope">
-          <el-input
-            @blur="checkedValue(scope.row.code)"
-            v-model="scope.row.code"
-            placeholder=""
-          ></el-input>
-        </template>
-      </el-table-column>
-      <el-table-column prop="name" label="字典项名称">
-        <template slot-scope="scope">
-          <el-input v-model="scope.row.name" placeholder=""></el-input>
-        </template>
-      </el-table-column>
-      <el-table-column prop="sort" label="排序">
-        <template slot-scope="scope">
-          <el-input
-            v-model="scope.row.sort"
-            @input="
-              scope.row.sort = String(scope.row.sort).replace(/[^\d]/g, '')
-            "
-          ></el-input>
-        </template>
-      </el-table-column>
-      <el-table-column prop="enable" label="启用">
-        <template slot-scope="scope">
-          <el-radio-group v-model="scope.row.enable">
-            <el-radio :label="1">是</el-radio>
-            <el-radio :label="0">否</el-radio>
-          </el-radio-group>
-        </template>
-      </el-table-column>
-      <el-table-column align="center" label="操作">
-        <template slot-scope="scope">
-          <el-popconfirm
-            class="ele-action"
-            title="确定要删除此字典项吗?"
-            @confirm="removeArr(scope)"
-          >
-            <template v-slot:reference>
-              <el-link type="danger" :underline="false" icon="el-icon-delete">
-                删除
-              </el-link>
-            </template>
-          </el-popconfirm>
-        </template>
-      </el-table-column>
-    </el-table>
-
-    <template v-slot:footer>
-      <el-button @click="updateVisible(false)">取消</el-button>
-      <el-button type="primary" :loading="loading" @click="save">
-        保存
-      </el-button>
-    </template>
-  </ele-modal>
-</template>
-
-<script>
-  import { addDictionary, updateDictionary } from '@/api/system/dictionary';
-  import {
-    pageDictionaryData,
-    removeDictionaryData,
-    removeDictionaryDataBatch
-  } from '@/api/system/dictionary-data';
-
-  export default {
-    props: {
-      // 弹窗是否打开
-      visible: Boolean,
-      // 修改回显的数据
-      id: String | Number
-    },
-    data() {
-      const defaultForm = {
-        name: '',
-        code: '',
-        appType: 1,
-        enable: 1,
-        remark: '',
-        dictStaticSubmitPOList: []
-      };
-      return {
-        defaultForm,
-        // 表单数据
-        form: { ...defaultForm },
-        // form: {
-        //   name: '',
-        //   code: '',
-        //   appType: 1,
-        //   enable: 1,
-        //   remark: ''
-        // },
-        // 表单验证规则
-        rules: {
-          name: [
-            {
-              required: true,
-              message: '请输入字典名称',
-              trigger: 'blur'
-            }
-          ],
-          code: [
-            {
-              required: true,
-              message: '请输入字典值',
-              trigger: 'blur'
-            }
-          ],
-          appType: [
-            {
-              required: true,
-              message: '请选择应用类型',
-              trigger: 'blur'
-            }
-          ],
-          enable: [
-            {
-              required: true,
-              message: '请选择是否启用',
-              trigger: 'blur'
-            }
-          ],
-          sort: [
-            {
-              required: true,
-              message: '请输入排序号',
-              trigger: 'blur'
-            }
-          ]
-        },
-        // 表格列配置
-        columns: [
-          {
-            columnKey: 'selection',
-            type: 'selection',
-            width: 45,
-            align: 'center'
-          },
-          {
-            columnKey: 'index',
-            type: 'index',
-            width: 45,
-            align: 'center',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'code',
-            label: '字典编码',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'name',
-            label: '字典名称',
-
-            showOverflowTooltip: true
-          },
-          // {
-          //   prop: 'appType',
-          //   label: '字典类型',
-
-          //   showOverflowTooltip: true,
-          //   minWidth: 110
-          // },
-          {
-            prop: 'appType',
-            label: '应用类型',
-
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'remark',
-            label: '描述',
-
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'createTime',
-            label: '创建时间',
-
-            showOverflowTooltip: true,
-            minWidth: 110,
-            formatter: (_row, _column, cellValue) => {
-              return this.$util.toDateString(cellValue);
-            }
-          },
-          {
-            columnKey: 'action',
-            label: '操作',
-            width: 130,
-            align: 'center',
-            resizable: false,
-            slot: 'action',
-            showOverflowTooltip: true
-          }
-        ],
-        tableData: [],
-        // 表格选中数据
-        selection: [],
-        datasource: {
-          list: []
-        },
-        // 提交状态
-        loading: false,
-        // 是否是修改
-        isUpdate: false,
-        delectId: 1
-      };
-    },
-    created() {},
-
-    methods: {
-      pushArr() {
-        this.form.dictStaticSubmitPOList.push({
-          code: '',
-          enable: 1,
-          name: '',
-          sort: '',
-          delectId: this.delectId
-        });
-        this.delectId = this.delectId + 1;
-        this.filterArr();
-      },
-      //
-      checkedValue(val) {
-        console.log(val);
-      },
-      removeArr(row) {
-        console.log(row);
-        if (row.row.id) {
-          this.form.dictStaticSubmitPOList.forEach((item) => {
-            if (item.id === row.row.id) {
-              item.deleted = 1;
-            }
-          });
-          this.filterArr();
-        } else {
-          let index = this.form.dictStaticSubmitPOList.findIndex(
-            (item) => item.delectId === row.row.delectId
-          );
-          console.log(index);
-          this.form.dictStaticSubmitPOList.splice(index, 1); // 在数组的指定位置移除对应的元素。 返回移除的
-          this.filterArr();
-        }
-
-        // let falg = this.form.dictStaticSubmitPOList[row.$index].deleted === 0;
-        // if (falg) {
-        //   this.form.dictStaticSubmitPOList[row.$index].deleted = 1;
-        //   this.filterArr();
-        // } else {
-        //   this.form.dictStaticSubmitPOList.splice(row.$index, 1);
-        //   this.filterArr();
-        // }
-      },
-      handleSelectionChange() {},
-      /* 保存编辑 */
-      save() {
-        this.$refs.form.validate((valid) => {
-          if (!valid) {
-            return false;
-          }
-          let falg = this.form.dictStaticSubmitPOList.some(
-            (item, index) => item.code.length === 0
-          );
-          if (falg) {
-            this.$message({
-              message: '字典项编码不能为空',
-              type: 'warning'
-            });
-            return;
-          }
-          this.form.dictStaticSubmitPOList.forEach((item, index) => {
-            if (item.delectId) {
-              delete item.delectId;
-            }
-          });
-
-          this.loading = true;
-          const saveOrUpdate = this.isUpdate ? updateDictionary : addDictionary;
-          saveOrUpdate(this.form)
-            .then((msg) => {
-              this.loading = false;
-              this.$message.success(msg);
-              this.updateVisible(false);
-              this.$emit('done');
-            })
-            .catch((e) => {
-              this.loading = false;
-              // // this.$message.error(e.message);
-            });
-        });
-      },
-      filterArr() {
-        this.tableData = this.form.dictStaticSubmitPOList.filter(
-          (item) => item.deleted !== 1
-        );
-      },
-      /* 更新visible */
-      updateVisible(value) {
-        this.$emit('update:visible', value);
-      },
-
-      async getDetail() {
-        const res = await pageDictionaryData(this.id);
-        this.form = res.data.dictInfoVO;
-
-        this.form.dictStaticSubmitPOList = res.data.dictStaticVOList;
-        if (this.form.dictStaticSubmitPOList.length > 0) {
-          this.filterArr();
-        } else {
-          this.tableTata = [];
-        }
-      }
-    },
-    watch: {
-      visible(visible) {
-        if (visible) {
-          if (this.id) {
-            // this.$util.assignObject(this.form, this.data);
-            this.isUpdate = true;
-            this.getDetail();
-          } else {
-            this.isUpdate = false;
-          }
-        } else {
-          this.$refs.form.clearValidate();
-          this.form = { ...this.defaultForm };
-          this.form.dictStaticSubmitPOList = []; // clear the list of the dictionary static push button. 描述变化的字段不会在push后
-          this.tableData = []; // clear the list of the dictionary static push button. 描述变化的字段不会在push后。
-        }
-      }
-    }
-  };
-</script>
-<style lang="scss" scoped>
-  .divider {
-    margin-bottom: 20px;
-
-    .title {
-      display: flex;
-      align-items: center;
-      margin-bottom: 10px;
-      div {
-        width: 8px;
-        height: 20px;
-        margin-right: 10px;
-      }
-      span {
-        font-size: 20px;
-      }
-    }
-  }
-</style>

+ 9 - 7
src/views/material/manage/components/dict-data.vue → src/views/material/manage/components/index-data.vue

@@ -52,23 +52,19 @@
       </template>
     </ele-pro-table>
     <!-- 编辑弹窗 -->
-    <dict-edit :visible.sync="showEdit" :id="id" @done="reload" />
+<!--    <dict-edit :visible.sync="showEdit" :id="id" @done="reload" /> -->
   </div>
 </template>
 
 <script>
-  import DictDataSearch from './dict-data-search.vue';
-  import DictDataEdit from './dict-data-edit.vue';
   import {
     pageDictionaryData,
     removeDictionaryData,
     removeDictionaryDataBatch
   } from '@/api/system/dictionary-data';
   import { listDictionaries, removeDictionary } from '@/api/system/dictionary';
-  import DictEdit from './dict-edit.vue';
-
   export default {
-    components: { DictDataSearch, DictDataEdit, DictEdit },
+    components: { },
     data() {
       return {
         // 表格列配置
@@ -176,7 +172,13 @@
           this.id = row.id;
           this.current = row;
         }
-        this.showEdit = true;
+        this.$router.push({
+          path: '/material/manage/manageMaterial',
+          // query: {
+          //   pageTitle: '编辑物品',
+          //   id: row.id
+          // }
+        });
       },
       /* 删除 */
       remove(row) {

+ 1 - 10
src/views/material/manage/components/dict-data-search.vue → src/views/material/manage/components/index-search.vue

@@ -61,15 +61,9 @@
       // 默认表单数据
       const defaultWhere = {
         name: '',
-        code: '',
-        appType: ''
+        code: ''
       };
       return {
-        options: [
-          { value: 0, label: '全部' },
-          { value: 1, label: '业务字典' },
-          { value: 2, label: '数据字典' }
-        ],
         defaultWhere,
         // 表单数据
         where: { ...defaultWhere }
@@ -84,9 +78,6 @@
     methods: {
       /* 搜索 */
       search() {
-        if (this.where.appType === 0) {
-          this.where.appType = '';
-        }
         this.$emit('search', this.where);
       },
       /*  重置 */

+ 8 - 9
src/views/material/manage/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="ele-body">
     <el-card shadow="never">
-      <DictDataSearch @search="reload" />
+      <IndexSearch @search="reload" />
 <!--      <div style="margin: 5px 0; padding-left: 262px">
         <el-button
           size="small"
@@ -38,7 +38,7 @@
 
         <template v-slot:content>
           <!-- 物料列表 -->
-          <dict-data ref="dictData" v-if="current" :dict-id="current.id" />
+          <IndexData ref="listData" v-if="current" :dict-id="current.id" />
         </template>
       </ele-split-layout>
     </el-card>
@@ -48,14 +48,13 @@
 </template>
 
 <script>
-  import DictData from './components/dict-data.vue';
-  import DictEdit from './components/dict-edit.vue';
-  import DictDataSearch from './components/dict-data-search.vue';
+  import IndexData from './components/index-data.vue';
+  import IndexSearch from './components/index-search.vue';
   import { listDictionaries, removeDictionary } from '@/api/system/dictionary';
-  import { getSubPage } from '@/api/classifyManage';
+  import { getGroupPage } from '@/api/material/list';
   export default {
     name: 'SystemDictionary',
-    components: { DictData, DictEdit, DictDataSearch },
+    components: { IndexData , IndexSearch },
     data() {
       return {
         // 表格列配置
@@ -85,7 +84,7 @@
     methods: {
       /* 表格数据源 */
       datasource() {
-        return getSubPage({pageNum:1,size:-1,parentId: 0});
+        return getGroupPage({pageNum:1,size:-1});
       },
       /* 表格渲染完成回调 */
       done(res) {
@@ -96,7 +95,7 @@
       /* 刷新表格 */
       reload(where) {
         this.$refs.table.reload();
-        this.$refs.dictData.reload(where);
+        this.$refs.listData.reload(where);
       }
     }
   };

+ 152 - 0
src/views/material/manage/manageMaterial.vue

@@ -0,0 +1,152 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never">
+      <el-form label-width="90px"  ref="form" :model="form" :rules="rules">
+         <div class="body-top">
+            <div class="top-left">
+               <div class="ele-page-header ele-cell">
+                 <div class="ele-page-title">管理物料</div>
+               </div>
+               <el-row :gutter="24">
+                 <el-col :span="24">
+                   <el-form-item label="物料组"  label-width="70px" prop="categoryLevelRootName">
+                      <el-input @click.native="chooseMaterial" v-model="form.categoryLevelRootName"/>
+                   </el-form-item>
+                 </el-col>
+               </el-row>
+            </div>
+            <div>
+               <el-button @click="cancel">返回</el-button>
+               <el-button type="primary">保存</el-button>
+            </div>
+         </div>
+         <div class="divider">
+           <div class="title">
+             <div class="ele-bg-primary"></div>
+             <span>基本信息</span>
+           </div>
+           <div class="ele-bg-primary ele-width"></div>
+         </div>
+         <el-row :gutter="24">
+           <el-col :span="8">
+             <el-form-item label="编码" prop="code">
+                <el-input  v-model="form.code"/>
+             </el-form-item>
+           </el-col>
+           <el-col :span="8">
+             <el-form-item label="名称" prop="name">
+                <el-input  v-model="form.name"/>
+             </el-form-item>
+           </el-col>
+           <el-col :span="8">
+             <el-form-item label="分类" prop="categoryName">
+                <el-input  v-model="form.categoryName"/>
+             </el-form-item>
+           </el-col>
+           <el-col :span="8">
+             <el-form-item label="牌号" prop="brand">
+                <el-input  v-model="form.brand"/>
+             </el-form-item>
+           </el-col>
+           <el-col :span="8">
+             <el-form-item label="规格" prop="specifications">
+                <el-input  v-model="form.specifications"/>
+             </el-form-item>
+           </el-col>
+           <el-col :span="8">
+             <el-form-item label="型号" prop="model">
+                <el-input  v-model="form.model"/>
+             </el-form-item>
+           </el-col>
+         </el-row>
+
+
+      </el-form>
+    </el-card>
+
+    <!-- 物料组弹窗 -->
+    <GroupDialog ref="groupRefs" @changeMaterial='determineChoose'/>
+  </div>
+</template>
+
+<script>
+  import GroupDialog from './components/GroupDialog.vue'
+  export default {
+    name: 'ManageMaterial',
+    components: { GroupDialog },
+    data() {
+      return {
+         form:{
+           categoryLevelRootName:'',
+           categoryName:''
+         },
+         // 表单验证规则
+         rules: {
+         	  categoryLevelRootName:[{ required: true, message: '请选择所属物料组', trigger: 'change' }],
+            code:[{ required: true, message: '请输入编码', trigger: 'blur' }],
+            name:[{ required: true, message: '请输入名称', trigger: 'blur' }],
+            categoryName:[{ required: true, message: '请选择所属分类', trigger: 'change' }],
+         },
+         chooseItem:null,
+
+
+      };
+    },
+
+    methods: {
+      chooseMaterial(){
+          this.$refs.groupRefs.open(this.chooseItem)
+      },
+      determineChoose(row){
+        this.chooseItem = row
+        this.$set(this.form,'categoryLevelRootName',row.name)
+      },
+      cancel(){
+        this.$router.go(-1)
+      },
+
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .ele-page-header{
+  	border: none;
+  }
+  .body-top{
+  	display: flex;
+  	align-items:center;
+  	justify-content:space-between;
+  	background: #fff;
+    .top-left{
+       display: flex;
+       align-items:center;
+       justify-content: flex-start;
+       margin-left: -25px;
+        .el-form-item{
+       	  margin-bottom: 0;
+       }
+    }
+
+  }
+  .divider {
+    margin: 20px 0;
+    .title {
+      display: flex;
+      align-items: center;
+      margin-bottom: 10px;
+      div {
+        width: 8px;
+        height: 20px;
+        margin-right: 10px;
+      }
+      span {
+        font-size: 20px;
+      }
+    }
+    .ele-width{
+      width: 100%;
+      height: 2px;
+    }
+  }
+</style>

+ 0 - 163
src/views/material/product/components/dict-data-edit.vue

@@ -1,163 +0,0 @@
-<!-- 字典项编辑弹窗 -->
-<template>
-  <ele-modal
-    width="460px"
-    :visible="visible"
-    :close-on-click-modal="true"
-    :title="isUpdate ? '修改字典项' : '添加字典项'"
-    @update:visible="updateVisible"
-  >
-    <el-form :model="form" ref="form" :rules="rules" label-width="96px">
-      <el-form-item label="字典项名称:" prop="dictDataName">
-        <el-input
-          clearable
-          :maxlength="20"
-          v-model="form.dictDataName"
-          placeholder="请输入字典项名称"
-        />
-      </el-form-item>
-      <el-form-item label="字典项值:" prop="dictDataCode">
-        <el-input
-          clearable
-          :maxlength="20"
-          v-model="form.dictDataCode"
-          placeholder="请输入字典项值"
-        />
-      </el-form-item>
-      <el-form-item label="排序号:" prop="sortNumber">
-        <el-input-number
-          :min="0"
-          :max="9999"
-          v-model="form.sortNumber"
-          placeholder="请输入排序号"
-          controls-position="right"
-          class="ele-fluid ele-text-left"
-        />
-      </el-form-item>
-      <el-form-item label="备注:">
-        <el-input
-          :rows="4"
-          type="textarea"
-          :maxlength="200"
-          v-model="form.comments"
-          placeholder="请输入备注"
-        />
-      </el-form-item>
-    </el-form>
-    <template v-slot:footer>
-      <el-button @click="updateVisible(false)">取消 </el-button>
-      <el-button type="primary" :loading="loading" @click="save">
-        保存
-      </el-button>
-    </template>
-  </ele-modal>
-</template>
-
-<script>
-  import {
-    addDictionaryData,
-    updateDictionaryData
-  } from '@/api/system/dictionary-data';
-
-  export default {
-    // props: {
-    //   // 弹窗是否打开
-    //   visible: Boolean,
-    //   // 修改回显的数据
-    //   data: Object,
-    //   // 字典id
-    //   dictId: Object
-    // },
-    props: ['visible', 'data', 'dictId'],
-    data() {
-      const defaultForm = {
-        dictDataId: null,
-        dictDataName: '',
-        dictDataCode: '',
-        sortNumber: '',
-        comments: ''
-      };
-      return {
-        defaultForm,
-        // 表单数据
-        form: { ...defaultForm },
-        // 表单验证规则
-        rules: {
-          dictDataName: [
-            {
-              required: true,
-              message: '请输入字典项名称',
-              trigger: 'blur'
-            }
-          ],
-          dictDataCode: [
-            {
-              required: true,
-              message: '请输入字典项值',
-              trigger: 'blur'
-            }
-          ],
-          sortNumber: [
-            {
-              required: true,
-              message: '请输入排序号',
-              trigger: 'blur'
-            }
-          ]
-        },
-        // 提交状态
-        loading: false,
-        // 是否是修改
-        isUpdate: false
-      };
-    },
-    methods: {
-      /* 保存编辑 */
-      save() {
-        this.$refs.form.validate((valid) => {
-          if (!valid) {
-            return false;
-          }
-          this.loading = true;
-          const saveOrUpdate = this.isUpdate
-            ? updateDictionaryData
-            : addDictionaryData;
-          saveOrUpdate({
-            ...this.form,
-            dictId: this.dictId
-          })
-            .then((msg) => {
-              this.loading = false;
-              console.log(msg);
-              this.$message.success(msg);
-              this.updateVisible(false);
-              this.$emit('done');
-            })
-            .catch((e) => {
-              this.loading = false;
-              // this.$message.error(e.message);
-            });
-        });
-      },
-      /* 更新visible */
-      updateVisible(value) {
-        this.$emit('update:visible', value);
-      }
-    },
-    watch: {
-      visible(visible) {
-        if (visible) {
-          if (this.data) {
-            this.$util.assignObject(this.form, this.data);
-            this.isUpdate = true;
-          } else {
-            this.isUpdate = false;
-          }
-        } else {
-          this.$refs.form.clearValidate();
-          this.form = { ...this.defaultForm };
-        }
-      }
-    }
-  };
-</script>

+ 0 - 227
src/views/material/product/components/dict-data.vue

@@ -1,227 +0,0 @@
-<template>
-  <div>
-    <!-- 数据表格 -->
-    <ele-pro-table
-      ref="table"
-      :columns="columns"
-      :datasource="datasource"
-      :need-page="true"
-      :toolkit="[]"
-      :selection.sync="selection"
-      height="calc(100vh - 350px)"
-      full-height="calc(100vh - 116px)"
-      tool-class="ele-toolbar-form"
-      cache-key="systemDictDataTable"
-    >
-      <!-- 表头工具栏 -->
-      <!-- <template v-slot:toolbar>
-        <dict-data-search @search="reload">
-          <el-button
-            size="small"
-            type="primary"
-            icon="el-icon-plus"
-            class="ele-btn-icon"
-            @click="openEdit()"
-          >
-            添加
-          </el-button>
-          <el-button
-            size="small"
-            type="danger"
-            icon="el-icon-delete"
-            class="ele-btn-icon"
-            @click="removeBatch"
-          >
-            删除
-          </el-button>
-        </dict-data-search>
-      </template> -->
-      <!-- 操作列 -->
-      <template v-slot:appType="{ row }">
-        {{ types[row.appType] }}
-      </template>
-      <template v-slot:action="{ row }">
-        <el-link
-          type="primary"
-          :underline="false"
-          icon="el-icon-edit"
-          @click="openEdit(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>
-    <!-- 编辑弹窗 -->
-    <dict-edit :visible.sync="showEdit" :id="id" @done="reload" />
-  </div>
-</template>
-
-<script>
-  import DictDataSearch from './dict-data-search.vue';
-  import DictDataEdit from './dict-data-edit.vue';
-  import {
-    pageDictionaryData,
-    removeDictionaryData,
-    removeDictionaryDataBatch
-  } from '@/api/system/dictionary-data';
-  import { listDictionaries, removeDictionary } from '@/api/system/dictionary';
-  import DictEdit from './dict-edit.vue';
-
-  export default {
-    components: { DictDataSearch, DictDataEdit, DictEdit },
-    data() {
-      return {
-        // 表格列配置
-        columns: [
-          {
-            columnKey: 'selection',
-            type: 'selection',
-            width: 45,
-            align: 'center'
-          },
-          {
-            columnKey: 'index',
-            type: 'index',
-            width: 45,
-            align: 'center',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'code',
-            label: '字典编码',
-            align: 'center',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'name',
-            label: '字典名称',
-            align: 'center',
-            showOverflowTooltip: true
-          },
-          // {
-          //   prop: 'appType',
-          //   label: '字典类型',
-
-          //   showOverflowTooltip: true,
-          //   minWidth: 110
-          // },
-          {
-            prop: 'appType',
-            align: 'center',
-            label: '应用类型',
-            showOverflowTooltip: true,
-            slot: 'appType'
-          },
-          {
-            prop: 'remark',
-            label: '描述',
-            align: 'center',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'updateTime',
-            label: '上次更新时间',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110,
-            formatter: (_row, _column, cellValue) => {
-              return this.$util.toDateString(cellValue);
-            }
-          },
-          {
-            columnKey: 'action',
-            label: '操作',
-            width: 130,
-            align: 'center',
-            resizable: false,
-            slot: 'action',
-            showOverflowTooltip: true
-          }
-        ],
-        types: {
-          1: '业务字典',
-          2: '数据字典'
-        },
-        // 表格选中数据
-        selection: [],
-        // 当前编辑数据
-        current: null,
-        // 是否显示编辑弹窗
-        showEdit: false,
-        id: ''
-      };
-    },
-
-    methods: {
-      /* 表格数据源 */
-      datasource({ page, limit, where, order }) {
-        return listDictionaries({ pageNum: page, size: limit, ...where });
-      },
-      /* 刷新表格 */
-      reload(where) {
-        this.$refs.table.reload({ page: 1, where: where });
-      },
-      /* 显示编辑 */
-      openEdit(row) {
-        this.id = row.id;
-        this.current = row;
-        this.showEdit = true;
-      },
-      /* 删除 */
-      remove(row) {
-        const loading = this.$loading({ lock: true });
-        removeDictionary(row.id)
-          .then((msg) => {
-            loading.close();
-            this.$message.success('删除' + msg);
-            this.reload();
-          })
-          .catch((e) => {
-            loading.close();
-            // this.$message.error(e.message);
-          });
-      },
-      /* 批量删除 */
-      removeBatch() {
-        if (!this.selection.length) {
-          this.$message.error('请至少选择一条数据');
-          return;
-        }
-        this.$confirm('确定要删除选中的字典项吗?', '提示', {
-          type: 'warning'
-        })
-          .then(() => {
-            const loading = this.$loading({ lock: true });
-            removeDictionaryDataBatch(this.selection.map((d) => d.dictDataId))
-              .then((msg) => {
-                loading.close();
-                this.$message.success(msg);
-                this.reload();
-              })
-              .catch((e) => {
-                loading.close();
-                // this.$message.error(e.message);
-              });
-          })
-          .catch(() => {});
-      }
-    },
-    watch: {
-      // 监听字典id变化
-      // dictId() {
-      //   this.reload();
-      // }
-    }
-  };
-</script>

+ 0 - 476
src/views/material/product/components/dict-edit.vue

@@ -1,476 +0,0 @@
-<!-- 字典编辑弹窗 -->
-<template>
-  <ele-modal
-    width="800px"
-    :maxable="true"
-    :visible="visible"
-    :close-on-click-modal="true"
-    :title="isUpdate ? '修改字典' : '添加字典'"
-    @update:visible="updateVisible"
-  >
-    <div class="divider">
-      <div class="title">
-        <div class="ele-bg-primary"></div>
-        <span>基本信息</span>
-      </div>
-      <div class="ele-bg-primary" style="width: 100%; height: 2px"></div>
-    </div>
-    <el-form
-      ref="form"
-      :model="form"
-      :rules="rules"
-      label-width="85px"
-      style="margin-bottom: 10px"
-    >
-      <el-row>
-        <el-col :span="12">
-          <el-form-item label="字典名称:" prop="name">
-            <el-input
-              clearable
-              :disabled="isUpdate"
-              :maxlength="20"
-              v-model="form.name"
-              placeholder="请输入字典名称"
-            />
-          </el-form-item>
-        </el-col>
-        <el-col :span="12">
-          <el-form-item label="字典值:" prop="code">
-            <el-input
-              clearable
-              :disabled="isUpdate"
-              :maxlength="20"
-              v-model="form.code"
-              placeholder="请输入字典值"
-            />
-          </el-form-item>
-        </el-col>
-        <el-col :span="12">
-          <el-form-item label="应用类型:" prop="appType">
-            <el-radio-group v-model="form.appType">
-              <el-radio :label="1">业务字典</el-radio>
-              <el-radio :label="2">数据字典</el-radio>
-            </el-radio-group>
-          </el-form-item>
-        </el-col>
-        <el-col :span="12">
-          <el-form-item label="是否启用:" prop="enable">
-            <el-radio-group v-model="form.enable">
-              <el-radio :label="1">是</el-radio>
-              <el-radio :label="0">否</el-radio>
-            </el-radio-group>
-          </el-form-item>
-        </el-col>
-        <!-- <el-col :span="12">
-          <el-form-item label="排序号:" prop="sortNumber">
-            <el-input-number
-              :min="0"
-              :max="9999"
-              v-model="form.sortNumber"
-              controls-position="right"
-              placeholder="请输入排序号"
-              class="ele-fluid ele-text-left"
-            />
-          </el-form-item>
-        </el-col> -->
-
-        <el-col :span="24">
-          <el-form-item label="备注:">
-            <el-input
-              :rows="4"
-              type="textarea"
-              :maxlength="200"
-              v-model="form.remark"
-              placeholder="请输入备注"
-            />
-          </el-form-item>
-        </el-col>
-      </el-row>
-    </el-form>
-    <div class="divider">
-      <div class="title">
-        <div class="ele-bg-primary"></div>
-        <span>字典项配置</span>
-      </div>
-      <div class="ele-bg-primary" style="width: 100%; height: 2px"></div>
-    </div>
-    <div style="margin: 5px 0">
-      <el-button
-        size="small"
-        type="primary"
-        icon="el-icon-plus"
-        class="ele-btn-icon"
-        @click="pushArr"
-      >
-        添加
-      </el-button>
-
-      <!-- <el-button
-        size="small"
-        type="danger"
-        icon="el-icon-delete"
-        class="ele-btn-icon"
-        @click="removeArr"
-      >
-        删除
-      </el-button> -->
-    </div>
-    <el-table
-      :data="tableData"
-      border
-      style="width: 100%"
-      @selection-change="handleSelectionChange"
-    >
-      <el-table-column prop="code" label="字典项编码">
-        <template slot-scope="scope">
-          <el-input
-            @blur="checkedValue(scope.row.code)"
-            v-model="scope.row.code"
-            placeholder=""
-          ></el-input>
-        </template>
-      </el-table-column>
-      <el-table-column prop="name" label="字典项名称">
-        <template slot-scope="scope">
-          <el-input v-model="scope.row.name" placeholder=""></el-input>
-        </template>
-      </el-table-column>
-      <el-table-column prop="sort" label="排序">
-        <template slot-scope="scope">
-          <el-input
-            v-model="scope.row.sort"
-            @input="
-              scope.row.sort = String(scope.row.sort).replace(/[^\d]/g, '')
-            "
-          ></el-input>
-        </template>
-      </el-table-column>
-      <el-table-column prop="enable" label="启用">
-        <template slot-scope="scope">
-          <el-radio-group v-model="scope.row.enable">
-            <el-radio :label="1">是</el-radio>
-            <el-radio :label="0">否</el-radio>
-          </el-radio-group>
-        </template>
-      </el-table-column>
-      <el-table-column align="center" label="操作">
-        <template slot-scope="scope">
-          <el-popconfirm
-            class="ele-action"
-            title="确定要删除此字典项吗?"
-            @confirm="removeArr(scope)"
-          >
-            <template v-slot:reference>
-              <el-link type="danger" :underline="false" icon="el-icon-delete">
-                删除
-              </el-link>
-            </template>
-          </el-popconfirm>
-        </template>
-      </el-table-column>
-    </el-table>
-
-    <template v-slot:footer>
-      <el-button @click="updateVisible(false)">取消</el-button>
-      <el-button type="primary" :loading="loading" @click="save">
-        保存
-      </el-button>
-    </template>
-  </ele-modal>
-</template>
-
-<script>
-  import { addDictionary, updateDictionary } from '@/api/system/dictionary';
-  import {
-    pageDictionaryData,
-    removeDictionaryData,
-    removeDictionaryDataBatch
-  } from '@/api/system/dictionary-data';
-
-  export default {
-    props: {
-      // 弹窗是否打开
-      visible: Boolean,
-      // 修改回显的数据
-      id: String | Number
-    },
-    data() {
-      const defaultForm = {
-        name: '',
-        code: '',
-        appType: 1,
-        enable: 1,
-        remark: '',
-        dictStaticSubmitPOList: []
-      };
-      return {
-        defaultForm,
-        // 表单数据
-        form: { ...defaultForm },
-        // form: {
-        //   name: '',
-        //   code: '',
-        //   appType: 1,
-        //   enable: 1,
-        //   remark: ''
-        // },
-        // 表单验证规则
-        rules: {
-          name: [
-            {
-              required: true,
-              message: '请输入字典名称',
-              trigger: 'blur'
-            }
-          ],
-          code: [
-            {
-              required: true,
-              message: '请输入字典值',
-              trigger: 'blur'
-            }
-          ],
-          appType: [
-            {
-              required: true,
-              message: '请选择应用类型',
-              trigger: 'blur'
-            }
-          ],
-          enable: [
-            {
-              required: true,
-              message: '请选择是否启用',
-              trigger: 'blur'
-            }
-          ],
-          sort: [
-            {
-              required: true,
-              message: '请输入排序号',
-              trigger: 'blur'
-            }
-          ]
-        },
-        // 表格列配置
-        columns: [
-          {
-            columnKey: 'selection',
-            type: 'selection',
-            width: 45,
-            align: 'center'
-          },
-          {
-            columnKey: 'index',
-            type: 'index',
-            width: 45,
-            align: 'center',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'code',
-            label: '字典编码',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'name',
-            label: '字典名称',
-
-            showOverflowTooltip: true
-          },
-          // {
-          //   prop: 'appType',
-          //   label: '字典类型',
-
-          //   showOverflowTooltip: true,
-          //   minWidth: 110
-          // },
-          {
-            prop: 'appType',
-            label: '应用类型',
-
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'remark',
-            label: '描述',
-
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'createTime',
-            label: '创建时间',
-
-            showOverflowTooltip: true,
-            minWidth: 110,
-            formatter: (_row, _column, cellValue) => {
-              return this.$util.toDateString(cellValue);
-            }
-          },
-          {
-            columnKey: 'action',
-            label: '操作',
-            width: 130,
-            align: 'center',
-            resizable: false,
-            slot: 'action',
-            showOverflowTooltip: true
-          }
-        ],
-        tableData: [],
-        // 表格选中数据
-        selection: [],
-        datasource: {
-          list: []
-        },
-        // 提交状态
-        loading: false,
-        // 是否是修改
-        isUpdate: false,
-        delectId: 1
-      };
-    },
-    created() {},
-
-    methods: {
-      pushArr() {
-        this.form.dictStaticSubmitPOList.push({
-          code: '',
-          enable: 1,
-          name: '',
-          sort: '',
-          delectId: this.delectId
-        });
-        this.delectId = this.delectId + 1;
-        this.filterArr();
-      },
-      //
-      checkedValue(val) {
-        console.log(val);
-      },
-      removeArr(row) {
-        console.log(row);
-        if (row.row.id) {
-          this.form.dictStaticSubmitPOList.forEach((item) => {
-            if (item.id === row.row.id) {
-              item.deleted = 1;
-            }
-          });
-          this.filterArr();
-        } else {
-          let index = this.form.dictStaticSubmitPOList.findIndex(
-            (item) => item.delectId === row.row.delectId
-          );
-          console.log(index);
-          this.form.dictStaticSubmitPOList.splice(index, 1); // 在数组的指定位置移除对应的元素。 返回移除的
-          this.filterArr();
-        }
-
-        // let falg = this.form.dictStaticSubmitPOList[row.$index].deleted === 0;
-        // if (falg) {
-        //   this.form.dictStaticSubmitPOList[row.$index].deleted = 1;
-        //   this.filterArr();
-        // } else {
-        //   this.form.dictStaticSubmitPOList.splice(row.$index, 1);
-        //   this.filterArr();
-        // }
-      },
-      handleSelectionChange() {},
-      /* 保存编辑 */
-      save() {
-        this.$refs.form.validate((valid) => {
-          if (!valid) {
-            return false;
-          }
-          let falg = this.form.dictStaticSubmitPOList.some(
-            (item, index) => item.code.length === 0
-          );
-          if (falg) {
-            this.$message({
-              message: '字典项编码不能为空',
-              type: 'warning'
-            });
-            return;
-          }
-          this.form.dictStaticSubmitPOList.forEach((item, index) => {
-            if (item.delectId) {
-              delete item.delectId;
-            }
-          });
-
-          this.loading = true;
-          const saveOrUpdate = this.isUpdate ? updateDictionary : addDictionary;
-          saveOrUpdate(this.form)
-            .then((msg) => {
-              this.loading = false;
-              this.$message.success(msg);
-              this.updateVisible(false);
-              this.$emit('done');
-            })
-            .catch((e) => {
-              this.loading = false;
-              // // this.$message.error(e.message);
-            });
-        });
-      },
-      filterArr() {
-        this.tableData = this.form.dictStaticSubmitPOList.filter(
-          (item) => item.deleted !== 1
-        );
-      },
-      /* 更新visible */
-      updateVisible(value) {
-        this.$emit('update:visible', value);
-      },
-
-      async getDetail() {
-        const res = await pageDictionaryData(this.id);
-        this.form = res.data.dictInfoVO;
-
-        this.form.dictStaticSubmitPOList = res.data.dictStaticVOList;
-        if (this.form.dictStaticSubmitPOList.length > 0) {
-          this.filterArr();
-        } else {
-          this.tableTata = [];
-        }
-      }
-    },
-    watch: {
-      visible(visible) {
-        if (visible) {
-          if (this.id) {
-            // this.$util.assignObject(this.form, this.data);
-            this.isUpdate = true;
-            this.getDetail();
-          } else {
-            this.isUpdate = false;
-          }
-        } else {
-          this.$refs.form.clearValidate();
-          this.form = { ...this.defaultForm };
-          this.form.dictStaticSubmitPOList = []; // clear the list of the dictionary static push button. 描述变化的字段不会在push后
-          this.tableData = []; // clear the list of the dictionary static push button. 描述变化的字段不会在push后。
-        }
-      }
-    }
-  };
-</script>
-<style lang="scss" scoped>
-  .divider {
-    margin-bottom: 20px;
-
-    .title {
-      display: flex;
-      align-items: center;
-      margin-bottom: 10px;
-      div {
-        width: 8px;
-        height: 20px;
-        margin-right: 10px;
-      }
-      span {
-        font-size: 20px;
-      }
-    }
-  }
-</style>

+ 19 - 36
src/views/material/product/components/dict-data-search.vue → src/views/material/product/components/product-search.vue

@@ -1,50 +1,35 @@
 <!-- 搜索表单 -->
 <template>
   <el-form
-    size="small"
     label-width="77px"
     class="ele-form-search"
     @keyup.enter.native="search"
     @submit.native.prevent
   >
     <el-row :gutter="10">
-      <el-col v-bind="styleResponsive ? { md: 4 } : { span: 4 }">
-        <el-form-item label="编码">
-          <el-input
-            clearable
-            size="small"
-            v-model="where.code"
-            placeholder="请输入"
-          />
+      <el-col v-bind="styleResponsive ? { md: 5 } : { span: 4 }">
+        <el-form-item label="产品编码">
+          <el-input clearable v-model="where.code" placeholder="请输入" />
         </el-form-item>
       </el-col>
-      <el-col v-bind="styleResponsive ? { md: 4 } : { span: 4 }">
-        <el-form-item label="名称">
-          <el-input
-            clearable
-            size="small"
-            v-model="where.name"
-            placeholder="请输入"
-          />
+      <el-col v-bind="styleResponsive ? { md: 5 } : { span: 4 }">
+        <el-form-item label="产品名称">
+          <el-input clearable v-model="where.name" placeholder="请输入" />
         </el-form-item>
       </el-col>
-      <el-col v-bind="styleResponsive ? { md: 4 } : { span: 4 }">
-        <el-form-item label="应用类型">
-          <el-select v-model="where.appType" placeholder="请选择">
-            <el-option
-              v-for="item in options"
-              :key="item.value"
-              :label="item.label"
-              :value="item.value"
-            >
-            </el-option>
-          </el-select>
+      <el-col v-bind="styleResponsive ? { md: 5 } : { span: 4 }">
+        <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: 4 }">
+      <el-col v-bind="styleResponsive ? { md: 5 } : { span: 4 }">
+        <el-form-item label="型号">
+          <el-input clearable v-model="where.name" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { md: 4 } : { span: 4 }">
         <el-form-item>
           <el-button
-            size="small"
             type="primary"
             icon="el-icon-search"
             class="ele-btn-icon"
@@ -60,8 +45,6 @@
             size="medium"
             >重置</el-button
           >
-
-          <slot></slot>
         </el-form-item>
       </el-col>
     </el-row>
@@ -70,7 +53,7 @@
 
 <script>
   export default {
-    data() {
+    data () {
       // 默认表单数据
       const defaultWhere = {
         name: '',
@@ -90,20 +73,20 @@
     },
     computed: {
       // 是否开启响应式布局
-      styleResponsive() {
+      styleResponsive () {
         return this.$store.state.theme.styleResponsive;
       }
     },
     methods: {
       /* 搜索 */
-      search() {
+      search () {
         if (this.where.appType === 0) {
           this.where.appType = '';
         }
         this.$emit('search', this.where);
       },
       /*  重置 */
-      reset() {
+      reset () {
         this.where = { ...this.defaultWhere };
         this.search();
       }

+ 64 - 90
src/views/material/product/index.vue

@@ -1,82 +1,51 @@
 <template>
   <div class="ele-body">
     <el-card shadow="never">
-      <DictDataSearch @search="reload" />
-      <div style="margin: 5px 0; padding-left: 262px">
-        <el-button
-          size="small"
-          type="primary"
-          icon="el-icon-plus"
-          class="ele-btn-icon"
-          @click="openEdit()"
-        >
-          添加
-        </el-button>
-        <!-- <el-button
-          size="small"
-          type="warning"
-          icon="el-icon-edit"
-          class="ele-btn-icon"
-          :disabled="!current"
-          @click="openEdit(current)"
-        >
-          修改
-        </el-button> -->
-        <el-button
-          size="small"
-          type="danger"
-          icon="el-icon-delete"
-          class="ele-btn-icon"
-          :disabled="!current"
-          @click="remove"
-        >
-          删除
-        </el-button>
-      </div>
+      <ProductSearch @search="reload" />
       <ele-split-layout
         width="244px"
         allow-collapse
         :right-style="{ overflow: 'hidden' }"
       >
+        <div class="ele-border-lighter split-layout-right-content">
+          <AssetTree ref="assetTreeRef" id="9" />
+        </div>
         <!-- 表格 -->
-        <ele-pro-table
-          ref="table"
-          :columns="columns"
-          :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>
-        </ele-pro-table>
-
         <template v-slot:content>
-          <!-- 数据字典项列表 -->
-          <dict-data ref="dictData" v-if="current" :dict-id="current.id" />
+          <ele-pro-table
+            ref="table"
+            :columns="columns"
+            :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>
+          </ele-pro-table>
         </template>
       </ele-split-layout>
     </el-card>
-    <!-- 编辑弹窗 -->
-    <dict-edit :visible.sync="showEdit" @done="reload" />
   </div>
 </template>
 
 <script>
-  import DictData from './components/dict-data.vue';
-  import DictEdit from './components/dict-edit.vue';
-  import DictDataSearch from './components/dict-data-search.vue';
+  import AssetTree from '@/components/AssetTree';
+  import ProductSearch from './components/product-search.vue';
   import { listDictionaries, removeDictionary } from '@/api/system/dictionary';
 
   export default {
     name: 'SystemDictionary',
-    components: { DictData, DictEdit, DictDataSearch },
-    data() {
+    components: { AssetTree, ProductSearch },
+    data () {
       return {
         // 表格列配置
         columns: [
@@ -89,8 +58,38 @@
           },
           {
             prop: 'name',
-            label: '字典名称',
+            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: '操作'
           }
         ],
         // 当前编辑数据
@@ -104,28 +103,28 @@
 
     methods: {
       /* 表格数据源 */
-      datasource() {
+      datasource () {
         // return;
         return listDictionaries();
       },
       /* 表格渲染完成回调 */
-      done(res) {
+      done (res) {
         if (res.data?.length) {
           this.$refs.table.setCurrentRow(res.data[0]);
         }
       },
       /* 刷新表格 */
-      reload(where) {
+      reload (where) {
         this.$refs.table.reload();
         this.$refs.dictData.reload(where);
       },
       /* 显示编辑 */
-      openEdit(row) {
+      openEdit (row) {
         this.editData = row;
         this.showEdit = true;
       },
       /* 删除 */
-      remove() {
+      remove () {
         this.$confirm('确定要删除选中的字典吗?', '提示', {
           type: 'warning'
         })
@@ -157,29 +156,4 @@
   };
 </script>
 
-<style lang="scss" scoped>
-  .dict-table {
-    :deep(.el-table__row) {
-      cursor: pointer;
-    }
-
-    :deep(.el-table__row > td:last-child:after) {
-      content: '\e6e0';
-      font-family: element-icons !important;
-      font-style: normal;
-      font-variant: normal;
-      text-transform: none;
-      -webkit-font-smoothing: antialiased;
-      -moz-osx-font-smoothing: grayscale;
-      line-height: 1;
-      position: absolute;
-      right: 10px;
-      top: 50%;
-      margin-top: -7px;
-    }
-
-    :deep(.el-table__row > td:last-child .cell) {
-      padding-right: 20px;
-    }
-  }
-</style>
+<style lang="scss" scoped></style>

+ 78 - 0
src/views/material/productLinkMaterial/components/link-material-dialog.vue

@@ -0,0 +1,78 @@
+<template>
+  <el-dialog :visible.sync="visible" title="">
+    <el-row :gutter="20">
+      <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
+            >
+          </template>
+        </headerTitle>
+        <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="columns"
+          :datasource="[]"
+          height="calc(100vh - 350px)"
+          :need-page="false"
+        >
+        </ele-pro-table>
+      </el-col>
+      <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
+            ></template
+          ></headerTitle
+        ></el-col
+      >
+    </el-row>
+  </el-dialog>
+</template>
+
+<script>
+  export default {
+    data () {
+      return {
+        visible: true,
+        columns: []
+      };
+    },
+    methods: {
+      open (type, row) {
+        switch (type) {
+          case value:
+            break;
+
+          default:
+            break;
+        }
+      }
+    }
+  };
+</script>

+ 95 - 0
src/views/material/productLinkMaterial/components/product-search.vue

@@ -0,0 +1,95 @@
+<!-- 搜索表单 -->
+<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: 5 } : { span: 4 }">
+        <el-form-item label="产品编码">
+          <el-input clearable v-model="where.code" 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-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-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-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { md: 4 } : { span: 4 }">
+        <el-form-item>
+          <el-button
+            type="primary"
+            icon="el-icon-search"
+            class="ele-btn-icon"
+            @click="search"
+          >
+            查询
+          </el-button>
+
+          <el-button
+            @click="reset"
+            icon="el-icon-refresh"
+            class="ele-btn-icon"
+            size="medium"
+            >重置</el-button
+          >
+        </el-form-item>
+      </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>

+ 171 - 0
src/views/material/productLinkMaterial/index.vue

@@ -0,0 +1,171 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never">
+      <ProductSearch @search="reload" />
+      <ele-split-layout
+        width="244px"
+        allow-collapse
+        :right-style="{ overflow: 'hidden' }"
+      >
+        <div class="ele-border-lighter split-layout-right-content">
+          <AssetTree ref="assetTreeRef" id="9" />
+        </div>
+        <!-- 表格 -->
+        <template v-slot:content>
+          <ele-pro-table
+            ref="table"
+            :columns="columns"
+            :datasource="datasource"
+            height="calc(100vh - 350px)"
+            :need-page="false"
+            :current.sync="current"
+            highlight-current-row
+            class="dict-table"
+            tool-class="ele-toolbar-actions"
+          >
+            <!-- 表头工具栏 -->
+            <template v-slot:toolbar>
+              <el-button type="primary" @click="handleLink(1)"
+                >关联设备</el-button
+              >
+              <el-button type="primary" @click="handleLink(2)"
+                >关联模具</el-button
+              >
+              <el-button type="primary" @click="handleLink(3)"
+                >关联舟皿</el-button
+              >
+            </template>
+            <template v-slot:action>
+              <el-link>编辑</el-link>
+            </template>
+          </ele-pro-table>
+        </template>
+      </ele-split-layout>
+    </el-card>
+    <linkMaterialDialog ref="linkMaterialDialogRef" />
+  </div>
+</template>
+
+<script>
+  import AssetTree from '@/components/AssetTree';
+  import ProductSearch from './components/product-search.vue';
+  import linkMaterialDialog from './components/link-material-dialog.vue';
+  import { listDictionaries, removeDictionary } from '@/api/system/dictionary';
+
+  export default {
+    name: 'SystemDictionary',
+    components: { AssetTree, ProductSearch, linkMaterialDialog },
+    data () {
+      return {
+        // 表格列配置
+        columns: [
+          {
+            columnKey: 'index',
+            type: 'index',
+            width: 45,
+            align: 'center',
+            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: '操作'
+          }
+        ],
+        // 当前编辑数据
+        current: null,
+        // 是否显示编辑弹窗
+        showEdit: false,
+        // 编辑回显数据
+        editData: null
+      };
+    },
+
+    methods: {
+      /* 表格数据源 */
+      datasource () {
+        // return;
+        return listDictionaries();
+      },
+      handleLink (type) {
+        console.log(this.current, 'handleLink');
+        if (!this.current) {
+          return this.$message.error('请选择产品!');
+        }
+
+        this.$refs.linkMaterialDialogRef.open(type, this.current);
+      },
+      /* 刷新表格 */
+      reload (where) {
+        this.$refs.table.reload();
+        this.$refs.dictData.reload(where);
+      },
+      /* 显示编辑 */
+      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(() => {});
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped></style>

+ 17 - 0
src/views/test/index.vue

@@ -0,0 +1,17 @@
+<template>
+  <div>
+    <fileUpload v-model="imgList" module="file" :limit="2"></fileUpload>
+    {{ imgList }}
+  </div>
+</template>
+<script>
+  import fileUpload from '@/components/upload/fileUpload';
+  export default {
+    components: { fileUpload },
+    data () {
+      return {
+        imgList: []
+      };
+    }
+  };
+</script>

+ 1 - 1
vue.config.js

@@ -33,7 +33,7 @@ module.exports = {
       '/api': {
         // target: 'http://192.168.3.51:18086', // 测试
         // target: 'http://192.168.3.35:8080', // kang杨威
-        // target: 'http://192.168.3.25:8080', // 黄峥嵘
+        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.64:8080', // 粟勋