Merge branch 'dev' of http://114.132.189.42:9002/r/product-inventory-management into dev
| | |
| | | #app {
|
| | |
|
| | | .main-container {
|
| | | min-height: 100%;
|
| | | transition: margin-left .28s;
|
| | | transition: margin-left 0.28s;
|
| | | margin-left: $base-sidebar-width;
|
| | | position: relative;
|
| | | background: #F5F7FB;
|
| | | background: #f5f7fb;
|
| | | }
|
| | |
|
| | | .sidebarHide {
|
| | |
| | | left: 0;
|
| | | z-index: 1001;
|
| | | overflow: hidden;
|
| | | -webkit-box-shadow: 2px 0 6px rgba(0,21,41,.35);
|
| | | -webkit-box-shadow: 2px 0 6px rgba(0, 21, 41, 0.35);
|
| | | box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1);
|
| | |
|
| | | // reset element-ui css
|
| | | .horizontal-collapse-transition {
|
| | | transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out;
|
| | | transition: 0s width ease-in-out, 0s padding-left ease-in-out,
|
| | | 0s padding-right ease-in-out;
|
| | | }
|
| | |
|
| | | .scrollbar-wrapper {
|
| | |
| | | width: 100% !important;
|
| | | }
|
| | |
|
| | | .el-menu-item, .menu-title {
|
| | | .el-menu-item,
|
| | | .menu-title {
|
| | | overflow: hidden !important;
|
| | | text-overflow: ellipsis !important;
|
| | | white-space: nowrap !important;
|
| | |
| | | .sub-menu-title-noDropdown,
|
| | | .el-sub-menu__title {
|
| | | &:hover {
|
| | | background-color: rgba(212,221,255,0.56) !important;
|
| | | background-color: rgba(212, 221, 255, 0.8) !important;
|
| | | }
|
| | | }
|
| | | & .theme-light .is-active > .el-sub-menu__title {
|
| | | color: #000000 !important;
|
| | | color: #fff !important;
|
| | | }
|
| | |
|
| | | & .nest-menu .el-sub-menu>.el-sub-menu__title,
|
| | |
| | | min-width: $base-sidebar-width !important;
|
| | |
|
| | | &:hover {
|
| | | background-color: rgba(212,221,255,0.56) !important;
|
| | | background-color: rgba(212, 221, 255, 0.8) !important;
|
| | | }
|
| | | &.is-active {
|
| | | background-color: rgba(212,221,255,0.56) !important;
|
| | | background-color: #fff !important;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | //background-color: transparent;
|
| | |
|
| | | &:hover {
|
| | | background-color: rgba(212,221,255,0.56) !important;
|
| | | background-color: rgba(212, 221, 255, 0.8) !important;
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | .svg-icon {
|
| | | margin-left: 20px;
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | |
|
| | | .sidebar-container {
|
| | | transition: transform .28s;
|
| | | transition: transform 0.28s;
|
| | | width: $base-sidebar-width !important;
|
| | | }
|
| | |
|
| | |
| | | }
|
| | |
|
| | | .withoutAnimation {
|
| | |
|
| | | .main-container,
|
| | | .sidebar-container {
|
| | | transition: none;
|
| | |
| | | // base color
|
| | | $blue: #324157;
|
| | | $light-blue: #333c46;
|
| | | $red: #C03639;
|
| | | $pink: #E65D6E;
|
| | | $green: #30B08F;
|
| | | $tiffany: #4AB7BD;
|
| | | $yellow: #FEC171;
|
| | | $panGreen: #30B08F;
|
| | | $red: #c03639;
|
| | | $pink: #e65d6e;
|
| | | $green: #30b08f;
|
| | | $tiffany: #4ab7bd;
|
| | | $yellow: #fec171;
|
| | | $panGreen: #30b08f;
|
| | |
|
| | | // é»è®¤ä¸»é¢åé
|
| | | $menuText: #bfcbd9;
|
| | |
| | | $menuHover: #263445;
|
| | |
|
| | | // æµ
è²ä¸»é¢theme-light
|
| | | $menuLightBg: #ffffff;
|
| | | $menuLightBg: #002fa7;
|
| | | $menuLightHover: #f0f1f5;
|
| | | $menuLightText: #303133;
|
| | | $menuLightActiveText: #409EFF;
|
| | | $menuLightText: #fff;
|
| | | $menuLightActiveText: #002fa7;
|
| | |
|
| | | // åºç¡åé
|
| | | $base-sidebar-width: 200px;
|
| | |
| | | $base-menu-color-active: #f4f4f5;
|
| | | $base-menu-background: #304156;
|
| | | $base-sub-menu-background: #1f2d3d;
|
| | | $base-sub-menu-hover: #001528;
|
| | | $base-sub-menu-hover: #fff;
|
| | |
|
| | | // ç»ä»¶åé
|
| | | $--color-primary: #409EFF;
|
| | | $--color-success: #67C23A;
|
| | | $--color-warning: #E6A23C;
|
| | | $--color-danger: #F56C6C;
|
| | | $--color-primary: #409eff;
|
| | | $--color-success: #67c23a;
|
| | | $--color-warning: #e6a23c;
|
| | | $--color-danger: #f56c6c;
|
| | | $--color-info: #909399;
|
| | |
|
| | | :export {
|
| | |
| | |
|
| | | /* splitpanes default-theme åé */
|
| | | --splitpanes-default-bg: #ffffff;
|
| | |
|
| | | }
|
| | |
|
| | | // æé»æ¨¡å¼åé
|
| | |
| | |
|
| | | /* ä¾§è¾¹æ èåè¦ç */
|
| | | .sidebar-container {
|
| | | .el-menu-item, .menu-title {
|
| | | .el-menu-item,
|
| | | .menu-title {
|
| | | color: var(--el-text-color-regular);
|
| | | }
|
| | | & .theme-dark .nest-menu .el-sub-menu>.el-sub-menu__title,
|
| | |
| | | --el-table-border-color: var(--el-border-color-light) !important;
|
| | | --el-table-row-hover-bg-color: var(--el-bg-color-overlay) !important;
|
| | |
|
| | | .el-table__header-wrapper, .el-table__fixed-header-wrapper {
|
| | | .el-table__header-wrapper,
|
| | | .el-table__fixed-header-wrapper {
|
| | | th {
|
| | | background-color: var(--el-bg-color-overlay, #F0F1F5) !important;
|
| | | background-color: var(--el-bg-color-overlay, #f0f1f5) !important;
|
| | | color: var(--el-text-color-regular, #515a6e);
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | /* 䏿èåæ ·å¼è¦ç */
|
| | | .el-dropdown-menu__item:not(.is-disabled):focus, .el-dropdown-menu__item:not(.is-disabled):hover{
|
| | | .el-dropdown-menu__item:not(.is-disabled):focus,
|
| | | .el-dropdown-menu__item:not(.is-disabled):hover {
|
| | | background-color: var(--navbar-hover) !important;
|
| | | }
|
| | |
|
| | |
| | | .popup-result .title {
|
| | | background: var(--cron-border);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
| | | <el-breadcrumb class="app-breadcrumb" separator="/">
|
| | | <transition-group name="breadcrumb">
|
| | | <el-breadcrumb-item v-for="(item, index) in levelList" :key="item.path">
|
| | | <span v-if="item.redirect === 'noRedirect' || index == levelList.length - 1" class="no-redirect">{{ item.meta.title }}</span>
|
| | | <span v-if="item.redirect === 'noRedirect' || index == levelList.length - 1" class="no-redirect">{{
|
| | | item.meta.title }}</span>
|
| | | <a v-else @click.prevent="handleLink(item)">{{ item.meta.title }}</a>
|
| | | </el-breadcrumb-item>
|
| | | </transition-group>
|
| | |
| | | margin-left: 8px;
|
| | |
|
| | | .no-redirect {
|
| | | color: #97a8be;
|
| | | color: #002FA7;
|
| | | cursor: text;
|
| | | }
|
| | | }
|
| | |
| | | <template>
|
| | | <div class="navbar">
|
| | | <div>
|
| | | <hamburger id="hamburger-container" :is-active="appStore.sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
|
| | | <hamburger id="hamburger-container" :is-active="appStore.sidebar.opened" class="hamburger-container"
|
| | | @toggleClick="toggleSideBar" />
|
| | | <breadcrumb v-if="!settingsStore.topNav" id="breadcrumb-container" class="breadcrumb-container" />
|
| | | </div>
|
| | | <!-- <top-nav v-if="settingsStore.topNav" id="topmenu-container" class="topmenu-container" />-->
|
| | |
| | | <span class="label">{{userStore.currentFactoryName}}</span>
|
| | | <el-dropdown @command="handleFactoryChange" class="right-menu-item hover-effect" trigger="click">
|
| | | <div>
|
| | | <el-icon size="20"><Switch /></el-icon>
|
| | | <el-icon size="20">
|
| | | <Switch />
|
| | | </el-icon>
|
| | | </div>
|
| | | <template #dropdown>
|
| | | <el-dropdown-menu >
|
| | | <el-dropdown-item
|
| | | v-for="item in factoryList"
|
| | | :key="item.deptId"
|
| | | :command="item"
|
| | | >
|
| | | <el-dropdown-item v-for="item in factoryList" :key="item.deptId" :command="item">
|
| | | {{ item.deptName }}
|
| | | </el-dropdown-item>
|
| | | </el-dropdown-menu>
|
| | |
| | | position: relative;
|
| | | background: var(--navbar-bg);
|
| | | box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
|
| | |
|
| | | .center-menu {
|
| | | line-height: 50px;
|
| | | position: absolute;
|
| | |
| | | transform: translateX(-50%);
|
| | | display: flex;
|
| | | align-items: center;
|
| | |
|
| | | .label {
|
| | | font-weight: bold;
|
| | | font-size: 18px;
|
| | |
| | | <div class="sidebar-logo-container" :class="{ 'collapse': collapse }">
|
| | | <transition name="sidebarLogoFade">
|
| | | <router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/">
|
| | | <img v-if="logo" :src="logo" class="sidebar-logo" />
|
| | | <img v-if="logoUrl" :src="logoUrl" class="sidebar-logo" @error="handleImageError" alt="å
¬å¸Logo" />
|
| | | <h1 v-else class="sidebar-title">{{ title }}</h1>
|
| | | </router-link>
|
| | | <router-link v-else key="expand" class="sidebar-logo-link" to="/">
|
| | | <img v-if="logo" :src="logo" class="sidebar-logo" />
|
| | | <h1 class="sidebar-title">{{ title }}</h1>
|
| | | <img v-if="logoUrl" :src="logoUrl" class="sidebar-logo" @error="handleImageError" alt="å
¬å¸Logo" />
|
| | | <h1 v-else class="sidebar-title">{{ title }}</h1>
|
| | | </router-link>
|
| | | </transition>
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script setup>
|
| | | import logo from '@/assets/logo/logo.png'
|
| | | import useSettingsStore from '@/store/modules/settings'
|
| | | import variables from '@/assets/styles/variables.module.scss'
|
| | | import { ref, computed, onMounted, watch } from 'vue'
|
| | | import useUserStore from '@/store/modules/user'
|
| | | import defaultLogo from '@/assets/logo/logo.png' // 导å
¥é»è®¤logo
|
| | |
|
| | | defineProps({
|
| | | collapse: {
|
| | |
| | | })
|
| | |
|
| | | const title = import.meta.env.VITE_APP_TITLE
|
| | | const settingsStore = useSettingsStore()
|
| | | const sideTheme = computed(() => settingsStore.sideTheme)
|
| | | const userStore = useUserStore()
|
| | |
|
| | | // è·åLogoèæ¯è²
|
| | | const getLogoBackground = computed(() => {
|
| | | if (settingsStore.isDark) {
|
| | | return 'var(--sidebar-bg)'
|
| | | }
|
| | | return sideTheme.value === 'theme-dark' ? variables.menuBg : variables.menuLightBg
|
| | | // å¤çå·¥ååç§°ï¼çæåæ³çæä»¶å
|
| | | const cleanFactoryName = computed(() => {
|
| | | if (!userStore.currentFactoryName) return ''
|
| | | return userStore.currentFactoryName.trim()
|
| | | })
|
| | |
|
| | | // è·åLogoæåé¢è²
|
| | | const getLogoTextColor = computed(() => {
|
| | | if (settingsStore.isDark) {
|
| | | return 'var(--sidebar-text)'
|
| | | // 卿logoè·¯å¾
|
| | | const logoUrl = ref('')
|
| | |
|
| | | // æ£æ¥logoæ¯å¦åå¨å¹¶è®¾ç½®url
|
| | | const updateLogoUrl = () => {
|
| | | if (!cleanFactoryName.value) {
|
| | | logoUrl.value = defaultLogo
|
| | | return
|
| | | }
|
| | | return sideTheme.value === 'theme-dark' ? '#fff' : variables.menuLightText
|
| | |
|
| | | // 使ç¨Viteç卿坼å
¥
|
| | | try {
|
| | | const dynamicLogo = import.meta.glob('/src/assets/logo/*.png', { eager: true })
|
| | | const logoPath = `/src/assets/logo/${cleanFactoryName.value}.png`
|
| | |
|
| | | if (dynamicLogo[logoPath]) {
|
| | | logoUrl.value = dynamicLogo[logoPath].default
|
| | | } else {
|
| | | logoUrl.value = defaultLogo
|
| | | }
|
| | | } catch (error) {
|
| | | console.error('å 载工åLogo失败:', error)
|
| | | logoUrl.value = defaultLogo
|
| | | }
|
| | | }
|
| | |
|
| | | // åå§ååçå¬åå
|
| | | onMounted(() => {
|
| | | updateLogoUrl()
|
| | |
|
| | | // çå¬å·¥ååç§°åå
|
| | | watch(() => userStore.currentFactoryName, updateLogoUrl)
|
| | | })
|
| | |
|
| | | // å¾çå è½½é误å¤ç
|
| | | const handleImageError = (event) => {
|
| | | console.warn('Logoå 载失败ï¼ä½¿ç¨é»è®¤Logo')
|
| | | logoUrl.value = defaultLogo
|
| | | }
|
| | | </script>
|
| | |
|
| | | <style lang="scss" scoped>
|
| | |
| | |
|
| | | .sidebar-logo-container {
|
| | | position: relative;
|
| | | width: 100%;
|
| | | height: 50px;
|
| | | width: 100% !important;
|
| | | height: 50px !important;
|
| | | line-height: 50px;
|
| | | background: v-bind(getLogoBackground);
|
| | | background: #fff;
|
| | | text-align: center;
|
| | | overflow: hidden;
|
| | |
|
| | |
| | | width: 100%;
|
| | |
|
| | | & .sidebar-logo {
|
| | | width: 32px;
|
| | | height: 32px;
|
| | | width: 100%;
|
| | | height: 100%;
|
| | | // height: 32px;
|
| | | vertical-align: middle;
|
| | | margin-right: 12px;
|
| | | }
|
| | |
| | | <div :class="{ 'has-logo': showLogo }" class="sidebar-container">
|
| | | <logo v-if="showLogo" :collapse="isCollapse" />
|
| | | <el-scrollbar wrap-class="scrollbar-wrapper">
|
| | | <el-menu
|
| | | :default-active="activeMenu"
|
| | | :collapse="isCollapse"
|
| | | :background-color="getMenuBackground"
|
| | | :text-color="getMenuTextColor"
|
| | | :unique-opened="true"
|
| | | :active-text-color="theme"
|
| | | :collapse-transition="false"
|
| | | mode="vertical"
|
| | | :class="sideTheme"
|
| | | >
|
| | | <sidebar-item
|
| | | v-for="(route, index) in sidebarRouters"
|
| | | :key="route.path + index"
|
| | | :item="route"
|
| | | :base-path="route.path"
|
| | | />
|
| | | <el-menu :default-active="activeMenu" :collapse="isCollapse" :background-color="getMenuBackground"
|
| | | :text-color="getMenuTextColor" :unique-opened="true" :active-text-color="theme" :collapse-transition="false"
|
| | | mode="vertical" :class="sideTheme">
|
| | | <sidebar-item v-for="(route, index) in sidebarRouters" :key="route.path + index" :item="route"
|
| | | :base-path="route.path" />
|
| | | </el-menu>
|
| | | </el-scrollbar>
|
| | | </div>
|
| | |
| | | const sideTheme = computed(() => settingsStore.sideTheme)
|
| | | const theme = computed(() => settingsStore.theme)
|
| | | const isCollapse = computed(() => !appStore.sidebar.opened)
|
| | | console.log(44444, settingsStore.isDark, sideTheme.value)
|
| | |
|
| | | // è·åèåèæ¯è²
|
| | | const getMenuBackground = computed(() => {
|
| | |
| | | height: 100%;
|
| | | width: 100% !important;
|
| | |
|
| | | .el-menu-item, .el-sub-menu__title {
|
| | | .el-menu-item,
|
| | | .el-sub-menu__title {
|
| | | &:hover {
|
| | | background-color: var(--menu-hover, rgba(0, 0, 0, 0.06)) !important;
|
| | | }
|
| | |
| | | <div class="card-group">
|
| | | <div class="pie-group">
|
| | | <div style="margin-right: 80px">
|
| | | <Echarts ref="chart"
|
| | | :legend="pieLegend"
|
| | | :chartStyle="chartStyle"
|
| | | :series="materialPieSeries"
|
| | | <Echarts ref="chart" :legend="pieLegend" :chartStyle="chartStyle" :series="materialPieSeries"
|
| | | :tooltip="pieTooltip"></Echarts>
|
| | | </div>
|
| | | <div class="info-message2">
|
| | | <div class="info-message1">
|
| | | <div class="pie-title">æ¬æåæ¬¾éé¢</div>
|
| | | <div class="pie-info"><span class="pie-number">{{receiveAmount}}</span>å
<span class="pie-number">{{receiveAmountPercentage}}</span>%</div>
|
| | | <div class="pie-info"><span class="pie-number">{{ receiveAmount }}</span>å
<span
|
| | | class="pie-number">{{ receiveAmountPercentage }}</span>%</div>
|
| | | </div>
|
| | | <div class="info-message1">
|
| | | <div class="pie-title">åºæ¶æ¬¾éé¢</div>
|
| | |
| | | <div class="card-group">
|
| | | <div class="pie-group">
|
| | | <div style="margin-right: 80px">
|
| | | <Echarts ref="chart"
|
| | | :options="options"
|
| | | :legend="pieLegend"
|
| | | :chartStyle="chartStyle"
|
| | | :series="materialPieSeries1"
|
| | | :tooltip="pieTooltip1"></Echarts>
|
| | | <Echarts ref="chart" :options="options" :legend="pieLegend" :chartStyle="chartStyle"
|
| | | :series="materialPieSeries1" :tooltip="pieTooltip1"></Echarts>
|
| | | </div>
|
| | | <div class="info-message2">
|
| | | <div class="info-message1">
|
| | | <div class="pie-title1">æ¬æä»æ¬¾éé¢</div>
|
| | | <div class="pie-info"><span class="pie-number1">{{paymentAmount}}</span>å
<span class="pie-number1">{{payableAmountPercentage}}</span>%</div>
|
| | | <div class="pie-info"><span class="pie-number1">{{ paymentAmount }}</span>å
<span
|
| | | class="pie-number1">{{ payableAmountPercentage }}</span>%</div>
|
| | | </div>
|
| | | <div class="info-message1">
|
| | | <div class="pie-title1">åºä»æ¬¾éé¢</div>
|
| | |
| | | <span style="font-weight: bold">客æ·ååéé¢TOP5ç»è®¡</span>
|
| | | </div>
|
| | | <div>
|
| | | <Echarts ref="chart"
|
| | | :chartStyle="chartStyle1"
|
| | | :grid="grid"
|
| | | :legend="barLegend"
|
| | | :series="barSeries"
|
| | | :tooltip="tooltip"
|
| | | :xAxis="xAxis1"
|
| | | :yAxis="yAxis1"
|
| | | style="height: 42vh;"></Echarts>
|
| | | <Echarts ref="chart" :chartStyle="chartStyle1" :grid="grid" :legend="barLegend" :series="barSeries"
|
| | | :tooltip="tooltip" :xAxis="xAxis1" :yAxis="yAxis1" style="height: 42vh;"></Echarts>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | |
| | | <span style="font-weight: bold">忬¾ãå¼ç¥¨è¿åå¹´èµ°å¿å¾</span>
|
| | | </div>
|
| | | <div>
|
| | | <Echarts ref="chart"
|
| | | :chartStyle="chartStyle1"
|
| | | :grid="grid"
|
| | | :legend="barLegend"
|
| | | :series="lineSeries"
|
| | | :tooltip="tooltipLine"
|
| | | :xAxis="xAxis2"
|
| | | :yAxis="yAxis2"
|
| | | style="height: 27vh;"></Echarts>
|
| | | <Echarts ref="chart" :chartStyle="chartStyle1" :grid="grid" :legend="barLegend" :series="lineSeries"
|
| | | :tooltip="tooltipLine" :xAxis="xAxis2" :yAxis="yAxis2" style="height: 27vh;"></Echarts>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | |
| | | width: 56vw;
|
| | | margin-bottom: 20px;
|
| | | }
|
| | |
|
| | | .card-top-right {
|
| | | padding: 16px;
|
| | | background: #fff;
|
| | |
| | | margin-bottom: 20px;
|
| | | margin-left: 20px;
|
| | | }
|
| | |
|
| | | .card-bottom {
|
| | | padding: 16px;
|
| | | background: #fff;
|
| | |
| | | width: 85.2vw;
|
| | | margin-bottom: 20px;
|
| | | }
|
| | |
|
| | | .title {
|
| | | position: relative;
|
| | | font-size: 18px;
|
| | |
| | | padding-left: 10px;
|
| | | margin-bottom: 26px;
|
| | | }
|
| | |
|
| | | .title::before {
|
| | | position: absolute;
|
| | | left: 0;
|
| | |
| | | content: '';
|
| | | width: 4px;
|
| | | height: 18px;
|
| | | background-color: #3A7BFA;
|
| | | background-color: #002FA7;
|
| | | border-radius: 2px;
|
| | | }
|
| | |
|
| | | .card-group {
|
| | | display: flex;
|
| | | }
|
| | |
|
| | | .info-card {
|
| | | width: 300px;
|
| | | height: 126px;
|
| | |
| | | justify-content: space-around;
|
| | | align-items: center;
|
| | | }
|
| | |
|
| | | .info-card1 {
|
| | | width: 300px;
|
| | | height: 126px;
|
| | |
| | | justify-content: space-around;
|
| | | align-items: center;
|
| | | }
|
| | |
|
| | | .info-card2 {
|
| | | width: 300px;
|
| | | height: 126px;
|
| | |
| | | justify-content: space-around;
|
| | | align-items: center;
|
| | | }
|
| | |
|
| | | .info-message {
|
| | | display: flex;
|
| | | flex-direction: column;
|
| | | justify-content: center;
|
| | | align-items: center;
|
| | | }
|
| | |
|
| | | .info-message1 {
|
| | | font-weight: bold;
|
| | | display: flex;
|
| | |
| | | justify-content: center;
|
| | | align-items: flex-start;
|
| | | }
|
| | |
|
| | | .info-message2 {
|
| | | font-weight: bold;
|
| | | display: flex;
|
| | |
| | | align-items: center;
|
| | | justify-content: space-around;
|
| | | }
|
| | |
|
| | | .info-number {
|
| | | font-weight: bold;
|
| | | font-size: 32px;
|
| | | color: #FFFFFF;
|
| | | margin-bottom: 10px;
|
| | | }
|
| | |
|
| | | .info-title {
|
| | | font-weight: bold;
|
| | | font-size: 18px;
|
| | | color: #FFFFFF;
|
| | | }
|
| | |
|
| | | .pie {
|
| | | display: flex;
|
| | | flex-direction: row;
|
| | | justify-content: space-around;
|
| | | }
|
| | |
|
| | | .pie-group {
|
| | | display: flex;
|
| | | }
|
| | |
|
| | | .pie-title {
|
| | | font-size: 14px;
|
| | | line-height: 24px;
|
| | |
| | | padding-left: 16px;
|
| | | position: relative;
|
| | | }
|
| | |
|
| | | .pie-title::before {
|
| | | content: '';
|
| | | width: 6px; /* èç¹ç宽度 */
|
| | | height: 6px; /* èç¹çé«åº¦ */
|
| | | background-color: #2853FD; /* èç¹çé¢è² */
|
| | | border-radius: 50%; /* å°æ£æ¹å½¢å为åå½¢ */
|
| | | width: 6px;
|
| | | /* èç¹ç宽度 */
|
| | | height: 6px;
|
| | | /* èç¹çé«åº¦ */
|
| | | background-color: #2853FD;
|
| | | /* èç¹çé¢è² */
|
| | | border-radius: 50%;
|
| | | /* å°æ£æ¹å½¢å为åå½¢ */
|
| | | position: absolute;
|
| | | left: 0; /* å®ä½å°å·¦è¾¹ */
|
| | | top: 9px; /* åç´å±
ä¸å¯¹é½ï¼æ ¹æ®è¡é«è°æ´ */
|
| | | left: 0;
|
| | | /* å®ä½å°å·¦è¾¹ */
|
| | | top: 9px;
|
| | | /* åç´å±
ä¸å¯¹é½ï¼æ ¹æ®è¡é«è°æ´ */
|
| | | }
|
| | |
|
| | | .pie-title1 {
|
| | | font-size: 14px;
|
| | | line-height: 24px;
|
| | |
| | | padding-left: 16px;
|
| | | position: relative;
|
| | | }
|
| | |
|
| | | .pie-title1::before {
|
| | | content: '';
|
| | | width: 6px; /* èç¹ç宽度 */
|
| | | height: 6px; /* èç¹çé«åº¦ */
|
| | | background-color: #1EBFAC; /* èç¹çé¢è² */
|
| | | border-radius: 50%; /* å°æ£æ¹å½¢å为åå½¢ */
|
| | | width: 6px;
|
| | | /* èç¹ç宽度 */
|
| | | height: 6px;
|
| | | /* èç¹çé«åº¦ */
|
| | | background-color: #1EBFAC;
|
| | | /* èç¹çé¢è² */
|
| | | border-radius: 50%;
|
| | | /* å°æ£æ¹å½¢å为åå½¢ */
|
| | | position: absolute;
|
| | | left: 0; /* å®ä½å°å·¦è¾¹ */
|
| | | top: 9px; /* åç´å±
ä¸å¯¹é½ï¼æ ¹æ®è¡é«è°æ´ */
|
| | | left: 0;
|
| | | /* å®ä½å°å·¦è¾¹ */
|
| | | top: 9px;
|
| | | /* åç´å±
ä¸å¯¹é½ï¼æ ¹æ®è¡é«è°æ´ */
|
| | | }
|
| | |
|
| | | .pie-info {
|
| | | padding-left: 16px;
|
| | | font-size: 14px;
|
| | | line-height: 24px;
|
| | | }
|
| | |
|
| | | .pie-number {
|
| | | color: #2853FD;
|
| | | }
|
| | |
|
| | | .pie-number1 {
|
| | | color: #1EBFAC;
|
| | | }
|
| | | </style>
|
| | |
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <div class="search_form"> |
| | | <div> |
| | | <span class="search_title">ä¾åºååç§°ï¼</span> |
| | | <el-input v-model="searchForm.customerName" style="width: 240px" placeholder="请è¾å
¥" @change="handleQuery" |
| | | clearable prefix-icon="Search" /> |
| | | <el-button type="primary" @click="handleQuery" style="margin-left: 10px">æç´¢</el-button> |
| | | </div> |
| | | <div> |
| | | <el-button type="primary" @click="openForm('add')">æ°å¢</el-button> |
| | | <el-button @click="handleOut">导åº</el-button> |
| | | <el-button type="danger" plain @click="handleDelete">å é¤</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="table_list"> |
| | | <el-table :data="tableData" border v-loading="tableLoading" @selection-change="handleSelectionChange" |
| | | :expand-row-keys="expandedRowKeys" :row-key="row => row.id" show-summary style="width: 100%" |
| | | :summary-method="summarizeMainTable" height="calc(100vh - 18.5em)"> |
| | | <el-table-column align="center" type="selection" width="55" /> |
| | | <el-table-column align="center" label="åºå·" type="index" width="60" /> |
| | | <el-table-column label="åºåºæ¥æ" prop="salesContractNo" width="100" show-overflow-tooltip /> |
| | | <el-table-column label="ä¾åºååç§°" prop="customerName" width="160" show-overflow-tooltip /> |
| | | <el-table-column label="产å大类" prop="salesman" width="100" show-overflow-tooltip /> |
| | | <el-table-column label="è§æ ¼åå·" prop="projectName" width="100" show-overflow-tooltip /> |
| | | <el-table-column label="åä½" prop="contractAmount" width="80" show-overflow-tooltip /> |
| | | <el-table-column label="åºåºæ°é" prop="entryPersonName" width="100" show-overflow-tooltip /> |
| | | <el-table-column label="å«ç¨åä»·" prop="entryDate" width="100" show-overflow-tooltip /> |
| | | <el-table-column label="å«ç¨æ»ä»·" prop="executionDate" width="100" show-overflow-tooltip /> |
| | | <el-table-column label="ç¨ç" prop="executionDate" width="100" show-overflow-tooltip /> |
| | | <el-table-column label="ä¸å«ç¨æ»ä»·" prop="executionDate" width="100" show-overflow-tooltip /> |
| | | <el-table-column label="åºåºäºº" prop="executionDate" width="80" show-overflow-tooltip /> |
| | | <el-table-column fixed="right" label="æä½" min-width="60" align="center"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" size="small" @click="openForm('edit', scope.row);">ç¼è¾</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination v-show="total > 0" :total="total" layout="total, sizes, prev, pager, next, jumper" |
| | | :page="page.current" :limit="page.size" @pagination="paginationChange" /> |
| | | </div> |
| | | <el-dialog v-model="dialogFormVisible" :title="operationType === 'add' ? 'æ°å¢åºåº' : 'ç¼è¾åºåº'" width="70%" |
| | | @close="closeDia"> |
| | | <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef"> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ä¾åºååç§°ï¼" prop="salesContractNo"> |
| | | <el-input v-model="form.salesContractNo" placeholder="请è¾å
¥" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="产å大类ï¼" prop="salesman"> |
| | | <el-select v-model="form.salesman" placeholder="è¯·éæ©" clearable> |
| | | <el-option v-for="item in userList" :key="item.nickName" :label="item.nickName" |
| | | :value="item.nickName" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="è§æ ¼åå·ï¼" prop="customerContractNo"> |
| | | <el-input v-model="form.customerContractNo" placeholder="请è¾å
¥" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="åä½ï¼" prop="customerId"> |
| | | <el-input v-model="form.customerContractNo" placeholder="请è¾å
¥" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="åºåºæ¶é´ï¼" prop="projectName"> |
| | | <el-date-picker style="width: 100%" v-model="form.entryDate" value-format="YYYY-MM-DD" format="YYYY-MM-DD" |
| | | type="date" placeholder="è¯·éæ©" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="åºåºæ°éï¼" prop="customerContractNo"> |
| | | <el-input v-model="form.customerContractNo" placeholder="请è¾å
¥" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | |
| | | <el-col :span="12"> |
| | | <el-form-item label="å«ç¨åä»·ï¼" prop="customerId"> |
| | | <el-input v-model="form.customerContractNo" placeholder="请è¾å
¥" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å«ç¨æ»ä»·ï¼" prop="customerContractNo"> |
| | | <el-input v-model="form.customerContractNo" placeholder="请è¾å
¥" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | |
| | | <el-col :span="12"> |
| | | <el-form-item label="ç¨çï¼" prop="customerId"> |
| | | <el-input v-model="form.customerContractNo" placeholder="请è¾å
¥" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ä¸å«ç¨æ»ä»·ï¼" prop="entryDate"> |
| | | <el-input v-model="form.customerContractNo" placeholder="请è¾å
¥" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | |
| | | <el-col :span="12"> |
| | | <el-form-item label="åºåºäººï¼" prop="entryPerson"> |
| | | <el-select v-model="form.entryPerson" placeholder="è¯·éæ©" clearable> |
| | | <el-option v-for="item in userList" :key="item.userId" :label="item.nickName" :value="item.userId" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" @click="submitForm">确认</el-button> |
| | | <el-button @click="closeDia">åæ¶</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import pagination from '@/components/PIMTable/Pagination.vue' |
| | | import { ref } from 'vue' |
| | | import { ElMessageBox } from "element-plus"; |
| | | import useUserStore from '@/store/modules/user' |
| | | import { userListNoPage } from "@/api/system/user.js"; |
| | | import { |
| | | ledgerListPage, |
| | | customerList, |
| | | addOrUpdateSalesLedger, |
| | | getSalesLedgerWithProducts, delLedger |
| | | } from "@/api/salesManagement/salesLedger.js"; |
| | | const userStore = useUserStore() |
| | | const { proxy } = getCurrentInstance() |
| | | const tableData = ref([]) |
| | | const productData = ref([]) |
| | | const selectedRows = ref([]) |
| | | const userList = ref([]) |
| | | const customerOption = ref([]) |
| | | const tableLoading = ref(false) |
| | | const page = reactive({ |
| | | current: 1, |
| | | size: 100, |
| | | }) |
| | | const total = ref(0) |
| | | const fileList = ref([]) |
| | | |
| | | // ç¨æ·ä¿¡æ¯è¡¨åå¼¹æ¡æ°æ® |
| | | const operationType = ref('') |
| | | const dialogFormVisible = ref(false) |
| | | const data = reactive({ |
| | | searchForm: { |
| | | customerName: '', |
| | | }, |
| | | form: { |
| | | salesContractNo: '', |
| | | salesman: '', |
| | | customerContractNo: '', |
| | | customerId: '', |
| | | projectName: '', |
| | | entryPerson: '', |
| | | entryDate: '', |
| | | maintenanceTime: '', |
| | | productData: [], |
| | | executionDate: '' |
| | | }, |
| | | rules: { |
| | | salesman: [{ required: true, message: "è¯·éæ©", trigger: "change" }], |
| | | customerContractNo: [{ required: true, message: "请è¾å
¥", trigger: "blur" }], |
| | | customerId: [{ required: true, message: "è¯·éæ©", trigger: "change" }], |
| | | projectName: [{ required: true, message: "请è¾å
¥", trigger: "blur" }], |
| | | entryPerson: [{ required: true, message: "è¯·éæ©", trigger: "change" }], |
| | | entryDate: [{ required: true, message: "è¯·éæ©", trigger: "change" }], |
| | | executionDate: [{ required: true, message: "è¯·éæ©", trigger: "change" }], |
| | | } |
| | | }) |
| | | const { searchForm, form, rules } = toRefs(data) |
| | | |
| | | // æ¥è¯¢å表 |
| | | /** æç´¢æé®æä½ */ |
| | | const handleQuery = () => { |
| | | page.current = 1 |
| | | getList() |
| | | } |
| | | const paginationChange = (obj) => { |
| | | page.current = obj.page; |
| | | page.size = obj.limit; |
| | | getList() |
| | | } |
| | | const getList = () => { |
| | | tableLoading.value = true |
| | | ledgerListPage({ ...searchForm.value, ...page }).then(res => { |
| | | tableLoading.value = false |
| | | tableData.value = res.records |
| | | tableData.value.map(item => { |
| | | item.children = [] |
| | | }) |
| | | total.value = res.total |
| | | }).catch(() => { |
| | | tableLoading.value = false |
| | | }) |
| | | } |
| | | const findNodeById = (nodes, productId) => { |
| | | for (let i = 0; i < nodes.length; i++) { |
| | | if (nodes[i].value === productId) { |
| | | return nodes[i].label; // æ¾å°èç¹ï¼è¿å该èç¹ |
| | | } |
| | | if (nodes[i].children && nodes[i].children.length > 0) { |
| | | const foundNode = findNodeById(nodes[i].children, productId); |
| | | if (foundNode) { |
| | | return foundNode.label; // å¨åèç¹ä¸æ¾å°ï¼è¿å该èç¹ |
| | | } |
| | | } |
| | | } |
| | | return null; // æ²¡ææ¾å°èç¹ï¼è¿ånull |
| | | }; |
| | | // è¡¨æ ¼éæ©æ°æ® |
| | | const handleSelectionChange = (selection) => { |
| | | |
| | | // è¿æ»¤æåæ°æ® |
| | | selectedRows.value = selection.filter(item => item.children !== undefined); |
| | | console.log('selection', selectedRows.value) |
| | | } |
| | | const expandedRowKeys = ref([]) |
| | | |
| | | // 主表åè®¡æ¹æ³ |
| | | const summarizeMainTable = (param) => { |
| | | return proxy.summarizeTable(param, ['contractAmount', 'taxInclusiveTotalPrice', 'taxExclusiveTotalPrice']); |
| | | }; |
| | | |
| | | // æå¼å¼¹æ¡ |
| | | const openForm = async (type, row) => { |
| | | operationType.value = type |
| | | form.value = {} |
| | | productData.value = [] |
| | | let userLists = await userListNoPage() |
| | | userList.value = userLists.data |
| | | customerList().then(res => { |
| | | customerOption.value = res |
| | | }) |
| | | console.log('userStore.id', userStore.id) |
| | | form.value.entryPerson = userStore.id |
| | | if (type === 'edit') { |
| | | currentId.value = row.id; |
| | | getSalesLedgerWithProducts({ id: row.id, type: 1 }).then(res => { |
| | | form.value = { ...res } |
| | | form.value.entryPerson = Number(res.entryPerson) |
| | | productData.value = form.value.productData |
| | | fileList.value = form.value.salesLedgerFiles |
| | | }) |
| | | } |
| | | // let userAll = await userStore.getInfo() |
| | | // userList.value.forEach(element => { |
| | | // if(userAll.user.nickName === element.nickName && userAll.user.userName === element.userName) { |
| | | // form.value.entryPerson = userAll.user.userId // 设置é»è®¤ä¸å¡å为å½åç¨æ· |
| | | // } |
| | | // }); |
| | | form.value.entryDate = getCurrentDate() // 设置é»è®¤å½å
¥æ¥æä¸ºå½åæ¥æ |
| | | dialogFormVisible.value = true |
| | | } |
| | | |
| | | // æäº¤è¡¨å |
| | | const submitForm = () => { |
| | | proxy.$refs["formRef"].validate(valid => { |
| | | if (valid) { |
| | | if (productData.value.length > 0) { |
| | | form.value.productData = proxy.HaveJson(productData.value) |
| | | } else { |
| | | proxy.$modal.msgWarning('请添å 产åä¿¡æ¯') |
| | | return |
| | | } |
| | | let tempFileIds = [] |
| | | if (fileList.value.length > 0) { |
| | | tempFileIds = fileList.value.map(item => item.tempId) |
| | | } |
| | | form.value.tempFileIds = tempFileIds |
| | | form.value.type = 1 |
| | | addOrUpdateSalesLedger(form.value).then(res => { |
| | | proxy.$modal.msgSuccess("æäº¤æå") |
| | | closeDia() |
| | | getList() |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | // å
³éå¼¹æ¡ |
| | | const closeDia = () => { |
| | | proxy.resetForm("formRef") |
| | | dialogFormVisible.value = false |
| | | } |
| | | |
| | | // å¯¼åº |
| | | const handleOut = () => { |
| | | ElMessageBox.confirm( |
| | | 'éä¸çå
容å°è¢«å¯¼åºï¼æ¯å¦ç¡®è®¤å¯¼åºï¼', |
| | | '导åº', { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning', |
| | | } |
| | | ).then(() => { |
| | | proxy.download("/sales/ledger/export", {}, 'åºåºå°è´¦.xlsx') |
| | | }).catch(() => { |
| | | proxy.$modal.msg("已忶") |
| | | }) |
| | | } |
| | | // å é¤ |
| | | const handleDelete = () => { |
| | | let ids = [] |
| | | if (selectedRows.value.length > 0) { |
| | | ids = selectedRows.value.map(item => item.id); |
| | | } else { |
| | | proxy.$modal.msgWarning('è¯·éæ©æ°æ®') |
| | | return |
| | | } |
| | | ElMessageBox.confirm( |
| | | 'éä¸çå
容å°è¢«å é¤ï¼æ¯å¦ç¡®è®¤å é¤ï¼', |
| | | '导åº', { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning', |
| | | } |
| | | ).then(() => { |
| | | delLedger(ids).then(res => { |
| | | proxy.$modal.msgSuccess("å 餿å") |
| | | getList() |
| | | }) |
| | | }).catch(() => { |
| | | proxy.$modal.msg("已忶") |
| | | }) |
| | | } |
| | | // è·åå½åæ¥æå¹¶æ ¼å¼å为 YYYY-MM-DD |
| | | function getCurrentDate() { |
| | | const today = new Date(); |
| | | const year = today.getFullYear(); |
| | | const month = String(today.getMonth() + 1).padStart(2, '0'); // æä»½ä»0å¼å§ |
| | | const day = String(today.getDate()).padStart(2, '0'); |
| | | return `${year}-${month}-${day}`; |
| | | } |
| | | onMounted(() => { |
| | | getList() |
| | | }) |
| | | </script> |
| | | |
| | | <style scoped lang="scss"></style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <div class="search_form"> |
| | | <div> |
| | | <span class="search_title">ä¾åºååç§°ï¼</span> |
| | | <el-input v-model="searchForm.customerName" style="width: 240px" placeholder="请è¾å
¥" @change="handleQuery" |
| | | clearable prefix-icon="Search" /> |
| | | <el-button type="primary" @click="handleQuery" style="margin-left: 10px">æç´¢</el-button> |
| | | </div> |
| | | <div> |
| | | <!-- <el-button type="primary" @click="openForm('add')">æ°å¢åºåº</el-button> --> |
| | | <el-button @click="handleOut">导åº</el-button> |
| | | <el-button type="danger" plain @click="handleDelete">å é¤</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="table_list"> |
| | | <el-table :data="tableData" border v-loading="tableLoading" @selection-change="handleSelectionChange" |
| | | :expand-row-keys="expandedRowKeys" :row-key="row => row.id" show-summary style="width: 100%" |
| | | :summary-method="summarizeMainTable" height="calc(100vh - 18.5em)"> |
| | | <el-table-column align="center" type="selection" width="55" /> |
| | | <el-table-column align="center" label="åºå·" type="index" width="60" /> |
| | | <el-table-column label="å
¥åºæ¶é´" prop="salesContractNo" width="100" show-overflow-tooltip /> |
| | | <el-table-column label="å
¥åºæ¹æ¬¡" prop="customerContractNo" width="160" show-overflow-tooltip /> |
| | | <el-table-column label="ä¾åºååç§°" prop="customerName" width="160" show-overflow-tooltip /> |
| | | <el-table-column label="产å大类" prop="salesman" width="100" show-overflow-tooltip /> |
| | | <el-table-column label="è§æ ¼åå·" prop="projectName" width="160" show-overflow-tooltip /> |
| | | <el-table-column label="åä½" prop="contractAmount" width="70" show-overflow-tooltip /> |
| | | <el-table-column label="å
¥åºæ°é" prop="entryPersonName" width="90" show-overflow-tooltip /> |
| | | <el-table-column label="å«ç¨åä»·" prop="entryDate" width="100" show-overflow-tooltip /> |
| | | <el-table-column label="å«ç¨æ»ä»·" prop="executionDate" width="100" show-overflow-tooltip /> |
| | | <el-table-column label="ç¨ç" prop="executionDate" width="80" show-overflow-tooltip /> |
| | | <el-table-column label="ä¸å«ç¨æ»ä»·" prop="executionDate" width="100" show-overflow-tooltip /> |
| | | <el-table-column label="å
¥åºäºº" prop="executionDate" width="80" show-overflow-tooltip /> |
| | | <el-table-column fixed="right" label="æä½" min-width="60" align="center"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" size="small" @click="openForm(scope.row);">åºåº</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination v-show="total > 0" :total="total" layout="total, sizes, prev, pager, next, jumper" |
| | | :page="page.current" :limit="page.size" @pagination="paginationChange" /> |
| | | </div> |
| | | <el-dialog v-model="dialogFormVisible" :title="'æ°å¢åºåº'" width="70%" @close="closeDia"> |
| | | <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef"> |
| | | <el-form-item label="åºåºæ°éï¼" prop="salesContractNo"> |
| | | <el-input v-model="form.salesContractNo" placeholder="请è¾å
¥" clearable /> |
| | | </el-form-item> |
| | | <el-form-item label="åºåºæ¥æï¼" prop="projectName"> |
| | | <el-date-picker style="width: 100%" v-model="form.entryDate" value-format="YYYY-MM-DD" format="YYYY-MM-DD" |
| | | type="date" placeholder="è¯·éæ©" clearable /> |
| | | </el-form-item> |
| | | <el-form-item label="åºåºäººï¼" prop="entryPerson"> |
| | | <el-select v-model="form.entryPerson" placeholder="è¯·éæ©" clearable> |
| | | <el-option v-for="item in userList" :key="item.userId" :label="item.nickName" :value="item.userId" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" @click="submitForm">确认</el-button> |
| | | <el-button @click="closeDia">åæ¶</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import pagination from '@/components/PIMTable/Pagination.vue' |
| | | import { ref } from 'vue' |
| | | import { ElMessageBox } from "element-plus"; |
| | | import useUserStore from '@/store/modules/user' |
| | | import { userListNoPage } from "@/api/system/user.js"; |
| | | import { |
| | | ledgerListPage, |
| | | customerList, |
| | | addOrUpdateSalesLedger, |
| | | getSalesLedgerWithProducts, delLedger |
| | | } from "@/api/salesManagement/salesLedger.js"; |
| | | const userStore = useUserStore() |
| | | const { proxy } = getCurrentInstance() |
| | | const tableData = ref([]) |
| | | const productData = ref([]) |
| | | const selectedRows = ref([]) |
| | | const userList = ref([]) |
| | | const customerOption = ref([]) |
| | | const tableLoading = ref(false) |
| | | const page = reactive({ |
| | | current: 1, |
| | | size: 100, |
| | | }) |
| | | const total = ref(0) |
| | | const fileList = ref([]) |
| | | |
| | | // ç¨æ·ä¿¡æ¯è¡¨åå¼¹æ¡æ°æ® |
| | | const operationType = ref('') |
| | | const dialogFormVisible = ref(false) |
| | | const data = reactive({ |
| | | searchForm: { |
| | | customerName: '', |
| | | }, |
| | | form: { |
| | | salesContractNo: '', |
| | | salesman: '', |
| | | customerContractNo: '', |
| | | customerId: '', |
| | | projectName: '', |
| | | entryPerson: '', |
| | | entryDate: '', |
| | | maintenanceTime: '', |
| | | productData: [], |
| | | executionDate: '' |
| | | }, |
| | | rules: { |
| | | salesman: [{ required: true, message: "è¯·éæ©", trigger: "change" }], |
| | | customerContractNo: [{ required: true, message: "请è¾å
¥", trigger: "blur" }], |
| | | customerId: [{ required: true, message: "è¯·éæ©", trigger: "change" }], |
| | | projectName: [{ required: true, message: "请è¾å
¥", trigger: "blur" }], |
| | | entryPerson: [{ required: true, message: "è¯·éæ©", trigger: "change" }], |
| | | entryDate: [{ required: true, message: "è¯·éæ©", trigger: "change" }], |
| | | executionDate: [{ required: true, message: "è¯·éæ©", trigger: "change" }], |
| | | } |
| | | }) |
| | | const { searchForm, form, rules } = toRefs(data) |
| | | |
| | | // æ¥è¯¢å表 |
| | | /** æç´¢æé®æä½ */ |
| | | const handleQuery = () => { |
| | | page.current = 1 |
| | | getList() |
| | | } |
| | | const paginationChange = (obj) => { |
| | | page.current = obj.page; |
| | | page.size = obj.limit; |
| | | getList() |
| | | } |
| | | const getList = () => { |
| | | tableLoading.value = true |
| | | ledgerListPage({ ...searchForm.value, ...page }).then(res => { |
| | | tableLoading.value = false |
| | | tableData.value = res.records |
| | | tableData.value.map(item => { |
| | | item.children = [] |
| | | }) |
| | | total.value = res.total |
| | | }).catch(() => { |
| | | tableLoading.value = false |
| | | }) |
| | | } |
| | | const findNodeById = (nodes, productId) => { |
| | | for (let i = 0; i < nodes.length; i++) { |
| | | if (nodes[i].value === productId) { |
| | | return nodes[i].label; // æ¾å°èç¹ï¼è¿å该èç¹ |
| | | } |
| | | if (nodes[i].children && nodes[i].children.length > 0) { |
| | | const foundNode = findNodeById(nodes[i].children, productId); |
| | | if (foundNode) { |
| | | return foundNode.label; // å¨åèç¹ä¸æ¾å°ï¼è¿å该èç¹ |
| | | } |
| | | } |
| | | } |
| | | return null; // æ²¡ææ¾å°èç¹ï¼è¿ånull |
| | | }; |
| | | // è¡¨æ ¼éæ©æ°æ® |
| | | const handleSelectionChange = (selection) => { |
| | | |
| | | // è¿æ»¤æåæ°æ® |
| | | selectedRows.value = selection.filter(item => item.children !== undefined); |
| | | console.log('selection', selectedRows.value) |
| | | } |
| | | const expandedRowKeys = ref([]) |
| | | |
| | | // 主表åè®¡æ¹æ³ |
| | | const summarizeMainTable = (param) => { |
| | | return proxy.summarizeTable(param, ['contractAmount', 'taxInclusiveTotalPrice', 'taxExclusiveTotalPrice']); |
| | | }; |
| | | |
| | | // æå¼å¼¹æ¡ |
| | | const openForm = async (row) => { |
| | | operationType.value = type |
| | | form.value = {} |
| | | productData.value = [] |
| | | let userLists = await userListNoPage() |
| | | userList.value = userLists.data |
| | | customerList().then(res => { |
| | | customerOption.value = res |
| | | }) |
| | | console.log('userStore.id', userStore.id) |
| | | form.value.entryPerson = userStore.id |
| | | if (type === 'edit') { |
| | | currentId.value = row.id; |
| | | getSalesLedgerWithProducts({ id: row.id, type: 1 }).then(res => { |
| | | form.value = { ...res } |
| | | form.value.entryPerson = Number(res.entryPerson) |
| | | productData.value = form.value.productData |
| | | fileList.value = form.value.salesLedgerFiles |
| | | }) |
| | | } |
| | | // let userAll = await userStore.getInfo() |
| | | // userList.value.forEach(element => { |
| | | // if(userAll.user.nickName === element.nickName && userAll.user.userName === element.userName) { |
| | | // form.value.entryPerson = userAll.user.userId // 设置é»è®¤ä¸å¡å为å½åç¨æ· |
| | | // } |
| | | // }); |
| | | form.value.entryDate = getCurrentDate() // 设置é»è®¤å½å
¥æ¥æä¸ºå½åæ¥æ |
| | | dialogFormVisible.value = true |
| | | } |
| | | |
| | | // æäº¤è¡¨å |
| | | const submitForm = () => { |
| | | proxy.$refs["formRef"].validate(valid => { |
| | | if (valid) { |
| | | if (productData.value.length > 0) { |
| | | form.value.productData = proxy.HaveJson(productData.value) |
| | | } else { |
| | | proxy.$modal.msgWarning('请添å 产åä¿¡æ¯') |
| | | return |
| | | } |
| | | let tempFileIds = [] |
| | | if (fileList.value.length > 0) { |
| | | tempFileIds = fileList.value.map(item => item.tempId) |
| | | } |
| | | form.value.tempFileIds = tempFileIds |
| | | form.value.type = 1 |
| | | addOrUpdateSalesLedger(form.value).then(res => { |
| | | proxy.$modal.msgSuccess("æäº¤æå") |
| | | closeDia() |
| | | getList() |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | // å
³éå¼¹æ¡ |
| | | const closeDia = () => { |
| | | proxy.resetForm("formRef") |
| | | dialogFormVisible.value = false |
| | | } |
| | | |
| | | // å¯¼åº |
| | | const handleOut = () => { |
| | | ElMessageBox.confirm( |
| | | 'éä¸çå
容å°è¢«å¯¼åºï¼æ¯å¦ç¡®è®¤å¯¼åºï¼', |
| | | '导åº', { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning', |
| | | } |
| | | ).then(() => { |
| | | proxy.download("/sales/ledger/export", {}, 'å
¥åºå°è´¦.xlsx') |
| | | }).catch(() => { |
| | | proxy.$modal.msg("已忶") |
| | | }) |
| | | } |
| | | // å é¤ |
| | | const handleDelete = () => { |
| | | let ids = [] |
| | | if (selectedRows.value.length > 0) { |
| | | ids = selectedRows.value.map(item => item.id); |
| | | } else { |
| | | proxy.$modal.msgWarning('è¯·éæ©æ°æ®') |
| | | return |
| | | } |
| | | ElMessageBox.confirm( |
| | | 'éä¸çå
容å°è¢«å é¤ï¼æ¯å¦ç¡®è®¤å é¤ï¼', |
| | | '导åº', { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning', |
| | | } |
| | | ).then(() => { |
| | | delLedger(ids).then(res => { |
| | | proxy.$modal.msgSuccess("å 餿å") |
| | | getList() |
| | | }) |
| | | }).catch(() => { |
| | | proxy.$modal.msg("已忶") |
| | | }) |
| | | } |
| | | // è·åå½åæ¥æå¹¶æ ¼å¼å为 YYYY-MM-DD |
| | | function getCurrentDate() { |
| | | const today = new Date(); |
| | | const year = today.getFullYear(); |
| | | const month = String(today.getMonth() + 1).padStart(2, '0'); // æä»½ä»0å¼å§ |
| | | const day = String(today.getDate()).padStart(2, '0'); |
| | | return `${year}-${month}-${day}`; |
| | | } |
| | | onMounted(() => { |
| | | getList() |
| | | }) |
| | | </script> |
| | | |
| | | <style scoped lang="scss"></style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <div class="search_form"> |
| | | <div> |
| | | <span class="search_title">ä¾åºååç§°ï¼</span> |
| | | <el-input v-model="searchForm.customerName" style="width: 240px" placeholder="请è¾å
¥" @change="handleQuery" |
| | | clearable prefix-icon="Search" /> |
| | | <el-button type="primary" @click="handleQuery" style="margin-left: 10px">æç´¢</el-button> |
| | | </div> |
| | | <div> |
| | | <el-button type="primary" @click="openForm('add')">æ°å¢å
¥åº</el-button> |
| | | <el-button @click="handleOut">导åº</el-button> |
| | | <el-button type="danger" plain @click="handleDelete">å é¤</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="table_list"> |
| | | <el-table :data="tableData" border v-loading="tableLoading" @selection-change="handleSelectionChange" |
| | | :expand-row-keys="expandedRowKeys" :row-key="row => row.id" show-summary style="width: 100%" |
| | | :summary-method="summarizeMainTable" height="calc(100vh - 18.5em)"> |
| | | <el-table-column align="center" type="selection" width="55" /> |
| | | <el-table-column align="center" label="åºå·" type="index" width="60" /> |
| | | <el-table-column label="å
¥åºæ¶é´" prop="salesContractNo" width="100" show-overflow-tooltip /> |
| | | <el-table-column label="å
¥åºæ¹æ¬¡" prop="customerContractNo" width="160" show-overflow-tooltip /> |
| | | <el-table-column label="ä¾åºååç§°" prop="customerName" width="160" show-overflow-tooltip /> |
| | | <el-table-column label="产å大类" prop="salesman" width="100" show-overflow-tooltip /> |
| | | <el-table-column label="è§æ ¼åå·" prop="projectName" width="160" show-overflow-tooltip /> |
| | | <el-table-column label="åä½" prop="contractAmount" width="70" show-overflow-tooltip /> |
| | | <el-table-column label="å
¥åºæ°é" prop="entryPersonName" width="90" show-overflow-tooltip /> |
| | | <el-table-column label="å«ç¨åä»·" prop="entryDate" width="100" show-overflow-tooltip /> |
| | | <el-table-column label="å«ç¨æ»ä»·" prop="executionDate" width="100" show-overflow-tooltip /> |
| | | <el-table-column label="ç¨ç" prop="executionDate" width="80" show-overflow-tooltip /> |
| | | <el-table-column label="ä¸å«ç¨æ»ä»·" prop="executionDate" width="100" show-overflow-tooltip /> |
| | | <el-table-column label="å
¥åºäºº" prop="executionDate" width="80" show-overflow-tooltip /> |
| | | <el-table-column fixed="right" label="æä½" min-width="60" align="center"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" size="small" @click="openForm('edit', scope.row);">ç¼è¾</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination v-show="total > 0" :total="total" layout="total, sizes, prev, pager, next, jumper" |
| | | :page="page.current" :limit="page.size" @pagination="paginationChange" /> |
| | | </div> |
| | | <el-dialog v-model="dialogFormVisible" :title="operationType === 'add' ? 'æ°å¢å
¥åº' : 'ç¼è¾å
¥åº'" width="70%" |
| | | @close="closeDia"> |
| | | <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef"> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ä¾åºååç§°ï¼" prop="salesContractNo"> |
| | | <el-input v-model="form.salesContractNo" placeholder="请è¾å
¥" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="产å大类ï¼" prop="salesman"> |
| | | <el-select v-model="form.salesman" placeholder="è¯·éæ©" clearable> |
| | | <el-option v-for="item in userList" :key="item.nickName" :label="item.nickName" |
| | | :value="item.nickName" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="è§æ ¼åå·ï¼" prop="customerContractNo"> |
| | | <el-input v-model="form.customerContractNo" placeholder="请è¾å
¥" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="åä½ï¼" prop="customerId"> |
| | | <el-input v-model="form.customerContractNo" placeholder="请è¾å
¥" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å
¥åºæ¶é´ï¼" prop="projectName"> |
| | | <el-date-picker style="width: 100%" v-model="form.entryDate" value-format="YYYY-MM-DD" format="YYYY-MM-DD" |
| | | type="date" placeholder="è¯·éæ©" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å
¥åºæ¹æ¬¡ï¼" prop="entryPerson"> |
| | | <el-input v-model="form.customerContractNo" placeholder="请è¾å
¥" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å
¥åºæ°éï¼" prop="customerContractNo"> |
| | | <el-input v-model="form.customerContractNo" placeholder="请è¾å
¥" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å«ç¨åä»·ï¼" prop="customerId"> |
| | | <el-input v-model="form.customerContractNo" placeholder="请è¾å
¥" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å«ç¨æ»ä»·ï¼" prop="customerContractNo"> |
| | | <el-input v-model="form.customerContractNo" placeholder="请è¾å
¥" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ç¨çï¼" prop="customerId"> |
| | | <el-input v-model="form.customerContractNo" placeholder="请è¾å
¥" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ä¸å«ç¨æ»ä»·ï¼" prop="entryDate"> |
| | | <el-input v-model="form.customerContractNo" placeholder="请è¾å
¥" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å
¥åºäººï¼" prop="entryPerson"> |
| | | <el-select v-model="form.entryPerson" placeholder="è¯·éæ©" clearable> |
| | | <el-option v-for="item in userList" :key="item.userId" :label="item.nickName" :value="item.userId" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" @click="submitForm">确认</el-button> |
| | | <el-button @click="closeDia">åæ¶</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import pagination from '@/components/PIMTable/Pagination.vue' |
| | | import { ref } from 'vue' |
| | | import { ElMessageBox } from "element-plus"; |
| | | import useUserStore from '@/store/modules/user' |
| | | import { userListNoPage } from "@/api/system/user.js"; |
| | | import { |
| | | ledgerListPage, |
| | | customerList, |
| | | addOrUpdateSalesLedger, |
| | | getSalesLedgerWithProducts, delLedger |
| | | } from "@/api/salesManagement/salesLedger.js"; |
| | | const userStore = useUserStore() |
| | | const { proxy } = getCurrentInstance() |
| | | const tableData = ref([]) |
| | | const productData = ref([]) |
| | | const selectedRows = ref([]) |
| | | const userList = ref([]) |
| | | const customerOption = ref([]) |
| | | const tableLoading = ref(false) |
| | | const page = reactive({ |
| | | current: 1, |
| | | size: 100, |
| | | }) |
| | | const total = ref(0) |
| | | const fileList = ref([]) |
| | | |
| | | // ç¨æ·ä¿¡æ¯è¡¨åå¼¹æ¡æ°æ® |
| | | const operationType = ref('') |
| | | const dialogFormVisible = ref(false) |
| | | const data = reactive({ |
| | | searchForm: { |
| | | customerName: '', |
| | | }, |
| | | form: { |
| | | salesContractNo: '', |
| | | salesman: '', |
| | | customerContractNo: '', |
| | | customerId: '', |
| | | projectName: '', |
| | | entryPerson: '', |
| | | entryDate: '', |
| | | maintenanceTime: '', |
| | | productData: [], |
| | | executionDate: '' |
| | | }, |
| | | rules: { |
| | | salesman: [{ required: true, message: "è¯·éæ©", trigger: "change" }], |
| | | customerContractNo: [{ required: true, message: "请è¾å
¥", trigger: "blur" }], |
| | | customerId: [{ required: true, message: "è¯·éæ©", trigger: "change" }], |
| | | projectName: [{ required: true, message: "请è¾å
¥", trigger: "blur" }], |
| | | entryPerson: [{ required: true, message: "è¯·éæ©", trigger: "change" }], |
| | | entryDate: [{ required: true, message: "è¯·éæ©", trigger: "change" }], |
| | | executionDate: [{ required: true, message: "è¯·éæ©", trigger: "change" }], |
| | | } |
| | | }) |
| | | const { searchForm, form, rules } = toRefs(data) |
| | | |
| | | // æ¥è¯¢å表 |
| | | /** æç´¢æé®æä½ */ |
| | | const handleQuery = () => { |
| | | page.current = 1 |
| | | getList() |
| | | } |
| | | const paginationChange = (obj) => { |
| | | page.current = obj.page; |
| | | page.size = obj.limit; |
| | | getList() |
| | | } |
| | | const getList = () => { |
| | | tableLoading.value = true |
| | | ledgerListPage({ ...searchForm.value, ...page }).then(res => { |
| | | tableLoading.value = false |
| | | tableData.value = res.records |
| | | tableData.value.map(item => { |
| | | item.children = [] |
| | | }) |
| | | total.value = res.total |
| | | }).catch(() => { |
| | | tableLoading.value = false |
| | | }) |
| | | } |
| | | const findNodeById = (nodes, productId) => { |
| | | for (let i = 0; i < nodes.length; i++) { |
| | | if (nodes[i].value === productId) { |
| | | return nodes[i].label; // æ¾å°èç¹ï¼è¿å该èç¹ |
| | | } |
| | | if (nodes[i].children && nodes[i].children.length > 0) { |
| | | const foundNode = findNodeById(nodes[i].children, productId); |
| | | if (foundNode) { |
| | | return foundNode.label; // å¨åèç¹ä¸æ¾å°ï¼è¿å该èç¹ |
| | | } |
| | | } |
| | | } |
| | | return null; // æ²¡ææ¾å°èç¹ï¼è¿ånull |
| | | }; |
| | | // è¡¨æ ¼éæ©æ°æ® |
| | | const handleSelectionChange = (selection) => { |
| | | |
| | | // è¿æ»¤æåæ°æ® |
| | | selectedRows.value = selection.filter(item => item.children !== undefined); |
| | | console.log('selection', selectedRows.value) |
| | | } |
| | | const expandedRowKeys = ref([]) |
| | | |
| | | // 主表åè®¡æ¹æ³ |
| | | const summarizeMainTable = (param) => { |
| | | return proxy.summarizeTable(param, ['contractAmount', 'taxInclusiveTotalPrice', 'taxExclusiveTotalPrice']); |
| | | }; |
| | | |
| | | // æå¼å¼¹æ¡ |
| | | const openForm = async (type, row) => { |
| | | operationType.value = type |
| | | form.value = {} |
| | | productData.value = [] |
| | | let userLists = await userListNoPage() |
| | | userList.value = userLists.data |
| | | customerList().then(res => { |
| | | customerOption.value = res |
| | | }) |
| | | console.log('userStore.id', userStore.id) |
| | | form.value.entryPerson = userStore.id |
| | | if (type === 'edit') { |
| | | currentId.value = row.id; |
| | | getSalesLedgerWithProducts({ id: row.id, type: 1 }).then(res => { |
| | | form.value = { ...res } |
| | | form.value.entryPerson = Number(res.entryPerson) |
| | | productData.value = form.value.productData |
| | | fileList.value = form.value.salesLedgerFiles |
| | | }) |
| | | } |
| | | // let userAll = await userStore.getInfo() |
| | | // userList.value.forEach(element => { |
| | | // if(userAll.user.nickName === element.nickName && userAll.user.userName === element.userName) { |
| | | // form.value.entryPerson = userAll.user.userId // 设置é»è®¤ä¸å¡å为å½åç¨æ· |
| | | // } |
| | | // }); |
| | | form.value.entryDate = getCurrentDate() // 设置é»è®¤å½å
¥æ¥æä¸ºå½åæ¥æ |
| | | dialogFormVisible.value = true |
| | | } |
| | | |
| | | // æäº¤è¡¨å |
| | | const submitForm = () => { |
| | | proxy.$refs["formRef"].validate(valid => { |
| | | if (valid) { |
| | | if (productData.value.length > 0) { |
| | | form.value.productData = proxy.HaveJson(productData.value) |
| | | } else { |
| | | proxy.$modal.msgWarning('请添å 产åä¿¡æ¯') |
| | | return |
| | | } |
| | | let tempFileIds = [] |
| | | if (fileList.value.length > 0) { |
| | | tempFileIds = fileList.value.map(item => item.tempId) |
| | | } |
| | | form.value.tempFileIds = tempFileIds |
| | | form.value.type = 1 |
| | | addOrUpdateSalesLedger(form.value).then(res => { |
| | | proxy.$modal.msgSuccess("æäº¤æå") |
| | | closeDia() |
| | | getList() |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | // å
³éå¼¹æ¡ |
| | | const closeDia = () => { |
| | | proxy.resetForm("formRef") |
| | | dialogFormVisible.value = false |
| | | } |
| | | |
| | | // å¯¼åº |
| | | const handleOut = () => { |
| | | ElMessageBox.confirm( |
| | | 'éä¸çå
容å°è¢«å¯¼åºï¼æ¯å¦ç¡®è®¤å¯¼åºï¼', |
| | | '导åº', { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning', |
| | | } |
| | | ).then(() => { |
| | | proxy.download("/sales/ledger/export", {}, 'å
¥åºå°è´¦.xlsx') |
| | | }).catch(() => { |
| | | proxy.$modal.msg("已忶") |
| | | }) |
| | | } |
| | | // å é¤ |
| | | const handleDelete = () => { |
| | | let ids = [] |
| | | if (selectedRows.value.length > 0) { |
| | | ids = selectedRows.value.map(item => item.id); |
| | | } else { |
| | | proxy.$modal.msgWarning('è¯·éæ©æ°æ®') |
| | | return |
| | | } |
| | | ElMessageBox.confirm( |
| | | 'éä¸çå
容å°è¢«å é¤ï¼æ¯å¦ç¡®è®¤å é¤ï¼', |
| | | '导åº', { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning', |
| | | } |
| | | ).then(() => { |
| | | delLedger(ids).then(res => { |
| | | proxy.$modal.msgSuccess("å 餿å") |
| | | getList() |
| | | }) |
| | | }).catch(() => { |
| | | proxy.$modal.msg("已忶") |
| | | }) |
| | | } |
| | | // è·åå½åæ¥æå¹¶æ ¼å¼å为 YYYY-MM-DD |
| | | function getCurrentDate() { |
| | | const today = new Date(); |
| | | const year = today.getFullYear(); |
| | | const month = String(today.getMonth() + 1).padStart(2, '0'); // æä»½ä»0å¼å§ |
| | | const day = String(today.getDate()).padStart(2, '0'); |
| | | return `${year}-${month}-${day}`; |
| | | } |
| | | onMounted(() => { |
| | | getList() |
| | | }) |
| | | </script> |
| | | |
| | | <style scoped lang="scss"></style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <div class="search_form"> |
| | | <div> |
| | | <span class="search_title">ä¾åºååç§°ï¼</span> |
| | | <el-input v-model="searchForm.customerName" style="width: 240px" placeholder="请è¾å
¥" @change="handleQuery" |
| | | clearable prefix-icon="Search" /> |
| | | <el-button type="primary" @click="handleQuery" style="margin-left: 10px">æç´¢</el-button> |
| | | </div> |
| | | <div> |
| | | <el-button type="primary" @click="openForm('add')">æ°å¢</el-button> |
| | | <el-button @click="handleOut">导åº</el-button> |
| | | <el-button type="danger" plain @click="handleDelete">å é¤</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="table_list"> |
| | | <el-table :data="tableData" border v-loading="tableLoading" @selection-change="handleSelectionChange" |
| | | :expand-row-keys="expandedRowKeys" :row-key="row => row.id" show-summary style="width: 100%" |
| | | :summary-method="summarizeMainTable" height="calc(100vh - 18.5em)"> |
| | | <el-table-column align="center" type="selection" width="55" /> |
| | | <el-table-column align="center" label="åºå·" type="index" width="60" /> |
| | | <el-table-column label="åºåæ¥æ" prop="salesContractNo" width="100" show-overflow-tooltip /> |
| | | <el-table-column label="å
¥åºæ¥æ" prop="salesContractNo" width="100" show-overflow-tooltip /> |
| | | <el-table-column label="ä¾åºååç§°" prop="customerName" width="160" show-overflow-tooltip /> |
| | | <el-table-column label="产å大类" prop="salesman" width="100" show-overflow-tooltip /> |
| | | <el-table-column label="è§æ ¼åå·" prop="projectName" width="100" show-overflow-tooltip /> |
| | | <el-table-column label="åä½" prop="contractAmount" width="80" show-overflow-tooltip /> |
| | | <el-table-column label="åºåºæ°é" prop="entryPersonName" width="100" show-overflow-tooltip /> |
| | | <el-table-column label="å«ç¨åä»·" prop="entryDate" width="100" show-overflow-tooltip /> |
| | | <el-table-column label="å«ç¨æ»ä»·" prop="executionDate" width="100" show-overflow-tooltip /> |
| | | <el-table-column label="ç¨ç" prop="executionDate" width="100" show-overflow-tooltip /> |
| | | <el-table-column label="ä¸å«ç¨æ»ä»·" prop="executionDate" width="100" show-overflow-tooltip /> |
| | | <el-table-column label="å
¥åºäºº" prop="executionDate" width="80" show-overflow-tooltip /> |
| | | <el-table-column fixed="right" label="æä½" min-width="60" align="center"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" size="small" @click="openForm('edit', scope.row);">ç¼è¾</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination v-show="total > 0" :total="total" layout="total, sizes, prev, pager, next, jumper" |
| | | :page="page.current" :limit="page.size" @pagination="paginationChange" /> |
| | | </div> |
| | | <el-dialog v-model="dialogFormVisible" :title="operationType === 'add' ? 'æ°å¢åºåº' : 'ç¼è¾åºåº'" width="70%" |
| | | @close="closeDia"> |
| | | <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef"> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ä¾åºååç§°ï¼" prop="salesContractNo"> |
| | | <el-input v-model="form.salesContractNo" placeholder="请è¾å
¥" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="产å大类ï¼" prop="salesman"> |
| | | <el-select v-model="form.salesman" placeholder="è¯·éæ©" clearable> |
| | | <el-option v-for="item in userList" :key="item.nickName" :label="item.nickName" |
| | | :value="item.nickName" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="è§æ ¼åå·ï¼" prop="customerContractNo"> |
| | | <el-input v-model="form.customerContractNo" placeholder="请è¾å
¥" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="åä½ï¼" prop="customerId"> |
| | | <el-input v-model="form.customerContractNo" placeholder="请è¾å
¥" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="åºåºæ¶é´ï¼" prop="projectName"> |
| | | <el-date-picker style="width: 100%" v-model="form.entryDate" value-format="YYYY-MM-DD" format="YYYY-MM-DD" |
| | | type="date" placeholder="è¯·éæ©" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="åºåºæ°éï¼" prop="customerContractNo"> |
| | | <el-input v-model="form.customerContractNo" placeholder="请è¾å
¥" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | |
| | | <el-col :span="12"> |
| | | <el-form-item label="å«ç¨åä»·ï¼" prop="customerId"> |
| | | <el-input v-model="form.customerContractNo" placeholder="请è¾å
¥" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å«ç¨æ»ä»·ï¼" prop="customerContractNo"> |
| | | <el-input v-model="form.customerContractNo" placeholder="请è¾å
¥" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | |
| | | <el-col :span="12"> |
| | | <el-form-item label="ç¨çï¼" prop="customerId"> |
| | | <el-input v-model="form.customerContractNo" placeholder="请è¾å
¥" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ä¸å«ç¨æ»ä»·ï¼" prop="entryDate"> |
| | | <el-input v-model="form.customerContractNo" placeholder="请è¾å
¥" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | |
| | | <el-col :span="12"> |
| | | <el-form-item label="åºåºäººï¼" prop="entryPerson"> |
| | | <el-select v-model="form.entryPerson" placeholder="è¯·éæ©" clearable> |
| | | <el-option v-for="item in userList" :key="item.userId" :label="item.nickName" :value="item.userId" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" @click="submitForm">确认</el-button> |
| | | <el-button @click="closeDia">åæ¶</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import pagination from '@/components/PIMTable/Pagination.vue' |
| | | import { ref } from 'vue' |
| | | import { ElMessageBox } from "element-plus"; |
| | | import useUserStore from '@/store/modules/user' |
| | | import { userListNoPage } from "@/api/system/user.js"; |
| | | import { |
| | | ledgerListPage, |
| | | customerList, |
| | | addOrUpdateSalesLedger, |
| | | getSalesLedgerWithProducts, delLedger |
| | | } from "@/api/salesManagement/salesLedger.js"; |
| | | const userStore = useUserStore() |
| | | const { proxy } = getCurrentInstance() |
| | | const tableData = ref([]) |
| | | const productData = ref([]) |
| | | const selectedRows = ref([]) |
| | | const userList = ref([]) |
| | | const customerOption = ref([]) |
| | | const tableLoading = ref(false) |
| | | const page = reactive({ |
| | | current: 1, |
| | | size: 100, |
| | | }) |
| | | const total = ref(0) |
| | | const fileList = ref([]) |
| | | |
| | | // ç¨æ·ä¿¡æ¯è¡¨åå¼¹æ¡æ°æ® |
| | | const operationType = ref('') |
| | | const dialogFormVisible = ref(false) |
| | | const data = reactive({ |
| | | searchForm: { |
| | | customerName: '', |
| | | }, |
| | | form: { |
| | | salesContractNo: '', |
| | | salesman: '', |
| | | customerContractNo: '', |
| | | customerId: '', |
| | | projectName: '', |
| | | entryPerson: '', |
| | | entryDate: '', |
| | | maintenanceTime: '', |
| | | productData: [], |
| | | executionDate: '' |
| | | }, |
| | | rules: { |
| | | salesman: [{ required: true, message: "è¯·éæ©", trigger: "change" }], |
| | | customerContractNo: [{ required: true, message: "请è¾å
¥", trigger: "blur" }], |
| | | customerId: [{ required: true, message: "è¯·éæ©", trigger: "change" }], |
| | | projectName: [{ required: true, message: "请è¾å
¥", trigger: "blur" }], |
| | | entryPerson: [{ required: true, message: "è¯·éæ©", trigger: "change" }], |
| | | entryDate: [{ required: true, message: "è¯·éæ©", trigger: "change" }], |
| | | executionDate: [{ required: true, message: "è¯·éæ©", trigger: "change" }], |
| | | } |
| | | }) |
| | | const { searchForm, form, rules } = toRefs(data) |
| | | |
| | | // æ¥è¯¢å表 |
| | | /** æç´¢æé®æä½ */ |
| | | const handleQuery = () => { |
| | | page.current = 1 |
| | | getList() |
| | | } |
| | | const paginationChange = (obj) => { |
| | | page.current = obj.page; |
| | | page.size = obj.limit; |
| | | getList() |
| | | } |
| | | const getList = () => { |
| | | tableLoading.value = true |
| | | ledgerListPage({ ...searchForm.value, ...page }).then(res => { |
| | | tableLoading.value = false |
| | | tableData.value = res.records |
| | | tableData.value.map(item => { |
| | | item.children = [] |
| | | }) |
| | | total.value = res.total |
| | | }).catch(() => { |
| | | tableLoading.value = false |
| | | }) |
| | | } |
| | | const findNodeById = (nodes, productId) => { |
| | | for (let i = 0; i < nodes.length; i++) { |
| | | if (nodes[i].value === productId) { |
| | | return nodes[i].label; // æ¾å°èç¹ï¼è¿å该èç¹ |
| | | } |
| | | if (nodes[i].children && nodes[i].children.length > 0) { |
| | | const foundNode = findNodeById(nodes[i].children, productId); |
| | | if (foundNode) { |
| | | return foundNode.label; // å¨åèç¹ä¸æ¾å°ï¼è¿å该èç¹ |
| | | } |
| | | } |
| | | } |
| | | return null; // æ²¡ææ¾å°èç¹ï¼è¿ånull |
| | | }; |
| | | // è¡¨æ ¼éæ©æ°æ® |
| | | const handleSelectionChange = (selection) => { |
| | | |
| | | // è¿æ»¤æåæ°æ® |
| | | selectedRows.value = selection.filter(item => item.children !== undefined); |
| | | console.log('selection', selectedRows.value) |
| | | } |
| | | const expandedRowKeys = ref([]) |
| | | |
| | | // 主表åè®¡æ¹æ³ |
| | | const summarizeMainTable = (param) => { |
| | | return proxy.summarizeTable(param, ['contractAmount', 'taxInclusiveTotalPrice', 'taxExclusiveTotalPrice']); |
| | | }; |
| | | |
| | | // æå¼å¼¹æ¡ |
| | | const openForm = async (type, row) => { |
| | | operationType.value = type |
| | | form.value = {} |
| | | productData.value = [] |
| | | let userLists = await userListNoPage() |
| | | userList.value = userLists.data |
| | | customerList().then(res => { |
| | | customerOption.value = res |
| | | }) |
| | | console.log('userStore.id', userStore.id) |
| | | form.value.entryPerson = userStore.id |
| | | if (type === 'edit') { |
| | | currentId.value = row.id; |
| | | getSalesLedgerWithProducts({ id: row.id, type: 1 }).then(res => { |
| | | form.value = { ...res } |
| | | form.value.entryPerson = Number(res.entryPerson) |
| | | productData.value = form.value.productData |
| | | fileList.value = form.value.salesLedgerFiles |
| | | }) |
| | | } |
| | | // let userAll = await userStore.getInfo() |
| | | // userList.value.forEach(element => { |
| | | // if(userAll.user.nickName === element.nickName && userAll.user.userName === element.userName) { |
| | | // form.value.entryPerson = userAll.user.userId // 设置é»è®¤ä¸å¡å为å½åç¨æ· |
| | | // } |
| | | // }); |
| | | form.value.entryDate = getCurrentDate() // 设置é»è®¤å½å
¥æ¥æä¸ºå½åæ¥æ |
| | | dialogFormVisible.value = true |
| | | } |
| | | |
| | | // æäº¤è¡¨å |
| | | const submitForm = () => { |
| | | proxy.$refs["formRef"].validate(valid => { |
| | | if (valid) { |
| | | if (productData.value.length > 0) { |
| | | form.value.productData = proxy.HaveJson(productData.value) |
| | | } else { |
| | | proxy.$modal.msgWarning('请添å 产åä¿¡æ¯') |
| | | return |
| | | } |
| | | let tempFileIds = [] |
| | | if (fileList.value.length > 0) { |
| | | tempFileIds = fileList.value.map(item => item.tempId) |
| | | } |
| | | form.value.tempFileIds = tempFileIds |
| | | form.value.type = 1 |
| | | addOrUpdateSalesLedger(form.value).then(res => { |
| | | proxy.$modal.msgSuccess("æäº¤æå") |
| | | closeDia() |
| | | getList() |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | // å
³éå¼¹æ¡ |
| | | const closeDia = () => { |
| | | proxy.resetForm("formRef") |
| | | dialogFormVisible.value = false |
| | | } |
| | | |
| | | // å¯¼åº |
| | | const handleOut = () => { |
| | | ElMessageBox.confirm( |
| | | 'éä¸çå
容å°è¢«å¯¼åºï¼æ¯å¦ç¡®è®¤å¯¼åºï¼', |
| | | '导åº', { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning', |
| | | } |
| | | ).then(() => { |
| | | proxy.download("/sales/ledger/export", {}, 'åºåºå°è´¦.xlsx') |
| | | }).catch(() => { |
| | | proxy.$modal.msg("已忶") |
| | | }) |
| | | } |
| | | // å é¤ |
| | | const handleDelete = () => { |
| | | let ids = [] |
| | | if (selectedRows.value.length > 0) { |
| | | ids = selectedRows.value.map(item => item.id); |
| | | } else { |
| | | proxy.$modal.msgWarning('è¯·éæ©æ°æ®') |
| | | return |
| | | } |
| | | ElMessageBox.confirm( |
| | | 'éä¸çå
容å°è¢«å é¤ï¼æ¯å¦ç¡®è®¤å é¤ï¼', |
| | | '导åº', { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning', |
| | | } |
| | | ).then(() => { |
| | | delLedger(ids).then(res => { |
| | | proxy.$modal.msgSuccess("å 餿å") |
| | | getList() |
| | | }) |
| | | }).catch(() => { |
| | | proxy.$modal.msg("已忶") |
| | | }) |
| | | } |
| | | // è·åå½åæ¥æå¹¶æ ¼å¼å为 YYYY-MM-DD |
| | | function getCurrentDate() { |
| | | const today = new Date(); |
| | | const year = today.getFullYear(); |
| | | const month = String(today.getMonth() + 1).padStart(2, '0'); // æä»½ä»0å¼å§ |
| | | const day = String(today.getDate()).padStart(2, '0'); |
| | | return `${year}-${month}-${day}`; |
| | | } |
| | | onMounted(() => { |
| | | getList() |
| | | }) |
| | | </script> |
| | | |
| | | <style scoped lang="scss"></style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <div class="search_form"> |
| | | <div> |
| | | <span class="search_title">å§åï¼</span> |
| | | <el-input |
| | | v-model="searchForm.customerName" |
| | | style="width: 240px" |
| | | placeholder="请è¾å
¥åç§°æç´¢" |
| | | @change="handleQuery" |
| | | clearable |
| | | :prefix-icon="Search" |
| | | /> |
| | | <el-button type="primary" @click="handleQuery" style="margin-left: 10px">æç´¢</el-button> |
| | | </div> |
| | | <div> |
| | | <el-button type="primary" @click="openForm">æ°å¢å
¥è</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="table_list"> |
| | | <PIMTable :column="tableColumn" :tableData="tableData" :page="page" :isSelection="true" |
| | | :handleSelectionChange="handleSelectionChange" :tableLoading="tableLoading" @pagination="pagination" |
| | | :total="total"></PIMTable> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import {Search} from "@element-plus/icons-vue"; |
| | | import {ref} from "vue"; |
| | | |
| | | const data = reactive({ |
| | | searchForm: { |
| | | customerName: '', |
| | | }, |
| | | form: { |
| | | salesLedgerId: '', |
| | | customerName: '', |
| | | salesman: '', |
| | | projectName: '', |
| | | productData: [] |
| | | }, |
| | | rules: { |
| | | salesLedgerId: [{ required: true, message: "è¯·éæ©", trigger: "change" }] |
| | | } |
| | | }) |
| | | const { searchForm, form, rules } = toRefs(data) |
| | | const tableColumn = ref([ |
| | | { |
| | | label: 'ç¶æ', |
| | | prop: 'paymentDate', |
| | | dataType: 'tag', |
| | | formatData: (params) => { |
| | | if (params == 0) { |
| | | return 'å¨è'; |
| | | } else if (params == 1) { |
| | | return '离è'; |
| | | } else { |
| | | return null |
| | | } |
| | | }, |
| | | formatType: (params) => { |
| | | if (params == 0) { |
| | | return 'primary'; |
| | | } else if (params == 1) { |
| | | return 'danger'; |
| | | } else { |
| | | return null |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | label: 'åå·¥ç¼å·', |
| | | prop: 'supplierName', |
| | | }, |
| | | { |
| | | label: 'å§å', |
| | | prop: 'currentPaymentAmount', |
| | | }, |
| | | { |
| | | label: 'æ§å«', |
| | | prop: 'paymentMethod' |
| | | }, |
| | | { |
| | | label: 'ç±è´¯', |
| | | prop: 'registrant' |
| | | }, |
| | | { |
| | | label: 'å²ä½', |
| | | prop: 'registrationtDate' |
| | | }, |
| | | { |
| | | label: 'å®¶åºä½å', |
| | | prop: 'registrationtDate' |
| | | }, |
| | | { |
| | | label: '第ä¸å¦å', |
| | | prop: 'registrationtDate' |
| | | }, |
| | | { |
| | | label: 'ä¸ä¸', |
| | | prop: 'registrationtDate' |
| | | }, |
| | | { |
| | | label: '身份è¯å·', |
| | | prop: 'registrationtDate' |
| | | }, |
| | | { |
| | | label: 'å¹´é¾', |
| | | prop: 'registrationtDate' |
| | | }, |
| | | { |
| | | label: 'èç³»çµè¯', |
| | | prop: 'registrationtDate' |
| | | }, |
| | | { |
| | | label: 'ç´§æ¥è系人', |
| | | prop: 'registrationtDate' |
| | | }, |
| | | { |
| | | label: 'èç³»çµè¯', |
| | | prop: 'registrationtDate' |
| | | }, |
| | | { |
| | | label: 'ååå¹´é', |
| | | prop: 'registrationtDate' |
| | | }, |
| | | { |
| | | label: 'ååå¼å§æ¥æ', |
| | | prop: 'registrationtDate' |
| | | }, |
| | | { |
| | | label: 'ååç»ææ¥æ', |
| | | prop: 'registrationtDate' |
| | | }, |
| | | ]) |
| | | const tableData = ref([]) |
| | | const selectedRows = ref([]) |
| | | const tableLoading = ref(false) |
| | | const page = reactive({ |
| | | current: 1, |
| | | size: 100, |
| | | }) |
| | | const total = ref(0) |
| | | |
| | | |
| | | // æ¥è¯¢å表 |
| | | /** æç´¢æé®æä½ */ |
| | | const handleQuery = () => { |
| | | page.current = 1 |
| | | getList() |
| | | } |
| | | const pagination = (obj) => { |
| | | page.current = obj.page; |
| | | page.size = obj.limit; |
| | | getList() |
| | | } |
| | | const getList = () => { |
| | | tableLoading.value = true |
| | | ledgerListPage({...searchForm.value, ...page}).then(res => { |
| | | tableLoading.value = false |
| | | tableData.value = res.records; |
| | | total.value = res.total |
| | | }) |
| | | } |
| | | // è¡¨æ ¼éæ©æ°æ® |
| | | const handleSelectionChange = (selection) => { |
| | | console.log('selection', selection) |
| | | selectedRows.value = selection.filter(item => item.salesContractNo !== undefined); |
| | | } |
| | | |
| | | // æå¼å¼¹æ¡ |
| | | const openForm = () => { |
| | | |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
| | |
| | | <div class="search_form"> |
| | | <div> |
| | | <span class="search_title">客æ·åç§°ï¼</span> |
| | | <el-input |
| | | v-model="searchForm.customerName" |
| | | style="width: 240px" |
| | | placeholder="请è¾å
¥" |
| | | @change="handleQuery" |
| | | clearable |
| | | prefix-icon="Search" |
| | | /> |
| | | <el-input v-model="searchForm.customerName" style="width: 240px" placeholder="请è¾å
¥" @change="handleQuery" |
| | | clearable prefix-icon="Search" /> |
| | | <el-button type="primary" @click="handleQuery" style="margin-left: 10px">æç´¢</el-button> |
| | | </div> |
| | | <div> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="table_list"> |
| | | <el-table :data="tableData" border v-loading="tableLoading" |
| | | @selection-change="handleSelectionChange" |
| | | :expand-row-keys="expandedRowKeys" |
| | | :row-key="row => row.id" |
| | | show-summary |
| | | style="width: 100%" |
| | | :summary-method="summarizeMainTable" |
| | | @expand-change="expandChange" |
| | | height="calc(100vh - 18.5em)"> |
| | | <el-table :data="tableData" border v-loading="tableLoading" @selection-change="handleSelectionChange" |
| | | :expand-row-keys="expandedRowKeys" :row-key="row => row.id" show-summary style="width: 100%" |
| | | :summary-method="summarizeMainTable" @expand-change="expandChange" height="calc(100vh - 18.5em)"> |
| | | <el-table-column align="center" type="selection" width="55" /> |
| | | <el-table-column type="expand"> |
| | | <template #default="props"> |
| | | <el-table :data="props.row.children" border |
| | | show-summary |
| | | :summary-method="summarizeChildrenTable"> |
| | | <el-table :data="props.row.children" border show-summary :summary-method="summarizeChildrenTable"> |
| | | <el-table-column align="center" label="åºå·" type="index" width="60" /> |
| | | <el-table-column label="产å大类" prop="productCategory" /> |
| | | <el-table-column label="è§æ ¼åå·" prop="specificationModel" /> |
| | |
| | | <el-table-column label="客æ·åç§°" prop="customerName" width="300" show-overflow-tooltip/> |
| | | <el-table-column label="ä¸å¡å" prop="salesman" width="100" show-overflow-tooltip/> |
| | | <el-table-column label="项ç®åç§°" prop="projectName" width="180" show-overflow-tooltip/> |
| | | <el-table-column label="ååéé¢(å
)" prop="contractAmount" width="180" show-overflow-tooltip :formatter="formattedNumber"/> |
| | | <el-table-column label="ååéé¢(å
)" prop="contractAmount" width="180" show-overflow-tooltip |
| | | :formatter="formattedNumber" /> |
| | | <el-table-column label="å½å
¥äºº" prop="entryPersonName" width="100" show-overflow-tooltip/> |
| | | <el-table-column label="å½å
¥æ¥æ" prop="entryDate" width="120" show-overflow-tooltip/> |
| | | <el-table-column label="ç¾è®¢æ¥æ" prop="executionDate" width="120" show-overflow-tooltip/> |
| | |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination v-show="total > 0" :total="total" layout="total, sizes, prev, pager, next, jumper" :page="page.current" |
| | | :limit="page.size" @pagination="paginationChange" /> |
| | | <pagination v-show="total > 0" :total="total" layout="total, sizes, prev, pager, next, jumper" |
| | | :page="page.current" :limit="page.size" @pagination="paginationChange" /> |
| | | </div> |
| | | <el-dialog v-model="dialogFormVisible" :title="operationType === 'add' ? 'æ°å¢éå®å°è´¦é¡µé¢' : 'ç¼è¾éå®å°è´¦é¡µé¢'" width="70%" @close="closeDia"> |
| | | <el-dialog v-model="dialogFormVisible" :title="operationType === 'add' ? 'æ°å¢éå®å°è´¦é¡µé¢' : 'ç¼è¾éå®å°è´¦é¡µé¢'" width="70%" |
| | | @close="closeDia"> |
| | | <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef"> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | |
| | | <el-col :span="12"> |
| | | <el-form-item label="ä¸å¡åï¼" prop="salesman"> |
| | | <el-select v-model="form.salesman" placeholder="è¯·éæ©" clearable> |
| | | <el-option v-for="item in userList" :key="item.nickName" :label="item.nickName" :value="item.nickName"/> |
| | | <el-option v-for="item in userList" :key="item.nickName" :label="item.nickName" |
| | | :value="item.nickName" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å½å
¥æ¥æï¼" prop="entryDate"> |
| | | <el-date-picker |
| | | style="width: 100%" |
| | | v-model="form.entryDate" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | type="date" |
| | | placeholder="è¯·éæ©" |
| | | clearable |
| | | disabled |
| | | /> |
| | | <el-date-picker style="width: 100%" v-model="form.entryDate" value-format="YYYY-MM-DD" format="YYYY-MM-DD" |
| | | type="date" placeholder="è¯·éæ©" clearable disabled /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ç¾è®¢æ¥æï¼" prop="executionDate"> |
| | | <el-date-picker |
| | | style="width: 100%" |
| | | v-model="form.executionDate" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | type="date" |
| | | placeholder="è¯·éæ©" |
| | | clearable |
| | | /> |
| | | <el-date-picker style="width: 100%" v-model="form.executionDate" value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" type="date" placeholder="è¯·éæ©" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | <el-button plain type="danger" @click="deleteProduct">å é¤</el-button> |
| | | </el-form-item> |
| | | </el-row> |
| | | <el-table :data="productData" border @selection-change="productSelected" show-summary :summary-method="summarizeMainTable"> |
| | | <el-table :data="productData" border @selection-change="productSelected" show-summary |
| | | :summary-method="summarizeMainTable"> |
| | | <el-table-column align="center" type="selection" width="55" /> |
| | | <el-table-column align="center" label="åºå·" type="index" width="60" /> |
| | | <el-table-column label="产å大类" prop="productCategory" /> |
| | |
| | | <el-row :gutter="30"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="éä»¶ææï¼" prop="remark"> |
| | | <el-upload |
| | | v-model:file-list="fileList" |
| | | :action="upload.url" |
| | | multiple |
| | | ref="fileUpload" |
| | | auto-upload |
| | | :headers="upload.headers" |
| | | :before-upload="handleBeforeUpload" |
| | | :on-error="handleUploadError" |
| | | :on-success="handleUploadSuccess" |
| | | :on-remove="handleRemove" |
| | | > |
| | | <el-upload v-model:file-list="fileList" :action="upload.url" multiple ref="fileUpload" auto-upload |
| | | :headers="upload.headers" :before-upload="handleBeforeUpload" :on-error="handleUploadError" |
| | | :on-success="handleUploadSuccess" :on-remove="handleRemove"> |
| | | <el-button type="primary">ä¸ä¼ </el-button> |
| | | <template #tip> |
| | | <div class="el-upload__tip"> |
| | |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <el-dialog v-model="productFormVisible" :title="productOperationType === 'add' ? 'æ°å¢äº§å' : 'ç¼è¾äº§å'" width="40%" @close="closeProductDia"> |
| | | <el-form :model="productForm" |
| | | label-width="140px" |
| | | label-position="top" |
| | | :rules="productRules" |
| | | ref="productFormRef"> |
| | | <el-dialog v-model="productFormVisible" :title="productOperationType === 'add' ? 'æ°å¢äº§å' : 'ç¼è¾äº§å'" width="40%" |
| | | @close="closeProductDia"> |
| | | <el-form :model="productForm" label-width="140px" label-position="top" :rules="productRules" ref="productFormRef"> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="产å大类ï¼" prop="productCategory"> |
| | | <!-- <el-select v-model="productForm.productCategory" placeholder="è¯·éæ©" clearable> |
| | | <el-option v-for="item in userList" :key="item.nickName" :label="item.nickName" :value="item.nickName"/> |
| | | </el-select> --> |
| | | <el-tree-select |
| | | v-model="productForm.productCategory" |
| | | placeholder="è¯·éæ©" clearable |
| | | check-strictly |
| | | @change="getModels" |
| | | :data="productOptions" |
| | | :render-after-expand="false" |
| | | style="width: 100%" |
| | | /> |
| | | <el-tree-select v-model="productForm.productCategory" placeholder="è¯·éæ©" clearable check-strictly |
| | | @change="getModels" :data="productOptions" :render-after-expand="false" style="width: 100%" /> |
| | | |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ°éï¼" prop="quantity"> |
| | | <el-input type="number" :step="0.1" :min="0" v-model="productForm.quantity" placeholder="请è¾å
¥" clearable @change="mathNum" /> |
| | | <el-input type="number" :step="0.1" :min="0" v-model="productForm.quantity" placeholder="请è¾å
¥" clearable |
| | | @change="mathNum" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | getList() |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | |
| | | </style> |
| | | <style scoped lang="scss"></style> |