| | |
| | | deviceName: [{ required: true, trigger: "blur", message: "请输入" }], |
| | | deviceModel: [{ required: true, trigger: "blur", message: "请输入" }], |
| | | type: [{ required: true, trigger: "change", message: "请选择或输入设备类型" }], |
| | | productProcessId: [{ required: true, trigger: "change", message: "请选择工序" }], |
| | | supplierName: [{ required: true, trigger: "blur", message: "请输入" }], |
| | | unit: [{ required: true, trigger: "blur", message: "请输入" }], |
| | | number: [{ required: true, trigger: "blur", message: "请输入" }], |
| | |
| | | import { customerRevenueAnalysis } from '@/api/viewIndex.js' |
| | | import { listCustomer } from '@/api/basicData/customerFile.js' |
| | | |
| | | /** 客户营收分析下拉默认选中该客户(不存在则退回列表第一项) */ |
| | | const DEFAULT_REVENUE_CUSTOMER_NAME = '鑫鹤门窗' |
| | | |
| | | const pickDefaultCustomerValue = (options) => { |
| | | if (!options?.length) return null |
| | | const matched = options.find((o) => o.label === DEFAULT_REVENUE_CUSTOMER_NAME) |
| | | return matched ? matched.value : options[0].value |
| | | } |
| | | |
| | | const dateType = ref(1) // 1=周 2=月 3=季度 |
| | | const customerValue = ref(null) |
| | | const customerOptions = ref([]) |
| | |
| | | // 获取客户营收分析数据 |
| | | const getCustomerRevenueAnalysis = () => { |
| | | if (customerOptions.value.length > 0 && !customerValue.value) { |
| | | // 默认选中第一个客户 |
| | | customerValue.value = customerOptions.value[0].value |
| | | customerValue.value = pickDefaultCustomerValue(customerOptions.value) |
| | | } |
| | | |
| | | if (!customerValue.value) return |
| | |
| | | value: r.id ?? r.customerId ?? r.customerCode ?? r.customerName, |
| | | })) |
| | | |
| | | // 获取到选项后,如果还没选中,默认选中第一个 |
| | | // 获取到选项后,如果还没选中,默认「鑫鹤门窗」(无则第一项) |
| | | if (customerOptions.value.length > 0 && !customerValue.value) { |
| | | customerValue.value = customerOptions.value[0].value |
| | | customerValue.value = pickDefaultCustomerValue(customerOptions.value) |
| | | getCustomerRevenueAnalysis() |
| | | } |
| | | } catch (e) { |
| | |
| | | return parseFloat(cellValue).toFixed(2); |
| | | }; |
| | | const formatDate = (row, column, cellValue) => { |
| | | return dayjs(cellValue).format("YYYY-MM-DD HH:mm:ss"); |
| | | if (!cellValue) return ""; |
| | | return dayjs(cellValue).format("YYYY-MM-DD"); |
| | | }; |
| | | // 查询列表 |
| | | /** 搜索按钮操作 */ |