Bladeren bron

Merge remote-tracking branch 'origin/master'

001295 2 jaren geleden
bovenliggende
commit
dfae60a8a6

+ 3 - 1
src/components/PopDialog/organization.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <el-dialog
-      title="采购组织选择"
+      :title="type == '1' ? '采购组织选择' : '业务部门选择'"
       width="500px"
       :close-on-click-modal="false"
       :append-to-body="true"
@@ -61,6 +61,7 @@ export default {
     return {
       loading: false,
       visible: false,
+      type: '1',
       filterText: '',
       threedata: [],
       defaultProps: {
@@ -84,6 +85,7 @@ export default {
       this.visible = true;
       this.$nextTick(() => {
         console.log('接收参数了吗', val)
+        this.type = val
         this.refreshList(val)
       });
     },

+ 3 - 2
src/layout/components/AppMain.vue

@@ -11,16 +11,17 @@
 
 <script>
 import iframeToggle from "./IframeToggle/index"
+import keepAlive from './KeepAlive'
 
 export default {
   name: 'AppMain',
-  components: { iframeToggle },
+  components: { iframeToggle, keepAlive },
   computed: {
     cachedViews() {
       return this.$store.state.tagsView.cachedViews
     },
     key() {
-      return this.$route.path
+      return this.$route.fullPath
     }
   }
 }

+ 186 - 0
src/layout/components/KeepAlive/index.js

@@ -0,0 +1,186 @@
+/**
+ * 验证数据类型是否是正则
+ * @param v
+ * @returns {boolean}
+ */
+function isRegExp (v) {
+  return Object.prototype.toString.call(v) === '[object RegExp]'
+}
+
+/**
+ * 移除数组中指定的项
+ * @param arr
+ * @param item
+ * @returns {*|{}|number|Array|*[]|[]|T[]}
+ */
+export function remove (arr, item) {
+  if (arr.length) {
+    const index = arr.indexOf(item)
+    if (index > -1) {
+      return arr.splice(index, 1)
+    }
+  }
+}
+
+/**
+ * 判断数据是否定义了
+ * @param v
+ * @returns {boolean}
+ */
+function isDef (v) {
+  return v !== undefined && v !== null
+}
+
+function isAsyncPlaceholder (node) {
+  return node.isComment && node.asyncFactory
+}
+
+/**
+ * 获取KeepAlive下的第一个子组件
+ * @param children
+ * @returns {*}
+ */
+function getFirstComponentChild (children) {
+  if (Array.isArray(children)) {
+    for (let i = 0; i < children.length; i++) {
+      const c = children[i]
+      if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
+        return c
+      }
+    }
+  }
+}
+
+/**
+ * 匹配缓存的页面组件
+ * @param pattern
+ * @param name
+ * @returns {boolean|*}
+ */
+function matches (pattern, name) {
+  if (Array.isArray(pattern)) {
+    return pattern.indexOf(name) > -1
+  } else if (typeof pattern === 'string') {
+    return pattern.split(',').indexOf(name) > -1
+  } else if (isRegExp(pattern)) {
+    return pattern.test(name)
+  }
+  /* istanbul ignore next */
+  return false
+}
+
+/**
+ * 原先对于没有设置组件name值的,设置为路由的name
+ * 现在我们直接取fullPath为name
+ * @param {*} opts
+ */
+function getComponentName (opts) {
+  // return (opts && opts.Ctor.options.name) || this.$route.name
+  return this.$route.fullPath
+}
+
+/**
+ * 删除缓存
+ * @param keepAliveInstance
+ * @param filter
+ */
+function pruneCache (keepAliveInstance, filter) {
+  const { cache, keys, _vnode } = keepAliveInstance
+  Object.keys(cache).forEach(key => {
+    const cachedNode = cache[key]
+    if (cachedNode) {
+      if (key && !filter(key)) {
+        pruneCacheEntry(cache, key, keys, _vnode)
+      }
+    }
+  })
+}
+
+/**
+ * 删除缓存条目
+ * @param cache
+ * @param key
+ * @param keys
+ * @param current
+ */
+function pruneCacheEntry (cache, key, keys, current) {
+  const cached = cache[key]
+  if (cached && (!current || cached.tag !== current.tag)) {
+    cached.componentInstance.$destroy()
+  }
+  cache[key] = null
+  remove(keys, key)
+}
+
+const patternTypes = [String, RegExp, Array]
+
+export default {
+  name: 'KeepAlive',
+  // abstract: true,
+  props: {
+    include: patternTypes,
+    exclude: patternTypes,
+    max: [String, Number]
+  },
+
+  created () {
+    // Object.create(null)创建一个非常干净且高度可定制的对象
+    // 新创建的对象除了自身属性外,原型链上没有任何属性,也就是说没有继承Object的任何东西
+    this.cache = Object.create(null)
+    this.keys = []
+  },
+
+  mounted () {
+    this.$watch('include', val => {
+      pruneCache(this, name => matches(val, name))
+    })
+    this.$watch('exclude', val => {
+      pruneCache(this, name => !matches(val, name))
+    })
+  },
+
+  destroyed () {
+    Object.keys(this.cache).forEach(key => {
+      pruneCacheEntry(this.cache, key, this.keys)
+    })
+  },
+
+  render () {
+    const slot = this.$slots.default
+    const vnode = getFirstComponentChild(slot)
+    const componentOptions = vnode && vnode.componentOptions
+    if (componentOptions) {
+      // 获取组件的名称,此处修改后取fullPath作为name
+      const key = getComponentName.call(this, componentOptions)
+
+      const { include, exclude } = this
+      // 没有缓存的直接返回vnode
+      if (
+        // not included
+        (include && (!key || !matches(include, key))) ||
+        // excluded
+        (exclude && key && matches(exclude, key))
+      ) {
+        return vnode
+      }
+
+      const { cache, keys } = this
+      if (cache[key]) {
+        // 取缓存中的实例作为vnode的实例
+        vnode.componentInstance = cache[key].componentInstance
+        // 将当前缓存的key设置为最新的,便于后面缓存的数量超了以后删除最老的
+        remove(keys, key)
+        keys.push(key)
+      } else {
+        cache[key] = vnode
+        keys.push(key)
+        // 移除最老的缓存
+        if (this.max && keys.length > parseInt(this.max)) {
+          pruneCacheEntry(cache, keys[0], keys, this._vnode)
+        }
+      }
+      vnode.data.keepAlive = true
+    }
+    return vnode || (slot && slot[0])
+  }
+}

+ 9 - 9
src/layout/components/TagsView/index.vue

@@ -4,9 +4,9 @@
       <router-link
         v-for="tag in visitedViews"
         ref="tag"
-        :key="tag.path"
+        :key="tag.fullPath"
         :class="isActive(tag)?'active':''"
-        :to="{ path: tag.path, query: tag.query, fullPath: tag.fullPath }"
+        :to="{ path: tag.fullPath, query: tag.query, fullPath: tag.fullPath }"
         tag="span"
         class="tags-view-item"
         :style="activeStyle(tag)"
@@ -73,7 +73,7 @@ export default {
   },
   methods: {
     isActive(route) {
-      return route.path === this.$route.path
+      return route.fullPath === this.$route.fullPath
     },
     activeStyle(tag) {
       if (!this.isActive(tag)) return {};
@@ -105,14 +105,14 @@ export default {
         if (route.meta && route.meta.affix) {
           const tagPath = path.resolve(basePath, route.path)
           tags.push({
-            fullPath: tagPath,
+            fullPath: route.fullPath,
             path: tagPath,
             name: route.name,
             meta: { ...route.meta }
           })
         }
         if (route.children) {
-          const tempTags = this.filterAffixTags(route.children, route.path)
+          const tempTags = this.filterAffixTags(route.children, route.fullPath)
           if (tempTags.length >= 1) {
             tags = [...tags, ...tempTags]
           }
@@ -124,9 +124,9 @@ export default {
       const affixTags = this.affixTags = this.filterAffixTags(this.routes)
       for (const tag of affixTags) {
         // Must have tag name
-        if (tag.name) {
+        // if (tag.name) {
           this.$store.dispatch('tagsView/addVisitedView', tag)
-        }
+        // }
       }
     },
     addTags() {
@@ -143,7 +143,7 @@ export default {
       const tags = this.$refs.tag
       this.$nextTick(() => {
         for (const tag of tags) {
-          if (tag.to.path === this.$route.path) {
+          if (tag.to.fullPath  === this.$route.fullPath ) {
             this.$refs.scrollPane.moveToTarget(tag)
             // when query is different then update
             if (tag.to.fullPath !== this.$route.fullPath) {
@@ -189,7 +189,7 @@ export default {
     },
     closeAllTags(view) {
       this.$tab.closeAllPage().then(({ visitedViews }) => {
-        if (this.affixTags.some(tag => tag.path === this.$route.path)) {
+        if (this.affixTags.some(tag => tag.fullPath === this.$route.fullPath)) {
           return
         }
         this.toLastView(visitedViews, view)

+ 18 - 18
src/store/modules/tagsView.js

@@ -6,7 +6,7 @@ const state = {
 
 const mutations = {
   ADD_IFRAME_VIEW: (state, view) => {
-    if (state.iframeViews.some(v => v.path === view.path)) return
+    if (state.iframeViews.some(v => v.fullPath === view.fullPath)) return
     state.iframeViews.push(
       Object.assign({}, view, {
         title: view.meta.title || 'no-name'
@@ -14,7 +14,7 @@ const mutations = {
     )
   },
   ADD_VISITED_VIEW: (state, view) => {
-    if (state.visitedViews.some(v => v.path === view.path)) return
+    if (!view.fullPath || state.visitedViews.some(v => v.fullPath === view.fullPath)) return
     state.visitedViews.push(
       Object.assign({}, view, {
         title: view.meta.title || 'no-name'
@@ -22,36 +22,36 @@ const mutations = {
     )
   },
   ADD_CACHED_VIEW: (state, view) => {
-    if (state.cachedViews.includes(view.name)) return
+    if (state.cachedViews.includes(view.fullPath)) return
     if (view.meta && !view.meta.noCache) {
-      state.cachedViews.push(view.name)
+      state.cachedViews.push(view.fullPath)
     }
   },
   DEL_VISITED_VIEW: (state, view) => {
     for (const [i, v] of state.visitedViews.entries()) {
-      if (v.path === view.path) {
+      if (v.fullPath === view.fullPath) {
         state.visitedViews.splice(i, 1)
         break
       }
     }
-    state.iframeViews = state.iframeViews.filter(item => item.path !== view.path)
+    state.iframeViews = state.iframeViews.filter(item => item.fullPath !== view.fullPath)
   },
   DEL_IFRAME_VIEW: (state, view) => {
-    state.iframeViews = state.iframeViews.filter(item => item.path !== view.path)
+    state.iframeViews = state.iframeViews.filter(item => item.fullPath !== view.fullPath)
   },
   DEL_CACHED_VIEW: (state, view) => {
-    const index = state.cachedViews.indexOf(view.name)
+    const index = state.cachedViews.indexOf(view.fullPath)
     index > -1 && state.cachedViews.splice(index, 1)
   },
 
   DEL_OTHERS_VISITED_VIEWS: (state, view) => {
     state.visitedViews = state.visitedViews.filter(v => {
-      return v.meta.affix || v.path === view.path
+      return v.meta.affix || v.fullPath === view.fullPath
     })
-    state.iframeViews = state.iframeViews.filter(item => item.path === view.path)
+    state.iframeViews = state.iframeViews.filter(item => item.fullPath === view.fullPath)
   },
   DEL_OTHERS_CACHED_VIEWS: (state, view) => {
-    const index = state.cachedViews.indexOf(view.name)
+    const index = state.cachedViews.indexOf(view.fullPath)
     if (index > -1) {
       state.cachedViews = state.cachedViews.slice(index, index + 1)
     } else {
@@ -69,14 +69,14 @@ const mutations = {
   },
   UPDATE_VISITED_VIEW: (state, view) => {
     for (let v of state.visitedViews) {
-      if (v.path === view.path) {
+      if (v.fullPath === view.fullPath) {
         v = Object.assign(v, view)
         break
       }
     }
   },
   DEL_RIGHT_VIEWS: (state, view) => {
-    const index = state.visitedViews.findIndex(v => v.path === view.path)
+    const index = state.visitedViews.findIndex(v => v.fullPath === view.fullPath)
     if (index === -1) {
       return
     }
@@ -84,19 +84,19 @@ const mutations = {
       if (idx <= index || (item.meta && item.meta.affix)) {
         return true
       }
-      const i = state.cachedViews.indexOf(item.name)
+      const i = state.cachedViews.indexOf(item.fullPath)
       if (i > -1) {
         state.cachedViews.splice(i, 1)
       }
       if(item.meta.link) {
-        const fi = state.iframeViews.findIndex(v => v.path === item.path)
+        const fi = state.iframeViews.findIndex(v => v.fullPath === item.fullPath)
         state.iframeViews.splice(fi, 1)
       }
       return false
     })
   },
   DEL_LEFT_VIEWS: (state, view) => {
-    const index = state.visitedViews.findIndex(v => v.path === view.path)
+    const index = state.visitedViews.findIndex(v => v.fullPath === view.fullPath)
     if (index === -1) {
       return
     }
@@ -104,12 +104,12 @@ const mutations = {
       if (idx >= index || (item.meta && item.meta.affix)) {
         return true
       }
-      const i = state.cachedViews.indexOf(item.name)
+      const i = state.cachedViews.indexOf(item.fullPath)
       if (i > -1) {
         state.cachedViews.splice(i, 1)
       }
       if(item.meta.link) {
-        const fi = state.iframeViews.findIndex(v => v.path === item.path)
+        const fi = state.iframeViews.findIndex(v => v.fullPath === item.fullPath)
         state.iframeViews.splice(fi, 1)
       }
       return false

+ 43 - 24
src/views/material/basicFile/details.vue

@@ -29,7 +29,7 @@
               </el-dropdown-menu>
             </el-dropdown>
 
-                                                                                                                                                                                                                                                                                                                                                                                                                                                          <el-button size="small" @click="handleQuery">查询</el-button> -->
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  <el-button size="small" @click="handleQuery">查询</el-button> -->
             <el-button size="small" @click="handleRefresh">刷新</el-button>
 
           </el-button-group>
@@ -39,7 +39,7 @@
         <el-col :span="1.5">
           <el-button-group>
             <el-button size="small" @click="handleMaterialType">维护物料类别</el-button>
-            <el-button size="small" @click="handleIsInvoke" :key="count">
+            <el-button size="small" @click="handleIsInvoke" :key="count" v-hasPermi="['system:material:add']">
               <!-- 0:启用  2:停用 -->
               {{ basicData.value.isEnable == '已启用' ? '停用' : '启用' }}
             </el-button>
@@ -48,7 +48,7 @@
               <el-dropdown-menu slot="dropdown">
                 <el-dropdown-item :command="isInvoke(true)">启用</el-dropdown-item>
                 <el-dropdown-item :command="isInvoke(false)">停用</el-dropdown-item>
-                                                                                                                                        </el-dropdown-menu></el-dropdown> -->
+                                                                                                                                                                </el-dropdown-menu></el-dropdown> -->
           </el-button-group>
         </el-col>
 
@@ -57,7 +57,7 @@
           <el-button-group>
             <el-button size="small" @click="handleQueryForm">申请单查询</el-button>
           </el-button-group>
-                                                                                                                                                                                                                                                                                                                                                                                                                                                  </el-col> -->
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                          </el-col> -->
 
         <!-- 导入导出 -->
       <!-- <el-col :span="1.5">
@@ -65,7 +65,7 @@
             <el-button size="small" @click="handleImport">批量导入</el-button>
             <el-button size="small" @click="handleExport">批量导出</el-button>
           </el-button-group>
-                                                                                                                                                                                                                                                                                                                                                                                                                                                    </el-col> -->
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </el-col> -->
 
       </el-row>
 
@@ -73,7 +73,7 @@
       <el-row :gutter="10" class="mb10" v-else>
         <el-col :span="1.5">
           <el-button-group>
-            <el-button size="small" @click="handleSave">保存</el-button>
+            <el-button size="small" @click="handleSave" v-hasPermi="['system:material:add']">保存</el-button>
             <!-- <el-button size="small" @click="handleSaveAdd" :disabled="true">保存新增</el-button> -->
             <!-- <el-button size="small" @click="handleUpdateImport">更新导入</el-button> -->
           </el-button-group>
@@ -111,7 +111,7 @@
           <!-- 附件管理 -->
         <!-- <el-button-group>
             <el-button size="small" icon="el-icon-paperclip" @click="handleFile"></el-button>
-                                                                                                                                                                                                                                                                                                                                                                                                                                                  </el-button-group> -->
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                          </el-button-group> -->
 
           <!-- 切换 -->
         <!-- <el-button-group>
@@ -123,7 +123,7 @@
               @click="handleChangePage('next')" />
             <el-button size="small" icon="el-icon-d-arrow-right" :disabled="!handleBasicEdit"
               @click="handleChangePage('end')" />
-                                                                                                                                                                                                                                                                                                                                                                                                                                                  </el-button-group> -->
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                          </el-button-group> -->
         </el-col>
       </el-row>
 
@@ -284,7 +284,7 @@
                                 @focus="m.apiUrl && handleQueryMore(m, '', { name: 'medcineData', prop: m.prop })">
 
                               <!-- <el-option v-if="m.dictId" v-for="d in m.dictValue" :key="d.dictValue"
-                                                                                                                                                                                                                                                                :label="d.dictLabel" :value="d.dictValue"></el-option> -->
+                                                                                                                                                                                                                                                                                        :label="d.dictLabel" :value="d.dictValue"></el-option> -->
 
                                 <div slot="empty"></div>
                               </el-select>
@@ -402,7 +402,8 @@
             <el-button size="small" :disabled="!materialType.isEdit" @click="handleMaterialTypeRow('del')">删行</el-button>
           </el-button-group>
           <el-button-group>
-            <el-button size="small" @click="handleMaterialTypeRow('edit')">{{ materialType.isEdit
+            <el-button size="small" @click="handleMaterialTypeRow('edit')" v-hasPermi="['system:material:add']">{{
+              materialType.isEdit
               ? '保存' : '修改' }}</el-button>
             <el-button size="small" v-if="materialType.isEdit" @click="handleMaterialTypeRow('cancal')">取消</el-button>
             <el-button size="small" @click="handleMaterialTypeRow">刷新</el-button>
@@ -436,7 +437,7 @@
               <el-option v-if="mt.dictId" v-for="d in mt.dictId" :key="d.dictValue" :label="d.dictLabel"
                 :value="d.dictValue">
               </el-option>
-                                                                                                                                                                                                                                                                                  </el-select> -->
+                                                                                                                                                                                                                                                                                                          </el-select> -->
 
             <!-- 其他类型 -->
 
@@ -488,7 +489,7 @@
           <el-collapse-item title="物料基本信息" name="basic">
             <el-form :inline="true" label-position="right" :model="basicData.value">
             <!-- <el-form-item label="所属组织">
-                                                                                                                                                                                                                                                                                                                                          <el-input v-model="basicData.value.orgName" placeholder="所属组织"></el-input></el-form-item> -->
+                                                                                                                                                                                                                                                                                                                                                                  <el-input v-model="basicData.value.orgName" placeholder="所属组织"></el-input></el-form-item> -->
               <el-form-item label="物料编码">
                 <el-input v-model="basicData.value.code" size="small" readonly placeholder="物料编码"></el-input>
               </el-form-item>
@@ -499,7 +500,7 @@
                 <el-input v-model="basicData.value.enName" size="small" readonly placeholder="英文名称"></el-input>
               </el-form-item>
             <!-- <el-form-item label="版本号">
-                                                                                                                                                                                                                                                                                                                                        <el-input v-model="basicData.value.version"  placeholder="版本号"></el-input></el-form-item> -->
+                                                                                                                                                                                                                                                                                                                                                                <el-input v-model="basicData.value.version"  placeholder="版本号"></el-input></el-form-item> -->
 
             </el-form>
           </el-collapse-item>
@@ -1560,11 +1561,12 @@ export default {
           break;
         // 保存、修改
         case 'edit':
+
           if (_this.materialType.isEdit) {
             // 编辑状态
             let nullList = _this.materialType.value.filter(m => (!m.drugId || m.drugId == ''));
             console.log(nullList, 'nullList');
-            if (!nullList.length) {
+            if (!nullList.length && _this.materialType.value.length) {
               console.log('物料类别保存', _this.materialType.value);
               let params = {
                 materialId: _this.materialId,
@@ -1580,7 +1582,7 @@ export default {
               // 保存
             } else {
               this.$message({
-                message: '存在数据为空!',
+                message: '不能保存空数据或存在数据为空!',
                 type: 'warning'
               });
             }
@@ -1728,8 +1730,12 @@ export default {
     },
     // 参照弹窗确认
     handleConfirmRefer() {
+
+      let _this = this;
       console.log('确认参照弹窗', `{this.${this.MoreDataDialog.target.name}:${this.MoreDataDialog.value.id}}`);
 
+      let confirm = true;
+
       if (this.MoreDataDialog.target.name == 'basicData') {
         //  基本信息
         this.basicData.value[this.MoreDataDialog.target.prop] = this.MoreDataDialog.value.id;
@@ -1777,22 +1783,35 @@ export default {
         console.log('确认时选择的数据', this.MoreDataDialog.value);
 
         this.materialType.value = this.materialType.value.map(m => {
-          if ((m.id && m.id != '' && m.id == this.MoreDataDialog.target.prop['id']) ||
-            (m.insertId && m.insertId == this.MoreDataDialog.target.prop['insertId'])
+          if ((m.id && m.id != '' && m.id == _this.MoreDataDialog.target.prop['id']) ||
+            (m.insertId && m.insertId == _this.MoreDataDialog.target.prop['insertId'])
           ) {
-            m.drugId = this.MoreDataDialog.value['id'];
-            m.drugCode = this.MoreDataDialog.value['code'];
-            m.drugName = this.MoreDataDialog.value['name'];
+            let drug = _this.materialType.value.filter(d => d.drugId == _this.MoreDataDialog.value['id'])
+            console.log(drug, 'drug------------------------------------');
+            if (drug.length) {
+              _this.$message({
+                message: '不能维护相同的物料类别!',
+                type: 'warning'
+              });
+              confirm = false;
+            } else {
+              m.drugId = _this.MoreDataDialog.value['id'];
+              m.drugCode = _this.MoreDataDialog.value['code'];
+              m.drugName = _this.MoreDataDialog.value['name'];
+            }
           }
-          console.log(m, '物料维护列表中每一项的值');
           return m;
         })
 
         console.log(this.materialType.value, '修改之后-----this.materialType.value');
       }
-      this.count++;
-      this.MoreDataDialog.show = false;
-      this.MoreDataDialog.key = '';
+
+      if (confirm) {
+
+        this.count++;
+        this.MoreDataDialog.show = false;
+        this.MoreDataDialog.key = '';
+      }
     },
     // 取消-关闭参照弹窗
     handleConcalRefer() {

+ 30 - 7
src/views/material/basicFile/index.vue

@@ -26,7 +26,7 @@
               <el-dropdown-item :command="filterCondition('stop')">显示停用</el-dropdown-item>
               <el-dropdown-item :command="filterCondition('allot')">显示已分配</el-dropdown-item>
             </el-dropdown-menu>
-                                                                                                                                                </el-dropdown> -->
+                            </el-dropdown> -->
 
           <!-- <el-button size="small" @click="handleQuery">查询</el-button> -->
           <el-button size="small" @click="handleRefresh">刷新</el-button>
@@ -37,7 +37,8 @@
       <!-- 启用 -->
     <!-- <el-col :span="1.5">
         <el-button-group>
-          <el-dropdown split-button size="small" @click="handleIsInvoke(true)" @command="handleIsInvoke">
+          <el-dropdown :disabled="checkedList.length != 1 && handleJudgeIsUsing" split-button size="small"
+            @click="handleIsInvoke(true)" @command="handleIsInvoke">
             启用
             <el-dropdown-menu slot="dropdown">
               <el-dropdown-item :command="isInvoke(true)">启用</el-dropdown-item>
@@ -45,14 +46,14 @@
             </el-dropdown-menu>
           </el-dropdown>
         </el-button-group>
-                                                                                                                                            </el-col> -->
+                        </el-col> -->
 
       <!-- 申请单查询 -->
     <!-- <el-col :span="1.5">
         <el-button-group>
           <el-button size="small" @click="handleQueryForm">申请单查询</el-button>
         </el-button-group>
-                                                                                                                                            </el-col> -->
+                                                                                                                                                                                    </el-col> -->
 
       <!-- 导入导出 -->
       <el-col :span="1.5">
@@ -71,6 +72,13 @@
           <el-form-item label="物料名称">
             <el-input size="small" v-model="queryForm.name" placeholder="物料名称" clearable></el-input>
           </el-form-item>
+          <el-form-item label="启用状态">
+            <!-- 0=已启用,2=已停用 -->
+            <el-select size="small" v-model="queryForm.isEnable" placeholder="请选择" clearable>
+              <el-option key="0" label="已启用" value="0"></el-option>
+              <el-option key="2" label="已停用" value="2"></el-option>
+            </el-select>
+          </el-form-item>
 
           <el-form-item>
             <el-button size="small" type="primary" @click="handleQuery">查询</el-button>
@@ -84,7 +92,7 @@
     <!-- 主体列表 -->
     <el-card class="material-list" v-loading="loading">
       <el-table :data="taskList" @cell-dblclick="handledbClick" @selection-change="handleSelectionChange">
-        <el-table-column type="selection" width="20" />
+        <el-table-column type="selection" width="30" />
         <el-table-column type="index" label="序号" width="55" align="center" />
         <el-table-column width="150" v-for="h in  tableHeader" v-if="h.show" :label="h.name" align="center"
           show-overflow-tooltip>
@@ -149,7 +157,8 @@ export default {
       // 查询表单字段
       queryForm: {
         name: '',
-        code: ''
+        code: '',
+        isEnable: '',
       },
       // 总条数
       total: 1,
@@ -170,7 +179,7 @@ export default {
       // 多选数组
       checkedList: [],
       // 列表选中数据
-      checkedList: [],
+      // checkedList: [],
       // 操作弹窗
       optionDialog: {
         show: false,
@@ -180,6 +189,11 @@ export default {
   },
 
   methods: {
+    // 判读是否启用
+    handleJudgeIsUsing() {
+
+      return this.checkedList[0] && this.checkedList[0].isEnable == '已启用';
+    },
     // 改变分页大小
     handleSizeChange(e) {
       this.queryParams.pageSize = e;
@@ -507,4 +521,13 @@ export default {
 .mb-query>>>.el-form-item {
   margin-bottom: 8px;
 }
+
+.mb-query>>>.el-select {
+  width: 90px;
+}
+
+.mb-query>>>.el-scrollbar__wrap {
+  margin-bottom: -18px;
+
+}
 </style>

+ 32 - 26
src/views/material/changeApply/add.vue

@@ -47,27 +47,11 @@
               </el-form-item>
             </el-col>
             <el-col :span="8">
-              <el-form-item label="一级分类" prop="oneClass">
-                <el-input readonly :disabled="disable" v-model="basicForm.oneClass"></el-input>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row :gutter="20">
-            <el-col :span="8">
-              <el-form-item label="二级分类" prop="twoClass">
-                <el-input readonly :disabled="disable" v-model="basicForm.twoClass"></el-input>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="三级分类" prop="threeClass">
-                <el-input readonly :disabled="disable" v-model="basicForm.threeClass"></el-input>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="四级分类" prop="fourClass">
+              <el-form-item label="物料分类" prop="materialClassifyId">
                 <el-input readonly :disabled="disable" v-model="basicForm.fourClass">
                   <el-button :disabled="disable" slot="append" icon="el-icon-more" @click="chooseFourClass"></el-button>
                 </el-input>
+                <el-input v-show="false" readonly :disabled="disable" v-model="basicForm.materialClassifyId"></el-input>
               </el-form-item>
             </el-col>
           </el-row>
@@ -157,6 +141,29 @@
                 <el-input :disabled="disable" v-model="basicForm.remark"></el-input>
               </el-form-item>
             </el-col>
+            <el-col :span="8">
+              <el-form-item label="一级分类" prop="oneClass">
+                <el-input readonly disabled v-model="basicForm.oneClass"></el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row :gutter="20">
+            <el-col :span="8">
+              <el-form-item label="二级分类" prop="twoClass">
+                <el-input readonly disabled v-model="basicForm.twoClass"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="三级分类" prop="threeClass">
+                <el-input readonly disabled v-model="basicForm.threeClass"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="四级分类" prop="fourClass">
+                <el-input readonly disabled v-model="basicForm.fourClass">
+                </el-input>
+              </el-form-item>
+            </el-col>
           </el-row>
         </el-form>
       </el-tab-pane>
@@ -410,6 +417,7 @@ export default {
         materialId:'',
         materialCode: '',
         materialName: '',
+        materialClassifyId: '',
         medicineMaterial: '2',
         oneClass: '',
         twoClass: '',
@@ -443,22 +451,19 @@ export default {
         label: '否'
       }],
       statusOptions: [{
-        value: 0, label: '未提交'
+        value: '0', label: '未提交'
       },{
-        value: 1, label: '审批中'
+        value: '1', label: '审批中'
       },{
-        value: 2, label: '已完成'
+        value: '2', label: '已完成'
       },{
-        value: 3, label: '已驳回'
+        value: '3', label: '已驳回'
       },],
       basicRules: {
         materialCode: [{  required: true, message: '请选择物料编码', trigger: 'blur' }],
         materialName: [{required: true, message: '请填写物料名称', trigger: 'blur'}],
-        oneClass: [{required: true, message: '请填写一级分类', trigger: 'blur'}],
-        twoClass: [{required: true, message: '请填写二级分类', trigger: 'blur'}],
-        threeClass: [{required: true, message: '请填写三级分类', trigger: 'blur'}],
-        fourClass: [{required: true, message: '请选择四级分类', trigger: 'blur'}],
         specification: [{required: true, message: '请填写规格', trigger: 'blur'}],
+        materialClassifyId: [{required: true, message: '请选择物料分类', trigger: 'blur'}],
         model: [{required: true, message: '请填写型号', trigger: 'blur'}],
         factory: [{required: true, message: '请选择生产厂家/代理人', trigger: 'blur'}],
         registrant: [{required: true, message: '请填写注册人/上市许可持有人', trigger: 'blur'}],
@@ -727,6 +732,7 @@ export default {
     // 选择四级分类
     acceptFourClass(selections) {
       console.log('收到的四级分类',selections)
+      this.basicForm.materialClassifyId = selections.id
       this.getTreeDetails(selections.id)
     },
     // 四级分类显示列表

+ 4 - 4
src/views/material/changeApply/index.vue

@@ -208,13 +208,13 @@ export default {
     },
     // 表格内状态栏判断值
     statusJug(row) {
-      if (row.status === 0) {
+      if (row.status == 0) {
         return '未提交'
-      } else if (row.status === 1) {
+      } else if (row.status == 1) {
         return '审批中'
-      } else if (row.status === 2) {
+      } else if (row.status == 2) {
         return '已完成'
-      } else if (row.status === 3) {
+      } else if (row.status == 3) {
         return '已驳回'
       }
     },

+ 6 - 1
src/views/material/requisition/add.vue

@@ -1693,7 +1693,12 @@ export default {
       sleObj.drugId = selections.id
       sleObj.drugCode = selections.code
       sleObj.drugName = selections.name
-      this.sysMaterialMedcineItemApply.push(sleObj)
+      // 便利表格内数据
+      if (this.sysMaterialMedcineItemApply.some(item => item.drugId == sleObj.drugId)) {
+        this.$modal.msgWarning("请勿选择重复物料")
+      } else {
+        this.sysMaterialMedcineItemApply.push(sleObj)
+      }
     },
     // 医药类别子表的显示列表
     chooseDrug () {

+ 4 - 4
src/views/material/requisition/index.vue

@@ -191,13 +191,13 @@ export default {
     },
     // 表格内状态栏判断值
     statusJug(row) {
-      if (row.status === 0) {
+      if (row.status == 0) {
         return '未提交'
-      } else if (row.status === 1) {
+      } else if (row.status == 1) {
         return '审批中'
-      } else if (row.status === 2) {
+      } else if (row.status == 2) {
         return '已完成'
-      } else if (row.status === 3) {
+      } else if (row.status == 3) {
         return '已驳回'
       }
     },

+ 2 - 2
src/views/material/specialAttr/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="specialAttr">
-    <el-row :gutter="10" class="mb10">
+    <!-- <el-row :gutter="10" class="mb10">
       <el-col :span="1.5">
 
         <el-select size="small" v-model="textValue" placeholder="请选择">
@@ -41,7 +41,7 @@
         <el-button type="primary" size="small" plain>重置</el-button>
       </el-col>
 
-    </el-row>
+    </el-row> -->
 
     <el-card>
       <el-row :gutter="10" class="content">

+ 139 - 7
src/views/monitor/job/index.vue

@@ -88,6 +88,17 @@
           v-hasPermi="['monitor:job:query']"
         >日志</el-button>
       </el-col>
+
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-s-operation"
+          size="mini"
+          @click="handleJobReport"
+          v-hasPermi="['monitor:job:query']"
+        >报表</el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -137,6 +148,9 @@
                 v-hasPermi="['monitor:job:query']">任务详细</el-dropdown-item>
               <el-dropdown-item command="handleJobLog" icon="el-icon-s-operation"
                 v-hasPermi="['monitor:job:query']">调度日志</el-dropdown-item>
+
+              <el-dropdown-item command="handleJobReport" icon="el-icon-s-operation"
+                                v-hasPermi="['monitor:job:query']">调度报表</el-dropdown-item>
             </el-dropdown-menu>
           </el-dropdown>
         </template>
@@ -161,6 +175,24 @@
             </el-form-item>
           </el-col>
           <el-col :span="12">
+            <el-form-item label="员工工号" prop="empno">
+              <el-input v-model="form.empno" placeholder="请输入员工工号" />
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="12">
+            <el-form-item label="任务内容" prop="cont" >
+              <el-input v-model="form.cont" placeholder="请输入任务内容" />
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="12">
+            <el-form-item label="超时时间" prop="timeout" >
+              <el-input v-model="form.timeout" placeholder="请输入超时时间" />
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="12">
             <el-form-item label="任务分组" prop="jobGroup">
               <el-select v-model="form.jobGroup" placeholder="请选择任务分组">
                 <el-option
@@ -172,8 +204,53 @@
               </el-select>
             </el-form-item>
           </el-col>
-          <el-col :span="24">
-            <el-form-item prop="invokeTarget">
+          <el-col :span="12">
+            <el-form-item label="任务大类" prop="jobType">
+              <el-select v-model="form.jobType" placeholder="请选择任务大类">
+                <el-option
+                  v-for="dict in dict.type.sys_oa"
+                  :key="dict.value"
+                  :label="dict.label"
+                  :value="dict.value"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="任务小类" prop="jobTypeS">
+              <el-select v-model="form.jobTypeS" placeholder="请选择任务小类">
+                <el-option
+                  v-for="dict in dict.type.sys_oa_s"
+                  :key="dict.value"
+                  :label="dict.label"
+                  :value="dict.value"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="12">
+            <el-form-item label="工作日调度" prop="dispc">
+              <el-select v-model="form.dispc" placeholder="请选择">
+                <el-option
+                  v-for="dict in dict.type.sys_yes_no"
+                  :key="dict.value"
+                  :label="dict.label"
+                  :value="dict.value"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="12">
+            <el-form-item label="预计时长(小时)" prop="duration">
+              <el-input v-model="form.duration" placeholder="请输入时长" />
+            </el-form-item>
+          </el-col>
+
+
+          <el-col :span="24"   >
+            <el-form-item prop="invokeTarget"  readonly >
               <span slot="label">
                 调用方法
                 <el-tooltip placement="top">
@@ -185,7 +262,7 @@
                   <i class="el-icon-question"></i>
                 </el-tooltip>
               </span>
-              <el-input v-model="form.invokeTarget" placeholder="请输入调用目标字符串" />
+              <el-input v-model="invokeTarget" placeholder="请输入调用目标字符串" />
             </el-form-item>
           </el-col>
           <el-col :span="24">
@@ -297,9 +374,34 @@ import Crontab from '@/components/Crontab'
 export default {
   components: { Crontab },
   name: "Job",
-  dicts: ['sys_job_group', 'sys_job_status'],
+  dicts: ['sys_job_group', 'sys_job_status', 'sys_oa','sys_oa_s','sys_yes_no'],
   data() {
     return {
+      pickerOptions: {
+        shortcuts: [{
+          text: '今天',
+          onClick(picker) {
+            picker.$emit('pick', new Date());
+          }
+        }, {
+          text: '昨天',
+          onClick(picker) {
+            const date = new Date();
+            date.setTime(date.getTime() - 3600 * 1000 * 24);
+            picker.$emit('pick', date);
+          }
+        }, {
+          text: '一周前',
+          onClick(picker) {
+            const date = new Date();
+            date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
+            picker.$emit('pick', date);
+          }
+        }]
+      },
+      value1: '',
+      value2: '',
+      value3: '',
       // 遮罩层
       loading: true,
       // 选中数组
@@ -330,16 +432,23 @@ export default {
         pageSize: 10,
         jobName: undefined,
         jobGroup: undefined,
-        status: undefined
+        jobType: undefined,
+        jobTypeS: undefined,
+        dispc:undefined,
+        empno:undefined,
+        cont:undefined,
+        timeout:undefined,
+        status: undefined,
+        duration:undefined
       },
       // 表单参数
       form: {},
       // 表单校验
       rules: {
         jobName: [
-          { required: true, message: "任务名称不能为空", trigger: "blur" }
+          { required: true, message: "名称不能为空", trigger: "blur" }
         ],
-        invokeTarget: [
+         invokeTarget: [
           { required: true, message: "调用目标字符串不能为空", trigger: "blur" }
         ],
         cronExpression: [
@@ -348,6 +457,20 @@ export default {
       }
     };
   },
+  computed:{
+    invokeTarget:function (){
+      let white = ['jobName','empno','cont','timeout','jobGroup','jobType','jobTypeS','dispc','duration']
+      let param = ''
+      white.forEach((item,index)=>{
+        if(this.form[item])
+        index===white.length-1
+          ?param+=`'${this.form[item]}'`
+          :param+=`'${this.form[item]}',`
+      })
+      this.form.invokeTarget=`ryTask.oaTask(${param})`
+      return `ryTask.oaTask(${param})`
+    }
+  },
   created() {
     this.getList();
   },
@@ -412,6 +535,9 @@ export default {
         case "handleJobLog":
           this.handleJobLog(row);
           break;
+        case "handleJobReport":
+          this.handleJobReport(row);
+          break;
         default:
           break;
       }
@@ -456,6 +582,11 @@ export default {
       const jobId = row.jobId || 0;
       this.$router.push('/monitor/job-log/index/' + jobId)
     },
+    /** 任务日志列表查询 */
+    handleJobReport(row) {
+      const jobId = row.jobId || 0;
+      this.$router.push('/monitor/job-log/index/' + jobId)
+    },
     /** 新增按钮操作 */
     handleAdd() {
       this.reset();
@@ -510,4 +641,5 @@ export default {
     }
   }
 };
+
 </script>

+ 16 - 0
src/views/monitor/job/log.vue

@@ -104,6 +104,15 @@
     <el-table v-loading="loading" :data="jobLogList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="日志编号" width="80" align="center" prop="jobLogId" />
+
+
+        <el-table-column label="员工工号" width="80" align="center" prop="enpno" />
+        <el-table-column label="任务大类" width="80" align="center" prop="jobType" />
+        <el-table-column label="任务小类" width="80" align="center" prop="jobTypeS" />
+        <el-table-column label="任务内容" width="80" align="center" prop="cont" />
+        <el-table-column label="超时时间" width="80" align="center" prop="timeout" />
+        <el-table-column label="预计时长" width="80" align="center" prop="duration" />
+
       <el-table-column label="任务名称" align="center" prop="jobName" :show-overflow-tooltip="true" />
       <el-table-column label="任务组名" align="center" prop="jobGroup" :show-overflow-tooltip="true">
         <template slot-scope="scope">
@@ -122,6 +131,12 @@
           <span>{{ parseTime(scope.row.createTime) }}</span>
         </template>
       </el-table-column>
+
+
+
+
+
+
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -150,6 +165,7 @@
           <el-col :span="12">
             <el-form-item label="日志序号:">{{ form.jobLogId }}</el-form-item>
             <el-form-item label="任务名称:">{{ form.jobName }}</el-form-item>
+            <el-form-item label="员工工号:">{{ form.empno }}</el-form-item>
           </el-col>
           <el-col :span="12">
             <el-form-item label="任务分组:">{{ form.jobGroup }}</el-form-item>

+ 2 - 2
src/views/system/dict/index.vue

@@ -192,7 +192,7 @@ import { listType, getType, delType, addType, updateType, refreshCache } from "@
 
 export default {
   name: "Dict",
-  dicts: ['sys_normal_disable'],
+  dicts: ['sys_normal_disable' ],
   data() {
     return {
       // 遮罩层
@@ -344,4 +344,4 @@ export default {
     }
   }
 };
-</script>
+</script>

+ 0 - 1
vue.config.js

@@ -36,7 +36,6 @@ module.exports = {
     proxy: {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
-        // target: `http://172.16.100.107:8080/drp-admin`, //测试
         target: `http://test-sy.derom.com/drp-admin`, //测试
         // target: `http://sy.derom.com/drp-admin`, //生产
         // target: `http://172.16.63.202:8000/drp-admin`, // D本地