zuozhengqing
2023-12-20 a4ad4789a091367fc2d63e0a6250a816335ea501
销售明细单日期选择添加限制,菜单栏数据存储vuex
6个文件已修改
79 ■■■■■ 已修改文件
src/components/layout/components/appsidebar/index.vue 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/index.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/store/index.js 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/sales/contractManage/DetailContractManage.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/sales/contractManage/index.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/sales/salesDetails/AddSalesDetailsDialog.vue 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/layout/components/appsidebar/index.vue
@@ -41,7 +41,6 @@
</template>
<script>
import {getMenuTreeByRole} from "@/api/menus/index"
export default {
  name: "AppSidebar",
  props: {},
@@ -62,28 +61,22 @@
  },
  methods: {
    getMenuTreeByRole(){
      getMenuTreeByRole().then((res)=>{
        console.log(res.data.list,"crm菜单")
        res.data.list.map((item)=>{
          if(item.systemType===2){
            let newList= JSON.parse(JSON.stringify([...item.menus]))
            // 隐藏了 生成计划 和 服务收费管理模块
            if(newList[1]){
              const found = newList[1].children.find(obj => obj.title === "生成计划")
              if(found){
                newList[1].children=[...newList[1].children.slice(0, -1)];
              }
            }
            if(newList[2]){
              const found1 = newList[2].children.find(obj => obj.title === "服务收费管理")
              if(found1){
                newList[2].children=[...newList[2].children.slice(0, -1)];
              }
            }
            this.menus=newList
          }
        })
      })
      let newList=this.$store.state.menus
      console.log(newList,"newList")
      // 隐藏了 生成计划 和 服务收费管理模块
      if(newList[1]){
        const found = newList[1].children.find(obj => obj.title === "生成计划")
        if(found){
          newList[1].children=[...newList[1].children.slice(0, -1)];
        }
      }
      if(newList[2]){
        const found1 = newList[2].children.find(obj => obj.title === "服务收费管理")
        if(found1){
          newList[2].children=[...newList[2].children.slice(0, -1)];
        }
      }
      this.menus=newList
    },
    // 监听路由
    initNavMenu() {
src/router/index.js
@@ -6,6 +6,7 @@
import salesRouter from "./sales/index.js"
import serviceRouter from "./service/index.js"
import {getMenuTreeByRole} from "@/api/menus/index"
import store from '@/store/index.js';
// import backgroundConfigRouter from "./backgroundConfig/index.js"
Vue.use(Router)
@@ -120,6 +121,7 @@
    };
    const foundObject = res.data.list.find(obj => obj.systemType === 2);
    if (foundObject) {
      store.commit('setMenus', foundObject.menus);
      foundObject.menus.forEach(item => {
        const nextPath = item.children.find(obj => obj.path === routePath);
        if (nextPath) {
src/store/index.js
@@ -4,7 +4,15 @@
Vue.use(Vuex)
export default new Vuex.Store({
  state:{
    menus:[]
  },
  mutations: {
    setMenus(state, payload) {
      state.menus = payload;
    },
  },
  modules: {
    getClientName
  }
  },
})
src/views/sales/contractManage/DetailContractManage.vue
@@ -10,7 +10,7 @@
      <template slot="title">
        <div class="header">
          <span class="header-label">合同管理</span>
          <span class="header-title">{{ detailConfig.infomation.number }}</span>
          <span class="header-title">{{ detailConfig.infomation.contractName }}</span>
        </div>
      </template>
      <div class="content">
src/views/sales/contractManage/index.vue
@@ -7,7 +7,7 @@
          :show-download="false"
          :amount-view="false"
          :show-action-btn="false"
          placeholder="请输入单据编号"
          placeholder="请输入合同名称或单据编号"
          @searchClick="onFilterSearch"
        >
          <template slot="leftButton">
@@ -102,18 +102,14 @@
      },
      selValueList: [],
      search_map: {},
      searchSel: {
        value: "number",
        label: "单据编号"
      },
      tableColumn: [
        { label: "单据编号", prop: "number", min: 120, isCommonClick: true, default: true },
        { label: "合同名称", prop: "contractName", min: 120, isCommonClick: true, default: true },
        { label: "负责人", prop: "member_name", min: 90 },
        { label: "客户名称", prop: "client_name" },
        { label: "合同状态", prop: "serviceContractStatus_name", min: 100 },
        { label: "创建时间", prop: "created_at" }
      ],
      showCol: ["单据编号", "负责人", "客户名称", "合同状态", "创建时间"],
      showCol: ["合同名称", "负责人", "客户名称", "合同状态", "创建时间"],
      keyword:''
    }
  },
@@ -246,7 +242,7 @@
    },
    // 合同管理详情
    selCommonClick(row) {
      console.log(row)
      console.log(row,"合同详情")
      this.contractDetail.visible = true
      this.contractDetail.infomation = { ...row }
    }
src/views/sales/salesDetails/AddSalesDetailsDialog.vue
@@ -207,6 +207,7 @@
                    placeholder="选择日期"
                    style="width: 100%"
                    :disabled="isView"
                    :picker-options="pickerOptionsBefore"
                  >
                  </el-date-picker>
                </el-form-item>
@@ -234,6 +235,7 @@
                    placeholder="选择日期"
                    style="width: 100%"
                    :disabled="isView"
                    :picker-options="pickerOptions"
                  >
                  </el-date-picker>
                </el-form-item>
@@ -594,7 +596,17 @@
      selProductData: [],
      isView: this.editCommonConfig.title === "查看",
      selectBox: this.editCommonConfig.title !== "查看",
      thatMember: {}
      thatMember: {},
      pickerOptions: {
        disabledDate(time) {
          return time.getTime() <  Date.now() - 8.64e7;
        },
      },
      pickerOptionsBefore:{
        disabledDate(time) {
          return time.getTime() >  Date.now();
        },
      }
    }
  },
  created() {