| | |
| | | data: query |
| | | }) |
| | | } |
| | | |
| | | // æ¥è¯¢å·²ç»ç»å®å票çå¼ç¥¨å°è´¦ |
| | | export function bindInvoiceNoRegPage(query) { |
| | | return request({ |
| | | url: '/receiptPayment/bindInvoiceNoRegPage', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // å¼ç¥¨å°è´¦è¯¦æ
|
| | | export function invoiceInfo(query) { |
| | | return request({ |
| | | url: '/receiptPayment/invoiceInfo', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | // é¦é¡µæ¥å£ |
| | | import request from '@/utils/request' |
| | | |
| | | // æ¬æååéé¢ |
| | | export const getContractAmount = () => { |
| | | return request({ |
| | | url: '/sales/ledger/getContractAmount', |
| | | method: 'get' |
| | | }) |
| | | } |
| | | // æ¬æå¼ç¥¨éé¢ |
| | | export const getInvoiceAmount = () => { |
| | | return request({ |
| | | url: '/invoiceLedger/getInvoiceAmount', |
| | | method: 'get' |
| | | }) |
| | | } |
| | | // æ¬æåæ¬¾éé¢ |
| | | export const getReceiptAmount = () => { |
| | | return request({ |
| | | url: '/receiptPayment/getReceiptAmount', |
| | | method: 'get' |
| | | }) |
| | | } |
| | | // 客æ·ååéé¢TOP5ç»è®¡ |
| | | export const getTopFiveList = () => { |
| | | return request({ |
| | | url: '/sales/ledger/getTopFiveList', |
| | | method: 'get' |
| | | }) |
| | | } |
| | | // 忬¾é¥¼ç¶å¾ |
| | | export const getAmountMouth = () => { |
| | | return request({ |
| | | url: '/receiptPayment/getAmountMouth', |
| | | method: 'get' |
| | | }) |
| | | } |
| | | // 仿¬¾é¥¼ç¶å¾ |
| | | export const paymentMonthList = () => { |
| | | return request({ |
| | | url: '/purchase/paymentRegistration/paymentMonthList', |
| | | method: 'get' |
| | | }) |
| | | } |
| | | // çº¿å½¢å¾ |
| | | export const getAmountHalfYear = () => { |
| | | return request({ |
| | | url: '/sales/ledger/getAmountHalfYear', |
| | | method: 'get' |
| | | }) |
| | | } |
| | |
| | | }, |
| | | lineColors: { |
| | | type: Array, |
| | | default: () => ['#A4EEDA', '#86C1F4', '#91A0FC', '#F6C18B', '#F09595'] |
| | | default: () => [] |
| | | }, |
| | | barColors: { |
| | | type: Array, |
| | | default: () => ['#A4EEDA', '#86C1F4', '#91A0FC', '#F6C18B', '#F09595'] |
| | | default: () => [] |
| | | }, |
| | | pieColors: { |
| | | type: Array, |
| | | default: () => ['#A4EEDA', '#86C1F4', '#91A0FC', '#F6C18B', '#F09595'] |
| | | default: () => [] |
| | | }, |
| | | loadingOption: { |
| | | type: Object, |
| | |
| | | } |
| | | }) |
| | | |
| | | import { watch } from 'vue' |
| | | |
| | | // Refs |
| | | const chartRef = ref(null) |
| | | let chartInstance = null |
| | | |
| | | // Methods |
| | | function generateChart(option) { |
| | | if (option.series && option.series.length > 0) { |
| | | option.series.forEach((s, index) => { |
| | | if (s.type === 'line') { |
| | | s.itemStyle = { |
| | | color: props.lineColors[index] || props.lineColors[0] |
| | | } |
| | | s.lineStyle = { |
| | | color: props.lineColors[index] || props.lineColors[0] |
| | | } |
| | | } else if (s.type === 'bar') { |
| | | s.itemStyle = { |
| | | color: props.barColors[index] || props.barColors[0] |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | const copiedOption = JSON.parse(JSON.stringify(option)) // â
æ·±æ·è´ |
| | | |
| | | chartInstance.setOption(option) |
| | | // if (copiedOption.series && copiedOption.series.length > 0) { |
| | | // copiedOption.series.forEach((s, index) => { |
| | | // if (s.type === 'line') { |
| | | // s.itemStyle = { |
| | | // color: props.lineColors[index] || props.lineColors[0] |
| | | // } |
| | | // s.lineStyle = { |
| | | // color: props.lineColors[index] || props.lineColors[0] |
| | | // } |
| | | // } else if (s.type === 'bar') { |
| | | // s.itemStyle = { |
| | | // color: props.barColors[index] || props.barColors[0] |
| | | // } |
| | | // } |
| | | // }) |
| | | // } |
| | | |
| | | chartInstance.setOption(copiedOption) |
| | | } |
| | | |
| | | function renderChart() { |
| | |
| | | }) |
| | | |
| | | // Watch all reactive props that affect the chart |
| | | watchEffect(() => { |
| | | // é¿å
å¨ mounted å触å |
| | | if (chartInstance) { |
| | | renderChart() |
| | | } |
| | | }, { |
| | | flush: 'post' |
| | | }) |
| | | watch( |
| | | () => [props.xAxis, props.series], |
| | | () => { |
| | | if (chartInstance) { |
| | | renderChart() |
| | | } |
| | | }, |
| | | { deep: true, immediate: true } |
| | | ) |
| | | </script> |
| | |
| | | app.config.globalProperties.addDateRange = addDateRange
|
| | | app.config.globalProperties.selectDictLabel = selectDictLabel
|
| | | app.config.globalProperties.selectDictLabels = selectDictLabels
|
| | | app.config.globalProperties.javaApi = 'http://192.168.1.35:8080'
|
| | | app.config.globalProperties.javaApi = 'http://114.132.189.42:7003'
|
| | | app.config.globalProperties.HaveJson = (val) => {
|
| | | return JSON.parse(JSON.stringify(val));
|
| | | };
|
| | |
| | | <template>
|
| | | <div class="app-container home">
|
| | | <div>
|
| | | <div style="display: flex;">
|
| | | <div>
|
| | | <div class="card-top-left">
|
| | | <div class="title">
|
| | |
| | | <div class="card-group">
|
| | | <div class="info-card">
|
| | | <div class="info-message">
|
| | | <div class="info-number">6789,000</div>
|
| | | <div class="info-number">{{contractAmount}}</div>
|
| | | <div class="info-title">ååéé¢(å
)</div>
|
| | | </div>
|
| | | <img src="@/assets/images/icon1.png" alt="" style="width: 63px;height: 63px">
|
| | | </div>
|
| | | <div class="info-card1">
|
| | | <div class="info-message">
|
| | | <div class="info-number">6789,000</div>
|
| | | <div class="info-number">{{invoiceAmount}}</div>
|
| | | <div class="info-title">å¼ç¥¨éé¢(å
)</div>
|
| | | </div>
|
| | | <img src="@/assets/images/icon2.png" alt="" style="width: 63px;height: 63px">
|
| | | </div>
|
| | | <div class="info-card2">
|
| | | <div class="info-message">
|
| | | <div class="info-number">6789,000</div>
|
| | | <div class="info-number">{{receiptAmount}}</div>
|
| | | <div class="info-title">忬¾éé¢(å
)</div>
|
| | | </div>
|
| | | <img src="@/assets/images/icon%203.png" alt="" style="width: 63px;height: 63px">
|
| | |
| | | </div>
|
| | | <div class="info-message2">
|
| | | <div class="info-message1">
|
| | | <div class="pie-title">æ¬æåæ¬¾æ°é</div>
|
| | | <div class="pie-info"><span class="pie-number">8,000</span>å
<span class="pie-number">15.0</span>%</div>
|
| | | <div class="pie-title">æ¬æåæ¬¾éé¢</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="pie-info"><span class="pie-number">8,000</span>å
<span class="pie-number">15.0</span>%</div>
|
| | | <div class="pie-info"><span class="pie-number">{{contractAmountMonth}}</span>å
</div>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | |
| | | :options="options"
|
| | | :legend="pieLegend"
|
| | | :chartStyle="chartStyle"
|
| | | :series="materialPieSeries"
|
| | | :tooltip="pieTooltip"></Echarts>
|
| | | :series="materialPieSeries1"
|
| | | :tooltip="pieTooltip1"></Echarts>
|
| | | </div>
|
| | | <div class="info-message2">
|
| | | <div class="info-message1">
|
| | | <div class="pie-title">æ¬æåæ¬¾æ°é</div>
|
| | | <div class="pie-info"><span class="pie-number">8,000</span>å
<span class="pie-number">15.0</span>%</div>
|
| | | <div class="pie-title1">æ¬æä»æ¬¾éé¢</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-title">åºæ¶æ¬¾éé¢</div>
|
| | | <div class="pie-info"><span class="pie-number">8,000</span>å
<span class="pie-number">15.0</span>%</div>
|
| | | <div class="pie-title1">åºä»æ¬¾éé¢</div>
|
| | | <div class="pie-info"><span class="pie-number1">{{payableAmount}}</span>å
</div>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | |
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div></div>
|
| | | <div>
|
| | | <div class="card-top-right">
|
| | | <div class="title">
|
| | | <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>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div>
|
| | | |
| | | <div>
|
| | | <div class="card-bottom">
|
| | | <div class="title">
|
| | | <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>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script setup name="Index">
|
| | | const { proxy } = getCurrentInstance()
|
| | | import * as echarts from 'echarts';
|
| | | import Echarts from "@/components/Echarts/echarts.vue";
|
| | | import {
|
| | | getAmountHalfYear,
|
| | | getAmountMouth,
|
| | | getContractAmount,
|
| | | getInvoiceAmount,
|
| | | getReceiptAmount,
|
| | | getTopFiveList, paymentMonthList
|
| | | } from "@/api/viewIndex.js";
|
| | |
|
| | | const pieLegend = reactive({
|
| | | show: false,
|
| | | })
|
| | | const contractAmount = ref(0)
|
| | | const invoiceAmount = ref(0)
|
| | | const receiptAmount = ref(0)
|
| | | const receiveAmount = ref(0)
|
| | | const contractAmountMonth = ref(0)
|
| | | const receiveAmountPercentage = ref(0)
|
| | | const paymentAmount = ref(0)
|
| | | const payableAmount = ref(0)
|
| | | const payableAmountPercentage = ref(0)
|
| | | const options = reactive({
|
| | | graphic: {
|
| | | type: 'circle',
|
| | |
| | | shape: {
|
| | | r: '70%' // åå½¢åå¾ä¸é¥¼å¾å¤åç¸å
|
| | | },
|
| | | style: {
|
| | | fill: 'none',
|
| | | stroke: '#ccc', // ç°è²è¾¹æ¡
|
| | | lineWidth: 2
|
| | | },
|
| | | z: -10 // ç¡®ä¿è¾¹æ¡å¨é¥¼å¾ä¸é¢
|
| | | }
|
| | | })
|
| | | const pieTooltip = reactive({
|
| | | trigger: 'item',
|
| | | formatter: function (params) {
|
| | | // å¨æçææç¤ºä¿¡æ¯ï¼åºäºæ°æ®é¡¹ç name 屿§
|
| | | const description = params.name === 'æ¬æåæ¬¾æ°é' ? 'æ¬æåæ¬¾æ°é' : 'åºæ¶æ¬¾éé¢';
|
| | | const description = params.name === 'æ¬æåæ¬¾éé¢' ? 'æ¬æåæ¬¾éé¢' : 'åºæ¶æ¬¾éé¢';
|
| | | return `${description} ${formatNumber(params.value)}å
${params.percent}%`;
|
| | | },
|
| | | position: 'right'
|
| | | })
|
| | | const pieTooltip1 = reactive({
|
| | | trigger: 'item',
|
| | | formatter: function (params) {
|
| | | // å¨æçææç¤ºä¿¡æ¯ï¼åºäºæ°æ®é¡¹ç name 屿§
|
| | | const description = params.name === 'æ¬æä»æ¬¾éé¢' ? 'æ¬æä»æ¬¾éé¢' : 'åºä»æ¬¾éé¢';
|
| | | return `${description} ${formatNumber(params.value)}å
${params.percent}%`;
|
| | | },
|
| | | position: 'right'
|
| | |
| | | show:false
|
| | | },
|
| | | data: [
|
| | | { value: 0, name: 'æ¬æåæ¬¾æ°é', itemStyle: { color: '#2D99FF' } },
|
| | | { value: 0, name: 'æ¬æåæ¬¾éé¢', itemStyle: { color: '#2D99FF' } },
|
| | | { value: 0, name: 'åºæ¶æ¬¾éé¢', itemStyle: { color: '#D4DDFF' } },
|
| | | ]
|
| | | }
|
| | | ])
|
| | | const materialPieSeries1 = ref([
|
| | | {
|
| | | type: 'pie',
|
| | | radius: '92%',
|
| | | avoidLabelOverlap: false,
|
| | | itemStyle: {
|
| | | borderColor: '#fff',
|
| | | borderWidth: 2
|
| | | },
|
| | | label: {
|
| | | show:false
|
| | | },
|
| | | data: [
|
| | | { value: 0, name: 'æ¬æä»æ¬¾éé¢', itemStyle: { color: '#1EBFAC' } },
|
| | | { value: 0, name: 'åºä»æ¬¾éé¢', itemStyle: { color: '#D0EFE1' } },
|
| | | ]
|
| | | }
|
| | | ])
|
| | |
| | | width: '150%',
|
| | | height: '120%' // 设置å¾è¡¨å®¹å¨çé«åº¦
|
| | | }
|
| | | const chartStyle1 = {
|
| | | width: '100%',
|
| | | height: '100%' // 设置å¾è¡¨å®¹å¨çé«åº¦
|
| | | }
|
| | | const grid = {
|
| | | show: false
|
| | | }
|
| | | const tooltip = {
|
| | | trigger: 'axis',
|
| | | axisPointer: {
|
| | | type: 'shadow'
|
| | | }
|
| | | }
|
| | | const tooltipLine = {
|
| | | trigger: 'axis',
|
| | | }
|
| | | const yAxis1 = ref([
|
| | | {
|
| | | type: 'value',
|
| | | }
|
| | | ])
|
| | | const xAxis1 = ref([
|
| | | {
|
| | | type: 'category',
|
| | | data: []
|
| | | }
|
| | | ])
|
| | | const yAxis2 = ref([
|
| | | {
|
| | | type: 'value',
|
| | | }
|
| | | ])
|
| | | const xAxis2 = ref([
|
| | | {
|
| | | type: 'category',
|
| | | data: []
|
| | | }
|
| | | ])
|
| | | const barLegend = reactive({})
|
| | | const barSeries = ref([
|
| | | {
|
| | | type: 'bar',
|
| | | data: [],
|
| | | label: {
|
| | | show: true
|
| | | },
|
| | | },
|
| | | ])
|
| | | const lineSeries = ref([
|
| | | {
|
| | | type: 'line',
|
| | | data: [],
|
| | | label: {
|
| | | show: true
|
| | | },
|
| | | },
|
| | | ])
|
| | | // ååéé¢
|
| | | const getContractAmountNum = () => {
|
| | | getContractAmount().then((res) => {
|
| | | contractAmount.value = res.data
|
| | | })
|
| | | }
|
| | | // å¼ç¥¨éé¢
|
| | | const getInvoiceAmountNum = () => {
|
| | | getInvoiceAmount().then((res) => {
|
| | | invoiceAmount.value = res.data
|
| | | })
|
| | | }
|
| | | // 忬¾éé¢
|
| | | const getReceiptAmountNum = () => {
|
| | | getReceiptAmount().then((res) => {
|
| | | receiptAmount.value = res.data
|
| | | })
|
| | | }
|
| | | // æå款éé¢é¥¼å¾
|
| | | const getAmountMouthNum = () => {
|
| | | getAmountMouth().then((res) => {
|
| | | receiveAmount.value = res.data.receiveAmount
|
| | | contractAmountMonth.value = res.data.contractAmount
|
| | | const percentage = (receiveAmount.value / contractAmountMonth.value) * 100;
|
| | | receiveAmountPercentage.value = percentage.toFixed(2)
|
| | | materialPieSeries.value[0].data[0].value = receiveAmount.value
|
| | | materialPieSeries.value[0].data[1].value = contractAmountMonth.value
|
| | | })
|
| | | }
|
| | | // æä»æ¬¾éé¢é¥¼å¾
|
| | | const paymentMonthListNum = () => {
|
| | | paymentMonthList().then((res) => {
|
| | | paymentAmount.value = res.data.paymentAmount
|
| | | payableAmount.value = res.data.payableAmount
|
| | | const percentage = (paymentAmount.value / payableAmount.value) * 100;
|
| | | payableAmountPercentage.value = percentage.toFixed(2)
|
| | | materialPieSeries1.value[0].data[0].value = paymentAmount.value
|
| | | materialPieSeries1.value[0].data[1].value = payableAmount.value
|
| | | })
|
| | | }
|
| | | // 客æ·top5
|
| | | const getTopFiveListNum = async () => {
|
| | | const res = await getTopFiveList()
|
| | | const customerName = []
|
| | | const totalAmount = []
|
| | | res.data.forEach(item => {
|
| | | customerName.push(item.customerName)
|
| | | totalAmount.push(item.totalAmount)
|
| | | })
|
| | | // æ£ç¡®ååºå¼èµå¼ï¼å建æ°ç xAxis å series 对象
|
| | | xAxis1.value = [
|
| | | {
|
| | | type: 'category',
|
| | | data: customerName
|
| | | }
|
| | | ]
|
| | | barSeries.value = [
|
| | | {
|
| | | type: 'bar',
|
| | | data: totalAmount,
|
| | | itemStyle: {
|
| | | color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
| | | { offset: 0, color: '#F7D2FF' },
|
| | | { offset: 1, color: '#826AF9' }
|
| | | ])
|
| | | },
|
| | | emphasis: {
|
| | | itemStyle: {
|
| | | color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
| | | { offset: 1, color: '#826AF9' }
|
| | | ])
|
| | | }
|
| | | },
|
| | | }
|
| | | ]
|
| | | }
|
| | | // 线形å¾
|
| | | const getAmountHalfYearNum = async () => {
|
| | | const res = await getAmountHalfYear()
|
| | | console.log(res)
|
| | | const monthName = []
|
| | | const receiptAmount = []
|
| | | const invoiceAmount = []
|
| | | res.data.forEach(item => {
|
| | | monthName.push(item.month)
|
| | | receiptAmount.push(item.receiptAmount)
|
| | | invoiceAmount.push(item.invoiceAmount)
|
| | | })
|
| | | // æ£ç¡®ååºå¼èµå¼ï¼å建æ°ç xAxis å series 对象
|
| | | xAxis2.value = [
|
| | | {
|
| | | type: 'category',
|
| | | data: monthName
|
| | | }
|
| | | ]
|
| | | lineSeries.value = [
|
| | | {
|
| | | name: 'å¼ç¥¨',
|
| | | type: 'line',
|
| | | data: receiptAmount,
|
| | | smooth: true,
|
| | | stack: 'Total',
|
| | | areaStyle: {
|
| | | color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
| | | {
|
| | | offset: 0,
|
| | | color: 'rgba(131, 207, 255, 1)'
|
| | | },
|
| | | {
|
| | | offset: 1,
|
| | | color: 'rgba(186, 228, 255, 1)'
|
| | | }
|
| | | ])
|
| | | },
|
| | | // 设置å°åç¹çé¢è²
|
| | | itemStyle: {
|
| | | color: '#2D99FF', // å°åç¹é¢è²è®¾ç½®ä¸º#2D99FF
|
| | | borderColor: '#2D99FF' // 妿éè¦çè¯ï¼å¯ä»¥è®¾ç½®è¾¹æ¡é¢è²
|
| | | },
|
| | | emphasis: {
|
| | | focus: 'series'
|
| | | },
|
| | | lineStyle: {
|
| | | width: 0
|
| | | },
|
| | | showSymbol: false,
|
| | | },
|
| | | {
|
| | | name: '忬¾',
|
| | | type: 'line',
|
| | | data: invoiceAmount,
|
| | | smooth: true,
|
| | | stack: 'Total',
|
| | | lineStyle: {
|
| | | width: 0
|
| | | },
|
| | | // 设置å°åç¹çé¢è²
|
| | | itemStyle: {
|
| | | color: '#83CFFF', // å°åç¹é¢è²è®¾ç½®ä¸º#83CFFF
|
| | | borderColor: '#83CFFF' // 妿éè¦çè¯ï¼å¯ä»¥è®¾ç½®è¾¹æ¡é¢è²
|
| | | },
|
| | | showSymbol: false,
|
| | | areaStyle: {
|
| | | color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
| | | {
|
| | | offset: 0,
|
| | | color: 'rgba(54, 153, 255, 1)'
|
| | | },
|
| | | {
|
| | | offset: 1,
|
| | | color: 'rgba(89, 169, 254, 1)'
|
| | | }
|
| | | ])
|
| | | },
|
| | | emphasis: {
|
| | | focus: 'series'
|
| | | },
|
| | | }
|
| | | ]
|
| | | }
|
| | | getContractAmountNum()
|
| | | getInvoiceAmountNum()
|
| | | getReceiptAmountNum()
|
| | | getTopFiveListNum()
|
| | | getAmountMouthNum()
|
| | | paymentMonthListNum()
|
| | | getAmountHalfYearNum()
|
| | | </script>
|
| | |
|
| | | <style scoped>
|
| | |
| | | background: #fff;
|
| | | height: 24vh;
|
| | | width: 56vw;
|
| | | margin-bottom: 20px;
|
| | | }
|
| | | .card-top-right {
|
| | | padding: 16px;
|
| | | background: #fff;
|
| | | height: 50.6vh;
|
| | | width: 28vw;
|
| | | margin-bottom: 20px;
|
| | | margin-left: 20px;
|
| | | }
|
| | | .card-bottom {
|
| | | padding: 16px;
|
| | | background: #fff;
|
| | | height: 34vh;
|
| | | width: 85.2vw;
|
| | | margin-bottom: 20px;
|
| | | }
|
| | | .title {
|
| | |
| | | left: 0; /* å®ä½å°å·¦è¾¹ */
|
| | | top: 9px; /* åç´å±
ä¸å¯¹é½ï¼æ ¹æ®è¡é«è°æ´ */
|
| | | }
|
| | | .pie-title1 {
|
| | | font-size: 14px;
|
| | | line-height: 24px;
|
| | | color: #1EBFAC;
|
| | | padding-left: 16px;
|
| | | position: relative;
|
| | | }
|
| | | .pie-title1::before {
|
| | | content: '';
|
| | | width: 6px; /* èç¹ç宽度 */
|
| | | height: 6px; /* èç¹çé«åº¦ */
|
| | | background-color: #1EBFAC; /* èç¹çé¢è² */
|
| | | border-radius: 50%; /* å°æ£æ¹å½¢å为åå½¢ */
|
| | | position: absolute;
|
| | | left: 0; /* å®ä½å°å·¦è¾¹ */
|
| | | top: 9px; /* åç´å±
ä¸å¯¹é½ï¼æ ¹æ®è¡é«è°æ´ */
|
| | | }
|
| | | .pie-info {
|
| | | padding-left: 16px;
|
| | | font-size: 14px;
|
| | |
| | | .pie-number {
|
| | | color: #2853FD;
|
| | | }
|
| | | .info-group {
|
| | | display: flex;
|
| | | flex-direction: column;
|
| | | justify-content: center;
|
| | | align-items: center;
|
| | | .pie-number1 {
|
| | | color: #1EBFAC;
|
| | | }
|
| | | </style>
|
| | |
|
| | |
| | | <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="éè´ååå·11111ï¼" prop="purchaseLedgerId"> |
| | | <el-form-item label="éè´ååå·ï¼" prop="purchaseLedgerId"> |
| | | <el-select v-model="form.purchaseLedgerId" placeholder="è¯·éæ©" clearable @change="setInfo" |
| | | :disabled="operationType === 'edit'"> |
| | | <el-option v-for="item in purchaseLedgerList" :key="item.id" :label="item.purchaseContractNumber" |
| | |
| | | >æç´¢</el-button |
| | | > |
| | | </div> |
| | | <div> |
| | | </div> |
| | | <div></div> |
| | | </div> |
| | | <el-row> |
| | | <el-col :span="14"> |
| | | <div class="table_list"> |
| | | <PIMTable |
| | | :column="tableColumn" |
| | | :tableData="tableData" |
| | | :page="page" |
| | | :isSelection="false" |
| | | :handleSelectionChange="handleSelectionChange" |
| | | :tableLoading="tableLoading" |
| | | @pagination="pagination" |
| | | :total="total" |
| | | :rowClick="rowClick" |
| | | :isShowSummary="isShowSummary" |
| | | <el-table |
| | | ref="multipleTable" |
| | | v-loading="tableLoading" |
| | | :data="tableData" |
| | | :header-cell-style="{ background: '#F0F1F5', color: '#333333' }" |
| | | height="calc(100vh - 18.5em)" |
| | | :highlight-current-row="true" |
| | | ></PIMTable> |
| | | style="width: 100%" |
| | | tooltip-effect="dark" |
| | | @row-click="rowClick" |
| | | :show-summary="isShowSummary" |
| | | class="lims-table" |
| | | > |
| | | <el-table-column |
| | | align="center" |
| | | label="åºå·" |
| | | type="index" |
| | | width="60" |
| | | /> |
| | | <el-table-column |
| | | v-for="(item, index) in tableColumn" |
| | | :key="index" |
| | | :column-key="item.columnKey" |
| | | :filter-method="item.filterHandler" |
| | | :filter-multiple="item.filterMultiple" |
| | | :filtered-value="item.filteredValue" |
| | | :filters="item.filters" |
| | | :fixed="item.fixed" |
| | | :label="item.label" |
| | | :prop="item.prop" |
| | | show-overflow-tooltip |
| | | :align="item.align" |
| | | :sortable="!!item.sortable" |
| | | :type="item.type" |
| | | :width="item.width" |
| | | > |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="10"> |
| | |
| | | <PIMTable |
| | | :column="tableColumnSon" |
| | | :tableData="tableDataSon" |
| | | :page="pageSon" |
| | | :isSelection="false" |
| | | :tableLoading="tableLoadingSon" |
| | | @pagination="paginationSon" |
| | | :total="totalSon" |
| | | :isShowSummary="isShowSummarySon" |
| | | ></PIMTable> |
| | | </div> |
| | | </el-col> |
| | | <div class="el-pagination"> |
| | | <pagination |
| | | v-show="total > 0" |
| | | @pagination="paginationSearch" |
| | | :total="total" |
| | | :layout="page.layout" |
| | | :page="page.current" |
| | | :limit="page.size" |
| | | /> |
| | | </div> |
| | | </el-row> |
| | | </div> |
| | | </template> |
| | |
| | | prop: "payableAmount", |
| | | }, |
| | | ]); |
| | | const tableData = ref([]); |
| | | const tableLoading = ref(false); |
| | | const data = reactive({ |
| | | searchForm: { |
| | |
| | | }); |
| | | const total = ref(0); |
| | | const isShowSummary = ref(true); |
| | | const tableData = ref([]); |
| | | const { searchForm } = toRefs(data); |
| | | |
| | | |
| | | import {getInfo} from "@/api/login.js"; |
| | | const rowClick = (row) => { |
| | | tableDataSon.value = Array.isArray(row.details) ? row.details : []; |
| | | }; |
| | | |
| | | |
| | | // 忍¡å |
| | | const tableColumnSon = ref([ |
| | | { |
| | |
| | | ]); |
| | | const tableDataSon = ref([]); |
| | | const tableLoadingSon = ref(false); |
| | | const pageSon = reactive({ |
| | | current: 1, |
| | | size: 10, |
| | | }); |
| | | const totalSon = ref(0); |
| | | const isShowSummarySon = ref(true); |
| | | const detailPageNum = ref(1); |
| | | const detailPageSize = ref(10); |
| | |
| | | page.current = 1; |
| | | getList(); |
| | | }; |
| | | const pagination = ({ current, limit }) => { |
| | | const paginationSearch = ({ current, limit }) => { |
| | | page.current = current; |
| | | page.size = limit; |
| | | getList(); |
| | | }; |
| | | const paginationSon = ({ current, limit }) => { |
| | | pageSon.current = current; |
| | | pageSon.size = limit; |
| | | tableDataSon.value = []; |
| | | getList(); |
| | | }; |
| | | const getList = () => { |
| | |
| | | ...searchForm.value, |
| | | ...page, |
| | | detailPageNum: detailPageNum.value, // æ°å¢ |
| | | detailPageSize: detailPageSize.value // æ°å¢ |
| | | detailPageSize: detailPageSize.value, // æ°å¢ |
| | | }).then((res) => { |
| | | let result = res.data; |
| | | tableLoading.value = false; |
| | |
| | | total.value = result.total || 0; |
| | | }); |
| | | }; |
| | | // è¡¨æ ¼éæ©æ°æ® |
| | | const handleSelectionChange = (selection) => { |
| | | selectedRows.value = selection; |
| | | }; |
| | | |
| | | getList(); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | /* éä¸æè¡æ¶çèæ¯è²*/ |
| | | /* .el-table__body tr.current-row > td { |
| | | color: #c0c0c0; |
| | | background: #F6F7FB !important; |
| | | } */ |
| | | .el-row { |
| | | .el-col-14 { |
| | | .table_list { |
| | |
| | | } |
| | | } |
| | | } |
| | | .el-pagination { |
| | | width: 100%; |
| | | height: 55px; |
| | | display: flex; |
| | | justify-content: flex-end; |
| | | float: right; |
| | | flex-direction: row; |
| | | align-items: center; |
| | | background: #fff; |
| | | margin: -20px 0 0 0; |
| | | padding: 0 20px; |
| | | } |
| | | .pagination-container { |
| | | margin-top: 0; |
| | | } |
| | | .table_list { |
| | | height: calc(100vh - 13.5em); |
| | | overflow: auto; |
| | | } |
| | | </style> |
| | |
| | | page.current = 1 |
| | | getList() |
| | | } |
| | | // å表åè®¡æ¹æ³ |
| | | const summarizeChildrenTable = (param) => { |
| | | return proxy.summarizeTable(param, ['taxInclusiveUnitPrice', 'taxInclusiveTotalPrice', 'taxExclusiveTotalPrice', 'ticketsNum', 'ticketsAmount', 'futureTickets', 'futureTicketsAmount'], { |
| | | ticketsNum: { noDecimal: true }, // ä¸ä¿çå°æ° |
| | | futureTickets: { noDecimal: true }, // ä¸ä¿çå°æ° |
| | | }); |
| | | }; |
| | | const paginationChange = ({ current, limit }) => { |
| | | page.current = current; |
| | | page.size = limit; |
| | |
| | | </div> |
| | | </div> |
| | | <div class="table_list"> |
| | | <PIMTable :column="tableColumn" :tableData="tableData" :page="page" :handleSelectionChange="handleSelectionChange" |
| | | <PIMTable :column="tableColumn" :tableData="tableData" :page="page" |
| | | :tableLoading="tableLoading" @pagination="pagination" :total="total"></PIMTable> |
| | | </div> |
| | | <el-dialog v-model="dialogFormVisible" :title="operationType === 'add' ? 'æ°å¢ä»æ¬¾ç»è®°' : 'ç¼è¾ä»æ¬¾ç»è®°'" width="60%" @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="purchaseLedgerId"> |
| | | <el-select v-model="form.purchaseLedgerId" placeholder="è¯·éæ©" clearable @change="setInfo" :disabled="operationType === 'edit'"> |
| | | <el-option v-for="item in purchaseLedgerList" :key="item.id" :label="item.purchaseContractNumber" :value="item.id"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="éå®ååå·ï¼" prop="salesContractNo"> |
| | | <el-input v-model="form.salesContractNo" placeholder="èªå¨å¡«å
" clearable disabled/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ä¾åºååç§°ï¼" prop="supplierName"> |
| | | <el-input v-model="form.supplierName" placeholder="èªå¨å¡«å
" clearable disabled/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å票å·ï¼" prop="invoiceNumber"> |
| | | <el-select v-model="form.invoiceNumber" placeholder="è¯·éæ©" clearable :disabled="operationType === 'edit'" @change="setInvoiceAmount"> |
| | | <el-option v-for="item in invoiceNumberList" :key="item.id" :label="item.invoiceNumber" :value="item.invoiceNumber"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å票éé¢(å
)ï¼" prop="invoiceAmount"> |
| | | <el-input type="number" :step="0.01" v-model="form.invoiceAmount" placeholder="èªå¨å¡«å
" clearable disabled/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ç¨ç(%)ï¼" prop="taxRate"> |
| | | <el-select v-model="form.taxRate" placeholder="è¯·éæ©" clearable :disabled="operationType === 'edit'"> |
| | | <el-option v-for="item in taxRateSelection" :key="item.value" :label="item.label" :value="item.value"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ¬æ¬¡ä»æ¬¾éé¢ï¼" prop="currentPaymentAmount"> |
| | | <el-input type="number" :step="0.01" v-model="form.currentPaymentAmount" placeholder="请è¾å
¥" clearable/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="仿¬¾å½¢å¼ï¼" prop="paymentMethod"> |
| | | <el-select v-model="form.paymentMethod" placeholder="è¯·éæ©" clearable> |
| | | <el-option label="çµæ±" value="çµæ±"/> |
| | | <el-option label="æ¿å
" value="æ¿å
"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ç»è®°äººï¼" prop="registrant"> |
| | | <el-input v-model="form.registrant" placeholder="请è¾å
¥" clearable disabled/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="仿¬¾æ¥æï¼" prop="paymentDate"> |
| | | <el-date-picker |
| | | disabled |
| | | style="width: 100%" |
| | | v-model="form.paymentDate" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | type="date" |
| | | placeholder="è¯·éæ©" |
| | | clearable |
| | | /> |
| | | </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> |
| | | |
| | |
| | | // è®¡ç®æ¬æ¬¡å¼ç¥¨éé¢ |
| | | row.currentInvoiceAmount = row.currentInvoiceNum * row.taxInclusiveUnitPrice |
| | | // è®¡ç®æªå¼ç¥¨æ° |
| | | row.noInvoiceNum = row.noInvoiceNum - row.currentInvoiceNum |
| | | row.noInvoiceNum = row.originalNoInvoiceNum - row.currentInvoiceNum |
| | | // è®¡ç®æªå¼ç¥¨éé¢ |
| | | row.noInvoiceAmount = row.noInvoiceNum * row.taxInclusiveUnitPrice |
| | | } |
| | |
| | | </div> |
| | | <div> |
| | | <el-button type="primary" @click="openForm('add')">æ°å¢å款</el-button> |
| | | <el-button type="danger" plain @click="handleDelete">å é¤</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="table_list"> |
| | |
| | | <el-table-column label="éå®ååå·" prop="salesContractNo" show-overflow-tooltip/> |
| | | <el-table-column label="客æ·ååå·" prop="customerContractNo" show-overflow-tooltip/> |
| | | <el-table-column label="客æ·åç§°" prop="customerName" show-overflow-tooltip/> |
| | | <el-table-column label="产å大类" prop="productCategory" show-overflow-tooltip/> |
| | | <el-table-column label="å票å·" prop="invoiceNo" show-overflow-tooltip/> |
| | | <el-table-column label="å票éé¢(å
)" prop="invoiceAmount" show-overflow-tooltip/> |
| | | <el-table-column label="å票éé¢(å
)" prop="invoiceTotal" show-overflow-tooltip/> |
| | | <el-table-column label="ç¨ç" prop="taxRate" show-overflow-tooltip/> |
| | | <el-table-column label="æ¬æ¬¡å款éé¢(å
)" prop="receiptPaymentAmount" show-overflow-tooltip/> |
| | | <el-table-column label="忬¾å½¢å¼" prop="receiptPaymentType" show-overflow-tooltip> |
| | | <template #default="scope"> |
| | | {{transferValue(scope.row.receiptPaymentType)}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="å¾
忬¾éé¢(å
)" prop="entryDate" 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-column label="忬¾éé¢(å
)" prop="receiptPaymentAmountTotal" show-overflow-tooltip/> |
| | | <el-table-column label="å¾
忬¾éé¢(å
)" prop="noReceiptAmount" show-overflow-tooltip/> |
| | | </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-dialog v-model="dialogFormVisible" title="æ°å¢å票å·é¡µé¢" 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="invoiceLedgerId"> |
| | | <el-select v-model="form.invoiceLedgerId" placeholder="è¯·éæ©" clearable @change="ledgerChange"> |
| | | <el-option v-for="item in invoiceLedgerList" :key="item.id" :label="item.salesContractNo + '(' + item.invoiceDate + ')' " :value="item.id"/> |
| | | </el-select> |
| | | <el-form-item label="éå®ååå·ï¼" prop="salesContractNo"> |
| | | <el-input v-model="form.salesContractNo" placeholder="èªå¨å¡«å
" disabled /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å票éé¢(å
)ï¼" prop="invoiceAmount"> |
| | | <el-input type="number" v-model="form.invoiceAmount" placeholder="èªå¨å¡«å
" :step="0.01" disabled/> |
| | | <el-form-item label="å票éé¢(å
)ï¼" prop="invoiceTotal"> |
| | | <el-input type="number" v-model="form.invoiceTotal" placeholder="èªå¨å¡«å
" :step="0.01" disabled/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | <script setup> |
| | | import pagination from '@/components/PIMTable/Pagination.vue' |
| | | import { ref } from 'vue' |
| | | import {ElMessageBox } from "element-plus"; |
| | | import { |
| | | invoiceLedgerListNoPage, |
| | | invoiceLedgerDetail |
| | | } from "../../../api/salesManagement/invoiceLedger.js"; |
| | | import { |
| | | receiptPaymentSaveOrUpdate, |
| | | receiptPaymentListPage, |
| | | receiptPaymentInfo, |
| | | receiptPaymentDel |
| | | bindInvoiceNoRegPage, |
| | | invoiceInfo |
| | | } from "../../../api/salesManagement/receiptPayment.js"; |
| | | const { proxy } = getCurrentInstance() |
| | | const tableData = ref([]) |
| | | const productData = ref([]) |
| | | const selectedRows = ref([]) |
| | | const tableLoading = ref(false) |
| | | const page = reactive({ |
| | |
| | | const total = ref(0) |
| | | |
| | | // ç¨æ·ä¿¡æ¯è¡¨åå¼¹æ¡æ°æ® |
| | | const operationType = ref('') |
| | | const dialogFormVisible = ref(false) |
| | | const data = reactive({ |
| | | searchForm: { |
| | | searchText: '', |
| | | }, |
| | | form: { |
| | | invoiceLedgerId: '', |
| | | salesContractNo: '', |
| | | customerName: '', |
| | | invoiceNo: '', |
| | | invoiceAmount: '', |
| | | invoiceTotal: '', |
| | | taxRate: '', |
| | | receiptPaymentAmount: '', |
| | | receiptPaymentType: '', |
| | |
| | | receiptPaymentDate: '' |
| | | }, |
| | | rules: { |
| | | invoiceLedgerId: [{ required: true, message: "è¯·éæ©", trigger: "change" }], |
| | | salesContractNo: [{ required: true, message: "è¯·éæ©", trigger: "change" }], |
| | | customerName: [{ required: true, message: "请è¾å
¥", trigger: "blur" }], |
| | | invoiceNo: [{ required: true, message: "è¯·éæ©", trigger: "change" }], |
| | | invoiceAmount: [{ required: true, message: "请è¾å
¥", trigger: "blur" }], |
| | | invoiceTotal: [{ required: true, message: "请è¾å
¥", trigger: "blur" }], |
| | | taxRate: [{ required: true, message: "è¯·éæ©", trigger: "change" }], |
| | | receiptPaymentAmount: [{ required: true, message: "è¯·éæ©", trigger: "change" }], |
| | | receiptPaymentType: [{ required: true, message: "è¯·éæ©", trigger: "change" }], |
| | |
| | | } |
| | | }) |
| | | const { searchForm, form, rules } = toRefs(data) |
| | | const currentId = ref('') |
| | | // å¼ç¥¨å°è´¦æ°ç» |
| | | const invoiceLedgerList = ref([]) |
| | | const { receipt_payment_type } = proxy.useDict("receipt_payment_type") |
| | | |
| | | // æ¥è¯¢å表 |
| | |
| | | } |
| | | const getList = () => { |
| | | tableLoading.value = true |
| | | receiptPaymentListPage({...searchForm.value, ...page}).then(res => { |
| | | bindInvoiceNoRegPage({...searchForm.value, ...page}).then(res => { |
| | | tableLoading.value = false |
| | | tableData.value = res.data.records |
| | | total.value = res.data.total |
| | |
| | | return sums; |
| | | }; |
| | | // æå¼å¼¹æ¡ |
| | | const openForm = (type, row) => { |
| | | operationType.value = type |
| | | const openForm = () => { |
| | | form.value = {} |
| | | productData.value = [] |
| | | invoiceLedgerListNoPage({}).then(res => { |
| | | invoiceLedgerList.value = res.data |
| | | }) |
| | | if (type === 'edit') { |
| | | currentId.value = row.id; |
| | | receiptPaymentInfo({id: row.id}).then(res => { |
| | | form.value = {...res.data} |
| | | }) |
| | | if(selectedRows.value.length !== 1) { |
| | | proxy.$modal.msgError("è¯·éæ©ä¸æ¡æ°æ®") |
| | | return |
| | | } |
| | | invoiceInfo({id: selectedRows.value[0].id}).then(res => { |
| | | form.value = {...res.data} |
| | | form.value.invoiceLedgerId = form.value.id |
| | | form.value.id = '' |
| | | }) |
| | | dialogFormVisible.value = true |
| | | } |
| | | // æäº¤è¡¨å |
| | |
| | | const closeDia = () => { |
| | | proxy.resetForm("formRef") |
| | | dialogFormVisible.value = false |
| | | } |
| | | // å é¤ |
| | | 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(() => { |
| | | receiptPaymentDel(ids).then(res => { |
| | | proxy.$modal.msgSuccess("å 餿å") |
| | | getList() |
| | | }) |
| | | }).catch(() => { |
| | | proxy.$modal.msg("已忶") |
| | | }) |
| | | } |
| | | // éå®å°è´¦çé |
| | | const ledgerChange = (val) => { |
| | | console.log('val', val) |
| | | if(val){ |
| | | invoiceLedgerDetail({id: val}).then(res => { |
| | | form.value.customerName = res.data.customerName, |
| | | form.value.invoiceNo= res.data.invoiceNo, |
| | | form.value.invoiceAmount= res.data.invoiceAmount, |
| | | form.value.taxRate= res.data.taxRate, |
| | | form.value.salesLedgerId= res.data.salesLedgerId, |
| | | form.value.customerId= res.data.customerId, |
| | | form.value.salesContractNo = res.data.salesContractNo |
| | | }) |
| | | }else { |
| | | form.value.customerName = '', |
| | | form.value.invoiceNo= '', |
| | | form.value.invoiceAmount= '', |
| | | form.value.taxRate= '', |
| | | form.value.salesLedgerId= '', |
| | | form.value.customerId= '', |
| | | form.value.salesContractNo= '' |
| | | } |
| | | } |
| | | // æ¶æ¬¾ç±»å«è½¬æ¢ |
| | | const transferValue = (val) => { |
| | | const findIndex = receipt_payment_type.value.findIndex(item => item.value === val); |
| | | if (findIndex > -1) { |
| | | return receipt_payment_type.value[findIndex].label |
| | | } |
| | | } |
| | | getList() |
| | | </script> |
| | |
| | | height="calc(100vh - 18.5em)"> |
| | | <el-table-column align="center" label="åºå·" type="index" width="60" /> |
| | | <el-table-column label="客æ·åç§°" prop="customerName" show-overflow-tooltip/> |
| | | <el-table-column label="å¼ç¥¨éé¢" prop="invoiceAmount" show-overflow-tooltip/> |
| | | <el-table-column label="å¼ç¥¨éé¢" prop="invoiceTotal" show-overflow-tooltip/> |
| | | <el-table-column label="忬¾éé¢" prop="receiptPaymentAmount" show-overflow-tooltip/> |
| | | <el-table-column label="æªå款éé¢" prop="unReceiptPaymentAmount" show-overflow-tooltip/> |
| | | </el-table> |
| | |
| | | <el-table-column align="center" label="åºå·" type="index" width="60" /> |
| | | <el-table-column label="åçæ¥æ" prop="receiptPaymentDate" show-overflow-tooltip/> |
| | | <el-table-column label="忬¾éé¢" prop="receiptPaymentAmount" show-overflow-tooltip/> |
| | | <el-table-column label="åºæ¶éé¢" prop="invoiceAmount" show-overflow-tooltip/> |
| | | <el-table-column label="å¾
æ¶éé¢" prop="noReceiptAmount" show-overflow-tooltip/> |
| | | <el-table-column label="åºæ¶éé¢" prop="invoiceTotal" show-overflow-tooltip/> |
| | | </el-table> |
| | | <pagination v-show="recordTotal > 0" :total="recordTotal" layout="total, sizes, prev, pager, next, jumper" :page="recordPage.current" |
| | | :limit="recordPage.size" @pagination="recordPaginationChange" /> |
| | |
| | | page.current = 1 |
| | | getList() |
| | | } |
| | | const paginationChange = ({ current, limit }) => { |
| | | page.current = current; |
| | | page.size = limit; |
| | | const paginationChange = (obj) => { |
| | | console.log('paginationChange', current,limit) |
| | | page.current = obj.page; |
| | | page.size = obj.limit; |
| | | getList() |
| | | } |
| | | const getList = () => { |
| | |
| | | total.value = res.data.total; |
| | | if(tableData.value.length > 0) { |
| | | recordPage.current = 1 |
| | | customerId.value = tableData.value[0].customerId |
| | | customerId.value = tableData.value[0].id |
| | | receiptPaymentList(customerId.value); |
| | | } |
| | | }) |
| | |
| | | const receiptPaymentList = (id) => { |
| | | const param = { |
| | | customerId:id, |
| | | current: page.current, |
| | | size: page.size, |
| | | current: recordPage.current, |
| | | size: recordPage.size, |
| | | } |
| | | console.log('param', param) |
| | | receiptPaymentListPage(param).then(res => { |
| | | receiptRecord.value = res.data.records; |
| | | recordTotal.value = res.data.total; |
| | | |
| | | }) |
| | | } |
| | | |
| | | // æ±æ¬¾è®°å½å表å页 |
| | | const recordPaginationChange = (currentPage, pageSize) => { |
| | | recordPage.current = currentPage; |
| | | recordPage.size = pageSize; |
| | | const recordPaginationChange = (obj) => { |
| | | console.log('recordPaginationChange', obj ); |
| | | recordPage.current = obj.page; |
| | | recordPage.size = obj.limit; |
| | | console.log('recordPage',recordPage) |
| | | receiptPaymentList(customerId.value); |
| | | } |
| | | |
| | | const rowClickMethod = (row) => { |
| | | customerId.value = row.customerId; |
| | | customerId.value = row.id; |
| | | receiptPaymentList(customerId.value); |
| | | } |
| | | |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å½å
¥äººï¼" prop="entryPerson"> |
| | | <el-select v-model="form.entryPerson" placeholder="è¯·éæ©" clearable> |
| | | <el-select v-model="form.entryPerson" placeholder="è¯·éæ©" clearable @change="changs"> |
| | | <el-option v-for="item in userList" :key="item.userId" :label="item.nickName" :value="item.userId"/> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | type="date" |
| | | placeholder="è¯·éæ©" |
| | | clearable |
| | | disabled |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | <el-row :gutter="30"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="产å大类ï¼" prop="productCategory"> |
| | | <el-select v-model="productForm.productCategory" placeholder="è¯·éæ©" clearable> |
| | | <!-- <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-select> --> |
| | | <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-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="è§æ ¼åå·ï¼" prop="specificationModel"> |
| | | <el-select v-model="productForm.specificationModel" placeholder="è¯·éæ©" clearable> |
| | | <el-option v-for="item in userList" :key="item.nickName" :label="item.nickName" :value="item.nickName"/> |
| | | <el-form-item label="è§æ ¼åå·ï¼" prop="productModelId"> |
| | | <el-select v-model="productForm.productModelId" placeholder="è¯·éæ©" clearable @change="getProductModel"> |
| | | <el-option v-for="item in modelOptions" :key="item.id" :label="item.model" :value="item.id"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | import { ref } from 'vue' |
| | | import {Search} from "@element-plus/icons-vue"; |
| | | import {ElMessageBox } from "element-plus"; |
| | | import useUserStore from '@/store/modules/user' |
| | | import {userListNoPage} from "@/api/system/user.js"; |
| | | import { |
| | | ledgerList, |
| | |
| | | addOrUpdateSalesLedger, |
| | | getSalesLedgerWithProducts, delLedger, addOrUpdateSalesLedgerProduct, delProduct, delLedgerFile |
| | | } from "@/api/salesManagement/salesLedger.js"; |
| | | import {modelList, productTreeList} from "@/api/basicData/product.js"; |
| | | const userStore = useUserStore() |
| | | const { proxy } = getCurrentInstance() |
| | | const tableData = ref([]) |
| | | const productData = ref([]) |
| | |
| | | const productSelectedRows = ref([]) |
| | | const userList = ref([]) |
| | | const customerOption = ref([]) |
| | | const productOptions = ref([]) |
| | | const modelOptions = ref([]) |
| | | const tableLoading = ref(false) |
| | | const page = reactive({ |
| | | current: 1, |
| | |
| | | tableLoading.value = false |
| | | }) |
| | | } |
| | | // è·å产å大类treeæ°æ® |
| | | const getProductOptions = () => { |
| | | productTreeList().then(res => { |
| | | productOptions.value = convertIdToValue(res) |
| | | }) |
| | | } |
| | | // è·åtreeåæ°æ® |
| | | const getModels =(value) => { |
| | | productForm.value.productCategory = findNodeById(productOptions.value, value) |
| | | modelList({id: value}).then(res => { |
| | | modelOptions.value = res |
| | | }) |
| | | } |
| | | const getProductModel =(value) => { |
| | | const index = modelOptions.value.findIndex(item => item.id === value); |
| | | if (index !== -1) { |
| | | productForm.value.specificationModel = modelOptions.value[index].model; |
| | | } else { |
| | | productForm.value.specificationModel = null; |
| | | } |
| | | } |
| | | 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 |
| | | }; |
| | | function convertIdToValue(data) { |
| | | return data.map(item => { |
| | | const { id, children, ...rest } = item; |
| | | const newItem = { |
| | | ...rest, |
| | | value: id // å° id æ¹ä¸º value |
| | | }; |
| | | if (children && children.length > 0) { |
| | | newItem.children = convertIdToValue(children); |
| | | } |
| | | |
| | | return newItem; |
| | | }); |
| | | } |
| | | // è¡¨æ ¼éæ©æ°æ® |
| | | const handleSelectionChange = (selection) => { |
| | | selectedRows.value = selection |
| | |
| | | productList({salesLedgerId: row.id, type: 1}).then(res => { |
| | | const index = tableData.value.findIndex(item => item.id === row.id); |
| | | if (index > -1) { |
| | | tableData.value[index].children = res.rows; |
| | | tableData.value[index].children = res; |
| | | } |
| | | expandedRowKeys.value.push(row.id) |
| | | }) |
| | |
| | | return sums; |
| | | } |
| | | // æå¼å¼¹æ¡ |
| | | const openForm = (type, row) => { |
| | | const openForm = async (type, row) => { |
| | | operationType.value = type |
| | | form.value = {} |
| | | productData.value = [] |
| | | userListNoPage().then(res => { |
| | | userList.value = res.data |
| | | }) |
| | | let userLists = await userListNoPage() |
| | | userList.value = userLists.data |
| | | customerList().then(res => { |
| | | customerOption.value = res |
| | | }) |
| | |
| | | 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 |
| | | } |
| | | function changs(val){ |
| | | console.log(val); |
| | | } |
| | | // ä¸ä¼ åæ ¡æ£ |
| | | function handleBeforeUpload(file) { |
| | |
| | | productForm.value = {...row} |
| | | } |
| | | productFormVisible.value = true |
| | | getProductOptions() |
| | | } |
| | | // æäº¤äº§å表å |
| | | const submitProduct = () => { |
| | |
| | | }).catch(() => { |
| | | proxy.$modal.msg("已忶") |
| | | }) |
| | | |
| | | |
| | | } |
| | | } |
| | | // å
³é产åå¼¹æ¡ |
| | |
| | | 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}`; |
| | | } |
| | | const mathNum = (val) => { |
| | | productForm.value.taxExclusiveTotalPrice = proxy.calculateTaxExclusiveTotalPrice(val, productForm.value.taxRate) |
| | | } |
| | | getList() |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | |
| | | </style> |
| | | </style> |
| | |
| | | <pane size="84">
|
| | | <el-col style="padding: 10px">
|
| | | <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
| | | <el-form-item label="ç¨æ·åç§°" prop="userName">
|
| | | <el-input v-model="queryParams.userName" placeholder="请è¾å
¥ç¨æ·åç§°" clearable style="width: 240px" @keyup.enter="handleQuery" />
|
| | | <el-form-item label="ç»å½è´¦å·" prop="userName">
|
| | | <el-input v-model="queryParams.userName" placeholder="请è¾å
¥ç»å½è´¦å·" clearable style="width: 240px" @keyup.enter="handleQuery" />
|
| | | </el-form-item>
|
| | | <el-form-item label="ææºå·ç " prop="phonenumber">
|
| | | <el-input v-model="queryParams.phonenumber" placeholder="请è¾å
¥ææºå·ç " clearable style="width: 240px" @keyup.enter="handleQuery" />
|
| | |
| | | <el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
|
| | | <el-table-column type="selection" width="50" align="center" />
|
| | | <el-table-column label="ç¨æ·ç¼å·" align="center" key="userId" prop="userId" v-if="columns[0].visible" />
|
| | | <el-table-column label="ç¨æ·åç§°" align="center" key="userName" prop="userName" v-if="columns[1].visible" :show-overflow-tooltip="true" />
|
| | | <el-table-column label="ç»å½è´¦å·" align="center" key="userName" prop="userName" v-if="columns[1].visible" :show-overflow-tooltip="true" />
|
| | | <el-table-column label="ç¨æ·æµç§°" align="center" key="nickName" prop="nickName" v-if="columns[2].visible" :show-overflow-tooltip="true" />
|
| | | <el-table-column label="é¨é¨" align="center" key="deptName" prop="dept.deptName" v-if="columns[3].visible" :show-overflow-tooltip="true" />
|
| | | <el-table-column label="ææºå·ç " align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" width="120" />
|
| | |
| | | </el-form-item>
|
| | | </el-col>
|
| | | <el-col :span="12">
|
| | | <el-form-item label="å½å±é¨é¨" prop="deptId">
|
| | | <el-tree-select v-model="form.deptId" :data="enabledDeptOptions" :props="{ value: 'id', label: 'label', children: 'children' }" value-key="id" placeholder="è¯·éæ©å½å±é¨é¨" check-strictly />
|
| | | <el-form-item label="å½å±å
¬å¸" prop="deptId">
|
| | | <el-tree-select v-model="form.deptId" :data="enabledDeptOptions" :props="{ value: 'id', label: 'label', children: 'children' }" value-key="id" placeholder="è¯·éæ©å½å±å
¬å¸" check-strictly />
|
| | | </el-form-item>
|
| | | </el-col>
|
| | | </el-row>
|
| | |
| | | </el-row>
|
| | | <el-row>
|
| | | <el-col :span="12">
|
| | | <el-form-item v-if="form.userId == undefined" label="ç¨æ·åç§°" prop="userName">
|
| | | <el-input v-model="form.userName" placeholder="请è¾å
¥ç¨æ·åç§°" maxlength="30" />
|
| | | <el-form-item v-if="form.userId == undefined" label="ç»å½è´¦å·" prop="userName">
|
| | | <el-input v-model="form.userName" placeholder="请è¾å
¥ç»å½è´¦å·" maxlength="30" />
|
| | | </el-form-item>
|
| | | </el-col>
|
| | | <el-col :span="12">
|
| | |
| | | // åæ¾éä¿¡æ¯
|
| | | const columns = ref([
|
| | | { key: 0, label: `ç¨æ·ç¼å·`, visible: true },
|
| | | { key: 1, label: `ç¨æ·åç§°`, visible: true },
|
| | | { key: 1, label: `ç»å½è´¦å·`, visible: true },
|
| | | { key: 2, label: `ç¨æ·æµç§°`, visible: true },
|
| | | { key: 3, label: `é¨é¨`, visible: true },
|
| | | { key: 4, label: `ææºå·ç `, visible: true },
|
| | |
| | | deptId: undefined
|
| | | },
|
| | | rules: {
|
| | | userName: [{ required: true, message: "ç¨æ·åç§°ä¸è½ä¸ºç©º", trigger: "blur" }, { min: 2, max: 20, message: "ç¨æ·åç§°é¿åº¦å¿
é¡»ä»äº 2 å 20 ä¹é´", trigger: "blur" }],
|
| | | userName: [{ required: true, message: "ç»å½è´¦å·ä¸è½ä¸ºç©º", trigger: "blur" }, { min: 2, max: 20, message: "ç»å½è´¦å·é¿åº¦å¿
é¡»ä»äº 2 å 20 ä¹é´", trigger: "blur" }],
|
| | | nickName: [{ required: true, message: "ç¨æ·æµç§°ä¸è½ä¸ºç©º", trigger: "blur" }],
|
| | | deptId: [{ required: true, message: "å
¬å¸ä¸è½ä¸ºç©º", trigger: "change" }],
|
| | | password: [{ required: true, message: "ç¨æ·å¯ç ä¸è½ä¸ºç©º", trigger: "blur" }, { min: 5, max: 20, message: "ç¨æ·å¯ç é¿åº¦å¿
é¡»ä»äº 5 å 20 ä¹é´", trigger: "blur" }, { pattern: /^[^<>"'|\\]+$/, message: "ä¸è½å
å«éæ³å符ï¼< > \" ' \\\ |", trigger: "blur" }],
|
| | | email: [{ type: "email", message: "请è¾å
¥æ£ç¡®çé®ç®±å°å", trigger: ["blur", "change"] }],
|
| | | phonenumber: [{ pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, message: "请è¾å
¥æ£ç¡®çææºå·ç ", trigger: "blur" }]
|
| | |
| | | import path from 'path'
|
| | | import createVitePlugins from './vite/plugins'
|
| | |
|
| | | const baseUrl = 'http://192.168.1.35:8080' // å端æ¥å£
|
| | | const baseUrl = 'http://114.132.189.42:7003' // å端æ¥å£
|
| | |
|
| | | // https://vitejs.dev/config/
|
| | | export default defineConfig(({ mode, command }) => {
|