Explorar o código

Merge branch 'testToMerge' into greenUrgent

qymljy hai 9 meses
pai
achega
817913eeee
Modificáronse 4 ficheiros con 651 adicións e 1086 borrados
  1. 346 954
      package-lock.json
  2. 32 6
      src/components/newLayout/index.vue
  3. 264 126
      src/store/index.js
  4. 9 0
      src/utils/tool.js

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 346 - 954
package-lock.json


+ 32 - 6
src/components/newLayout/index.vue

@@ -142,12 +142,38 @@ export default {
     },
   },
   mounted() {
-
-    if (JSON.parse(sessionStorage.getItem('active_password')) == '1' && JSON.parse(sessionStorage.getItem('password')) != '1'){
-      if (JSON.parse(sessionStorage.getItem('active_account')).usertype == 0 && JSON.parse(sessionStorage.getItem('active_account')).usertype == 1 && (JSON.parse(sessionStorage.getItem('active_account')).siteid == 'HY' || JSON.parse(sessionStorage.getItem('active_account')).siteid == 'YOSTEST1')){
-        this.dialogVisible = false
-      }else {
-        this.dialogVisible = true
+    try {
+      this.$api
+        .requested({
+          classname: "sysmanage.develop.optiontype.optiontype",
+          method: "optiontypeselect",
+          content: {
+            typename: "statuscolors",
+          },
+        })
+        .then((res) => {
+          if (res.code != "1") return;
+          let colors = {};
+          res.data.forEach((v) => {
+            colors[v.value] = v.remarks;
+          });
+          this.$store.commit("setStatusColorList", colors)
+        });
+    } catch (error) {}
+    if (
+      JSON.parse(sessionStorage.getItem("active_password")) == "1" &&
+      JSON.parse(sessionStorage.getItem("password")) != "1"
+    ) {
+      if (
+        JSON.parse(sessionStorage.getItem("active_account")).usertype == 0 &&
+        JSON.parse(sessionStorage.getItem("active_account")).usertype == 1 &&
+        (JSON.parse(sessionStorage.getItem("active_account")).siteid == "HY" ||
+          JSON.parse(sessionStorage.getItem("active_account")).siteid ==
+            "YOSTEST1")
+      ) {
+        this.dialogVisible = false;
+      } else {
+        this.dialogVisible = true;
       }
     }
     /*this.debouned()*/

+ 264 - 126
src/store/index.js

@@ -8,114 +8,203 @@ Vue.use(Vuex);
 
 export default new Vuex.Store({
   state: {
-    pageOnlyRead:false,
-    loading:false,
-    siteinfo:{
-      attinfos:[]
-    },
-    deplist:[],
-    sys_options:[],
-    shortcutlist:[],
-    active_modules:{},
-    checks:[],
-    dataToForm:{},
-    activeApp:null,
-    appname:'',
-    menuApp:[],
-    sys_modules:[],
-    searchValue:'',
-    closeDrawerTemp:false,
-    DrawerShow:false,
-    historyRouter:null,
-    pageCache:[],
-    svlistData:[],
-    fullScroll:false,
-    _this : null
+    pageOnlyRead: false,
+    loading: false,
+    siteinfo: {
+      attinfos: []
+    },
+    deplist: [],
+    sys_options: [],
+    shortcutlist: [],
+    active_modules: {},
+    checks: [],
+    dataToForm: {},
+    activeApp: null,
+    appname: '',
+    menuApp: [],
+    sys_modules: [],
+    searchValue: '',
+    closeDrawerTemp: false,
+    DrawerShow: false,
+    historyRouter: null,
+    pageCache: [],
+    svlistData: [],
+    fullScroll: false,
+    _this: null,
+    statusColorList: {
+      "是": "#F56C6C",
+      "报废": "#999999",
+      "售出": "#67C23A",
+      "借出": "#e6a23c",
+      "在库": "#3874f6",
+      "未入账": "#F56C6C",
+      "已入账(非贷款)": "#e6a23c",
+      "已入账(系统)": "#67C23A",
+      "已入账(人工)": "#3874f6",
+      "已入账(非贷款)": "#e6a23c",
+      "已入账(系统)": "#67C23A",
+      "已入账(人工)": "#3874f6",
+      "关闭": "#999999",
+      "否": "#999999",
+      "已使用": "#67C23A",
+      "未开票": "#F56C6C",
+      "部分开票": "#e6a23c",
+      "已开票": "#67C23A",
+      "未核销": "#F56C6C",
+      "部分核销": "#e6a23c",
+      "已核销": "#67C23A",
+      "交期确认": "#67C23A",
+      "交期待确认": "#F56C6C",
+      "意向": "#3874f6",
+      "售中": "#e6a23c",
+      "评审通过-已有成品": "rgba(103,194,58,0.5)",
+      "评审通过-暂无成品": "#67C23A",
+      "评审拒绝": "#F56C6C",
+      "评审中": "#e6a23c",
+      "待评审": "#3874f6",
+      "无需评审": "#67C23A",
+      "暂停": "#F56C6C",
+      "代开始": "#3874f6",
+      "待接单": "#999999",
+      "正式": "#67C23A",
+      "历史售后": "#999999",
+      "售后": "#67C23A",
+      "售前": "#3874f6",
+      "已完成": "#67C23A",
+      "待处理": "#F56C6C",
+      "待指派": "#3874f6",
+      "发放": "#67C23A",
+      "收货": "#67C23A",
+      "未使用": "#999999",
+      "已过期": "#999999",
+      "潜在": "#3874f6",
+      "已分配": "#333333",
+      "待分配": "#3874f6",
+      "已审核": "#67C23A",
+      "待审核": "#3874f6",
+      "结束": "#999999",
+      "已读": "#999999",
+      "置顶": "#F56C6C",
+      "发布": "#67C23A",
+      "新建": "#3874f6",
+      "合作中": "#67C23A",
+      "已无效": "#999999",
+      "已转化": "#e6a23c",
+      "跟进中": "#67C23A",
+      "待跟进": "#3874f6",
+      "离职": "#999999",
+      "在职": "#67C23A",
+      "停用": "#999999",
+      "启用": "#67C23A",
+      "进行中": "#67C23A",
+      "已报备": "#67C23A",
+      "下架": "#F56C6C",
+      "上架": "#67C23A",
+      "已下达": "#67C23A",
+      "已截至": "#999999",
+      "开启": "#67C23A",
+      "已提交": "#67C23A",
+      "复核": "#F56C6C",
+      "审核": "#e6a23c",
+      "提交": "#67C23A",
+      "待执行": "#3874f6",
+      "报备中": "#e6a23c",
+      "未报备": "#3874f6",
+      "已结案": "#999999",
+      "已失败": "#F56C6C",
+      "多次成交": "#67C23A",
+      "已成交": "#67C23A",
+      "未成交": "#3874f6",
+      "已终止": "#999999",
+      "暂缓": "#e6a23c",
+      "禁用": "#999999",
+      "已确认(非货款)":"#e6a23c"
+    }
   },
   getters: {
-    siteinfo:state => state.siteinfo,
-    loading:state => state.loading,
-    deplist:state =>  state.deplist,
-    sys_options:state => state.sys_options,
-    pageOnlyRead:state => state.pageOnlyRead,
-    shortcutlist:state => state.shortcutlist,
-    active_modules:state => state.active_modules,
-    checks:state => state.checks,
-    dataToForm:state => state.dataToForm,
-    activeApp:state => state.activeApp,
-    appname:state => state.appname,
-    menuApp:state => state.menuApp,
-    searchValue:state => state.searchValue,
-    closeDrawerTemp:state => state.closeDrawerTemp,
-    DrawerShow:state => state.DrawerShow,
-    sys_modules:state => state.sys_modules,
-    historyRouter:state => state.historyRouter,
-    isRouterAlive:state => state.isRouterAlive,
+    siteinfo: state => state.siteinfo,
+    loading: state => state.loading,
+    deplist: state => state.deplist,
+    sys_options: state => state.sys_options,
+    pageOnlyRead: state => state.pageOnlyRead,
+    shortcutlist: state => state.shortcutlist,
+    active_modules: state => state.active_modules,
+    checks: state => state.checks,
+    dataToForm: state => state.dataToForm,
+    activeApp: state => state.activeApp,
+    appname: state => state.appname,
+    menuApp: state => state.menuApp,
+    searchValue: state => state.searchValue,
+    closeDrawerTemp: state => state.closeDrawerTemp,
+    DrawerShow: state => state.DrawerShow,
+    sys_modules: state => state.sys_modules,
+    historyRouter: state => state.historyRouter,
+    isRouterAlive: state => state.isRouterAlive,
     pageCache: state => state.pageCache,
-    svlistData:state => state.svlistData,
-    fullScroll:state => state.fullScroll
+    svlistData: state => state.svlistData,
+    fullScroll: state => state.fullScroll
 
   },
   mutations: {
-    setLoading(state,value) {
+    setLoading(state, value) {
       state.loading = value
     },
-    setSiteInfo(state,res) {
+    setSiteInfo(state, res) {
       state.siteinfo = res.data
     },
-    setDeplist (state,res) {
+    setDeplist(state, res) {
       state.deplist = res
     },
-    setSelectList (state,res) {
+    setSelectList(state, res) {
       state.sys_options = res.data
     },
-    setUsershortcuts (state,param) {
+    setUsershortcuts(state, param) {
       state.shortcutlist = [...param]
     },
-    pageOnlyRead (state,bool) {
+    pageOnlyRead(state, bool) {
       state.pageOnlyRead = bool
     },
-    checkClass (state,id) {
+    checkClass(state, id) {
       state.checks.push(id)
       state.checks = [...new Set(state.checks)]
     },
-    uncheckClass (state,id) {
-      state.checks =  state.checks.filter(e=>{
+    uncheckClass(state, id) {
+      state.checks = state.checks.filter(e => {
         return e !== id
       })
     },
-    sendDataToForm (state,data) {
+    sendDataToForm(state, data) {
       state.dataToForm = data
     },
 
-    setActiveApp (state,data) {
-      console.log(state,data,'-*******')
+    setActiveApp(state, data) {
+      console.log(state, data, '-*******')
       //头部区域搜索所传入的数值
       state.searchValue = data.val
 
 
-      data.app?sessionStorage.setItem('activeApp',JSON.stringify(data.app)):''
+      data.app ? sessionStorage.setItem('activeApp', JSON.stringify(data.app)) : ''
       state.appname = data.name
       state.activeApp = JSON.parse(sessionStorage.getItem('activeApp'))
-      data.link?data.link():''
+      data.link ? data.link() : ''
     },
-    systemModules (state,data) {
+    systemModules(state, data) {
       state.sys_modules = data
     },
-    setAppMenu (state,data) {
+    setAppMenu(state, data) {
       state.menuApp = data
     },
-    changeDetailDrawer (state,bool) {
+    changeDetailDrawer(state, bool) {
       state.closeDrawerTemp = bool
     },
-    DrawerShowChange (state,bool) {
+    DrawerShowChange(state, bool) {
       state.DrawerShow = bool
     },
-    setHistoryRouter (state,route) {
+    setHistoryRouter(state, route) {
       state.historyRouter = route
     },
-    detailDeleteRouterBack (state) {
-      console.log(state,'state')
+    detailDeleteRouterBack(state) {
+      console.log(state, 'state')
       if (state.historyRouter) {
         router.replace(state.historyRouter)
         state.historyRouter = null
@@ -123,23 +212,29 @@ export default new Vuex.Store({
         state.closeDrawerTemp = false
       }
     },
-    clearSearchValue (state) {
+    clearSearchValue(state) {
       state.searchValue = ''
     },
-    setPageCache(state,res) {
+    setPageCache(state, res) {
       state.pageCache = res
     },
-    saveListData (state,data) {
+    saveListData(state, data) {
       state.svlistData = data
     },
-    setFullScroll (state,data) {
+    setFullScroll(state, data) {
       state.fullScroll = data
+    },
+    setStatusColorList(state, data) {
+      state.statusColorList = data
+      console.log('修改data',data)
     }
   },
   actions: {
     // 系统选项分类查询
-    optiontypeselect ({commit}, param) {
-      return new Promise(async (reslove,reject)=>{
+    optiontypeselect({
+      commit
+    }, param) {
+      return new Promise(async (reslove, reject) => {
         let obj = {
           "classname": "sysmanage.develop.optiontype.optiontype",
           "method": "optiontypeselect",
@@ -147,31 +242,34 @@ export default new Vuex.Store({
             "pageNumber": 1,
             "pageSize": 1000,
             "typename": param,
-            "parameter": {
-            },
+            "parameter": {},
           }
         }
         const res = await api.requested(obj)
 
-        commit('setSelectList',res)
+        commit('setSelectList', res)
 
         reslove(res)
       })
 
     },
     // 查询站点信息
-    async querySiteInfo ({commit}, param) {
+    async querySiteInfo({
+      commit
+    }, param) {
       const res = await api.requested(param)
-      commit('setSiteInfo',res)
+      commit('setSiteInfo', res)
     },
     // 创建下载记录
-    async createdownlog ({commit}, param) {
+    async createdownlog({
+      commit
+    }, param) {
       let obj = {
         "classname": "system.attachment.Attachment",
         "method": "createdownlog",
         "content": {
-            "linksid": param.linksid,
-            "attachmentid":param.attachmentid
+          "linksid": param.linksid,
+          "attachmentid": param.attachmentid
         }
       }
       const res = await api.requested(obj)
@@ -179,17 +277,20 @@ export default new Vuex.Store({
 
 
     // 存储部门列表数据
-    setDeplistData ({commit}, param) {
-      commit('setDeplist',param)
+    setDeplistData({
+      commit
+    }, param) {
+      commit('setDeplist', param)
     },
 
     // 设置快捷栏
-    async setUsershortcuts ({commit}, param) {
+    async setUsershortcuts({
+      commit
+    }, param) {
       const res = await api.requested({
         "classname": "sysmanage.develop.userauthforweb.userauth",
         "method": "query_usershortcuts",
-        "content": {
-        }
+        "content": {}
       })
       let data = JSON.parse(sessionStorage.getItem('module_info'))
       let modules = []
@@ -197,36 +298,40 @@ export default new Vuex.Store({
         modules = modules.concat(mod.modules)
       });
       let arr = []
-      res.data.forEach(e=>{
-        modules.forEach(mod=>{
+      res.data.forEach(e => {
+        modules.forEach(mod => {
           if (mod.systemmoduleid === e.systemmoduleid) {
             mod.issystem = e.issystem
             arr.push(mod)
           }
         })
       })
-      commit('setUsershortcuts',arr)
+      commit('setUsershortcuts', arr)
     },
     // 设置应用快捷栏
-    async setAppMenu ({commit}, param) {
+    async setAppMenu({
+      commit
+    }, param) {
       const res = await api.requested({
         "classname": "sysmanage.develop.userauthforweb.userauth",
         "method": "query_usershortcuts",
         "content": {
-          "shortcuttype":"systemapp"
+          "shortcuttype": "systemapp"
         }
       })
       console.log(res.data)
-      commit('setAppMenu',res.data)
+      commit('setAppMenu', res.data)
     },
     // 查询标签数据
-    async queryTagList ({commit}, param) {
-      return new Promise(async (reslove,reject)=>{
+    async queryTagList({
+      commit
+    }, param) {
+      return new Promise(async (reslove, reject) => {
         let obj = {
           "id": 20220929085401,
           "content": {
-              "ownertable":param.table,
-              "ownerid":param.id
+            "ownertable": param.table,
+            "ownerid": param.id
           }
         }
         const res = await api.requested(obj)
@@ -235,50 +340,76 @@ export default new Vuex.Store({
     },
 
     // 设置权限状态
-    pageOnlyRead ({commit}, bool) {
-      commit('pageOnlyRead',bool)
+    pageOnlyRead({
+      commit
+    }, bool) {
+      commit('pageOnlyRead', bool)
     },
 
-    checkClass ({commit}, id) {
-      commit('checkClass',id)
+    checkClass({
+      commit
+    }, id) {
+      commit('checkClass', id)
     },
-    uncheckClass ({commit}, id) {
-      commit('uncheckClass',id)
+    uncheckClass({
+      commit
+    }, id) {
+      commit('uncheckClass', id)
     },
     // 主文件向Form中的组件传值
-    sendDataToForm ({commit}, data) {
-      commit('sendDataToForm',data)
-    },
-    getModules ({commit}, data) {
+    sendDataToForm({
+      commit
+    }, data) {
+      commit('sendDataToForm', data)
+    },
+    getModules({
+      commit
+    }, data) {
       if (data.type === 'system') {
-        commit('setActiveApp',{name:data.mod[0].apps[0].systemappname,app:data.mod[0].apps[0],val:''})
+        commit('setActiveApp', {
+          name: data.mod[0].apps[0].systemappname,
+          app: data.mod[0].apps[0],
+          val: ''
+        })
 
-        sessionStorage.setItem('active_modules',JSON.stringify(data.mod[0]))
+        sessionStorage.setItem('active_modules', JSON.stringify(data.mod[0]))
 
         let inactivePath = data.mod[0].apps[0].path
 
-        router.push({path:inactivePath})
+        router.push({
+          path: inactivePath
+        })
 
       }
-      commit('systemModules',data.mod)
+      commit('systemModules', data.mod)
     },
-    setSSystemModules ({commit}, data) {
-      commit('systemModules',data)
+    setSSystemModules({
+      commit
+    }, data) {
+      commit('systemModules', data)
     },
     // 设置活动中的应用
-    setActiveApp ({commit}, data) {
-      commit('setActiveApp',data)
+    setActiveApp({
+      commit
+    }, data) {
+      commit('setActiveApp', data)
     },
-    changeDetailDrawer ({commit}, bool) {
-      commit('changeDetailDrawer',bool)
+    changeDetailDrawer({
+      commit
+    }, bool) {
+      commit('changeDetailDrawer', bool)
     },
-    DrawerShowChange ({commit},bool) {
-      commit('DrawerShowChange',bool)
+    DrawerShowChange({
+      commit
+    }, bool) {
+      commit('DrawerShowChange', bool)
     },
 
     //数据绑定附件媒体
-    bindFileToData ({commit},data) {
-      return new Promise(async (reslove,reject)=>{
+    bindFileToData({
+      commit
+    }, data) {
+      return new Promise(async (reslove, reject) => {
         let obj = {
           "classname": "system.attachment.Attachment",
           "method": "createFileLink",
@@ -295,24 +426,31 @@ export default new Vuex.Store({
     },
 
     // 设置历史路由用于返回记录的地址
-    setHistoryRouter ({commit},route) {
-      commit('setHistoryRouter',route)
+    setHistoryRouter({
+      commit
+    }, route) {
+      commit('setHistoryRouter', route)
     },
 
     // 历史路由删除后返回上一页操作
-    detailDeleteRouterBack ({commit},route) {
-      commit('detailDeleteRouterBack',route)
+    detailDeleteRouterBack({
+      commit
+    }, route) {
+      commit('detailDeleteRouterBack', route)
     },
 
-    clearSearchValue ({commit},data) {
+    clearSearchValue({
+      commit
+    }, data) {
       commit('clearSearchValue')
     },
 
-    saveListData ({commit},data) {
-      commit('saveListData',data)
+    saveListData({
+      commit
+    }, data) {
+      commit('saveListData', data)
     },
 
   },
-  modules: {
-  },
+  modules: {},
 });

+ 9 - 0
src/utils/tool.js

@@ -248,4 +248,13 @@ export default {
     });
     return true
   },
+  getStatusColor(status,isDetail = false){
+    const colors = store.state.statusColorList;
+    console.log("colors", colors)
+    if (isDetail){
+      return colors[status] || "#999";
+    }else{
+      return colors[status] ? `color:${colors[status]}` : "#999";
+    }
+  },
 }

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio