Merge remote-tracking branch 'origin/dev' into dev
# Conflicts:
# src/views/system/user/index.vue
| | |
| | | // 客户合同金额TOP5统计 |
| | | export const getTopFiveList = () => { |
| | | return request({ |
| | | url: 'sales/ledger/getTopFiveList', |
| | | url: '/sales/ledger/getTopFiveList', |
| | | method: 'get' |
| | | }) |
| | | } |
| | | // 回款饼状图 |
| | | export const getAmountMouth = () => { |
| | | return request({ |
| | | url: 'receiptPayment/getAmountMouth', |
| | | 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' |
| | | }) |
| | | } |
| | |
| | | :grid="grid"
|
| | | :legend="barLegend"
|
| | | :series="lineSeries"
|
| | | :tooltip="tooltip"
|
| | | :tooltip="tooltipLine"
|
| | | :xAxis="xAxis2"
|
| | | :yAxis="yAxis2"
|
| | | style="height: 27vh;"></Echarts>
|
| | |
| | | import * as echarts from 'echarts';
|
| | | import Echarts from "@/components/Echarts/echarts.vue";
|
| | | import {
|
| | | getAmountHalfYear,
|
| | | getAmountMouth,
|
| | | getContractAmount,
|
| | | getInvoiceAmount,
|
| | |
| | | type: 'shadow'
|
| | | }
|
| | | }
|
| | | const tooltipLine = {
|
| | | trigger: 'axis',
|
| | | }
|
| | | const yAxis1 = ref([
|
| | | {
|
| | | type: '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 对象
|
| | | // 正确响应式赋值:创建新的 xAxis 和 series 对象
|
| | | xAxis1.value = [
|
| | | {
|
| | | type: 'category',
|
| | | data: customerName
|
| | | }
|
| | | ]
|
| | | |
| | | barSeries.value = [
|
| | | {
|
| | | type: 'bar',
|
| | |
| | | }
|
| | | ]
|
| | | }
|
| | | // 线形图
|
| | | 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>
|
| | |
| | | <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" |
| | |
| | | <PIMTable |
| | | :column="tableColumnSon" |
| | | :tableData="tableDataSon" |
| | | :page="pageSon" |
| | | :isSelection="false" |
| | | :tableLoading="tableLoadingSon" |
| | | :isShowSummary="isShowSummarySon" |
| | |
| | | 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; |
| | |
| | | </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 |
| | |
| | | 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 = () => { |
| | |
| | | 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> |
| | | |
| | |
| | | <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: "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" }]
|