refactor(data): 优化参数维护和报表数据显示格式
- 移除参数维护中的取值格式字段和相关逻辑
- 统一空值显示为斜杠符号替代破折号
- 添加空字段格式化函数 emptySlash
- 更新采购台账表格列格式化配置
- 修改采购退货单详情空值显示格式
- 调整报表管理中的单位显示从个改为吨
- 修正安全生产业务中的责任联系人字段
- 清理销售台账中的快递相关字段配置
- 移除销售报价单中的项目名称字段
- 优化退货单金额格式化显示
| | |
| | | <el-input v-model="formData.unit" |
| | | placeholder="请输入单位" /> |
| | | </el-form-item> |
| | | <el-form-item label="取值格式" |
| | | v-if="formData.paramType == 1 || formData.paramType == 2" |
| | | prop="paramFormat"> |
| | | <el-input v-model="formData.paramFormat" |
| | | placeholder="请输入取值格式" /> |
| | | <!-- <el-select v-model="formData.paramFormat" |
| | | placeholder="请选择取值模式"> |
| | | <el-option label="#.00000" |
| | | value="#.00000" /> |
| | | <el-option label="#.0000" |
| | | value="#.0000" /> |
| | | <el-option label="#.000" |
| | | value="#.000" /> |
| | | <el-option label="#.00" |
| | | value="#.00" /> |
| | | </el-select> --> |
| | | </el-form-item> |
| | | <el-form-item label="下拉字典" |
| | | v-else-if="formData.paramType == 3" |
| | | v-if="formData.paramType == 3" |
| | | prop="paramFormat"> |
| | | <el-select v-model="formData.paramFormat" |
| | | placeholder="请选择取值模式"> |
| | |
| | | prop: "unit", |
| | | }, |
| | | { |
| | | label: "取值格式", |
| | | prop: "paramFormat", |
| | | }, |
| | | { |
| | | label: "是否必填", |
| | | prop: "isRequired", |
| | | dataType: "tag", |
| | |
| | | // }); |
| | | // const isProductTypeEdit = ref(false); |
| | | const handleParamTypeChange = () => { |
| | | if (formData.paramType === 1) { |
| | | formData.paramFormat = "#.00000"; |
| | | } else if (formData.paramType === 4) { |
| | | if (formData.paramType === 4) { |
| | | formData.paramFormat = "YYYY-MM-DD HH:mm:ss"; |
| | | } else { |
| | | formData.paramFormat = ""; |
| | |
| | | type="index" |
| | | width="60" /> |
| | | <el-table-column label="产品大类" |
| | | prop="productCategory" /> |
| | | prop="productCategory" |
| | | :formatter="emptySlash" /> |
| | | <el-table-column label="规格型号" |
| | | prop="specificationModel" /> |
| | | prop="specificationModel" |
| | | :formatter="emptySlash" /> |
| | | <el-table-column label="单位" |
| | | prop="unit" /> |
| | | prop="unit" |
| | | :formatter="emptySlash" /> |
| | | <el-table-column label="入库审核状态" |
| | | prop="stockInApprovalStatus" |
| | | width="120"> |
| | | <template #default="scope"> |
| | | <el-tag :type="getStockInApprovalStatusType(scope.row.stockInApprovalStatus)" |
| | | size="small"> |
| | | {{ scope.row.stockInApprovalStatus || '--' }} |
| | | {{ scope.row.stockInApprovalStatus || '/' }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | <el-table-column label="采购合同号" |
| | | prop="purchaseContractNumber" |
| | | width="160" |
| | | show-overflow-tooltip /> |
| | | show-overflow-tooltip |
| | | :formatter="emptySlash" /> |
| | | <el-table-column label="销售合同号" |
| | | prop="salesContractNo" |
| | | width="160" |
| | | show-overflow-tooltip /> |
| | | show-overflow-tooltip |
| | | :formatter="emptySlash" /> |
| | | <el-table-column label="供应商名称" |
| | | prop="supplierName" |
| | | width="160" |
| | | show-overflow-tooltip /> |
| | | show-overflow-tooltip |
| | | :formatter="emptySlash" /> |
| | | <el-table-column label="项目名称" |
| | | prop="projectName" |
| | | width="320" |
| | | show-overflow-tooltip /> |
| | | show-overflow-tooltip |
| | | :formatter="emptySlash" /> |
| | | <el-table-column label="审批状态" |
| | | prop="approvalStatus" |
| | | width="100" |
| | |
| | | <template #default="scope"> |
| | | <el-tag :type="getApprovalStatusType(scope.row.approvalStatus)" |
| | | size="small"> |
| | | {{ approvalStatusText[scope.row.approvalStatus] || '未知状态' }} |
| | | {{ approvalStatusText[scope.row.approvalStatus] || '/' }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | <template #default="scope"> |
| | | <el-tag :type="getStockInStatusType(scope.row.stockInStatus)" |
| | | size="small"> |
| | | {{ scope.row.stockInStatus || '--' }} |
| | | {{ scope.row.stockInStatus || '/' }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="签订日期" |
| | | prop="executionDate" |
| | | width="100" |
| | | show-overflow-tooltip /> |
| | | show-overflow-tooltip |
| | | :formatter="emptySlash" /> |
| | | <el-table-column label="付款方式" |
| | | width="100" |
| | | prop="paymentMethod" |
| | | show-overflow-tooltip /> |
| | | show-overflow-tooltip |
| | | :formatter="emptySlash" /> |
| | | <el-table-column label="合同金额(元)" |
| | | prop="contractAmount" |
| | | width="200" |
| | |
| | | <el-table-column label="录入人" |
| | | prop="recorderName" |
| | | width="120" |
| | | show-overflow-tooltip /> |
| | | show-overflow-tooltip |
| | | :formatter="emptySlash" /> |
| | | <el-table-column label="录入日期" |
| | | prop="entryDate" |
| | | width="100" |
| | | show-overflow-tooltip /> |
| | | show-overflow-tooltip |
| | | :formatter="emptySlash" /> |
| | | <el-table-column label="备注" |
| | | prop="remarks" |
| | | width="200" |
| | | show-overflow-tooltip /> |
| | | show-overflow-tooltip |
| | | :formatter="emptySlash" /> |
| | | <el-table-column fixed="right" |
| | | label="操作" |
| | | width="120" |
| | |
| | | type="index" |
| | | width="60" /> |
| | | <el-table-column label="产品大类" |
| | | prop="productCategory" /> |
| | | prop="productCategory" |
| | | :formatter="emptySlash" /> |
| | | <el-table-column label="规格型号" |
| | | prop="specificationModel" /> |
| | | prop="specificationModel" |
| | | :formatter="emptySlash" /> |
| | | <el-table-column label="单位" |
| | | prop="unit" |
| | | width="70" /> |
| | | width="70" |
| | | :formatter="emptySlash" /> |
| | | <el-table-column label="数量" |
| | | prop="quantity" |
| | | width="70" /> |
| | |
| | | <template #default="scope"> |
| | | <el-tag :type="getStockInApprovalStatusType(scope.row.stockInApprovalStatus)" |
| | | size="small"> |
| | | {{ scope.row.stockInApprovalStatus || '--' }} |
| | | {{ scope.row.stockInApprovalStatus || '/' }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | const formattedNumber = (row, column, cellValue) => { |
| | | return parseFloat(cellValue).toFixed(2); |
| | | }; |
| | | // 空字段统一显示 "/" |
| | | const emptySlash = (row, column, cellValue) => |
| | | cellValue === null || cellValue === undefined || cellValue === "" |
| | | ? "/" |
| | | : cellValue; |
| | | // 查询列表 |
| | | /** 搜索按钮操作 */ |
| | | const handleQuery = () => { |
| | |
| | | }; |
| | | const formatMoney = value => { |
| | | if (value === null || value === undefined || value === "") { |
| | | return "--"; |
| | | return "/"; |
| | | } |
| | | const num = Number(value); |
| | | return Number.isFinite(num) ? num.toFixed(2) : "--"; |
| | | return Number.isFinite(num) ? num.toFixed(2) : "/"; |
| | | }; |
| | | // 子表合计方法 |
| | | const summarizeProTable = param => { |
| | |
| | | prop="taxInclusiveTotalPrice" |
| | | width="120"> |
| | | <template #default="scope"> |
| | | {{ formatAmount(getReturnTotal(scope.row)) || '--' }} |
| | | {{ formatAmount(getReturnTotal(scope.row)) || '/' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="是否质检" |
| | |
| | | |
| | | const formatAmount = (value) => { |
| | | if (value === null || value === undefined || value === '') { |
| | | return '--' |
| | | return '/' |
| | | } |
| | | const num = Number(value) |
| | | if (Number.isNaN(num)) { |
| | | return '--' |
| | | return '/' |
| | | } |
| | | return num.toFixed(2) |
| | | } |
| | |
| | | <div v-loading="detailLoading"> |
| | | <el-descriptions :column="3" border> |
| | | <el-descriptions-item label="退料单号">{{ |
| | | detailData.no || "--" |
| | | detailData.no || '/' |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="退货方式">{{ |
| | | getReturnTypeLabel(detailData.returnType) |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="供应商名称">{{ |
| | | detailData.supplierName || "--" |
| | | detailData.supplierName || '/' |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="项目阶段">{{ |
| | | getProjectPhaseLabel(detailData.projectPhase) |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="关联的采购订单号">{{ |
| | | detailData.purchaseContractNumber || "--" |
| | | detailData.purchaseContractNumber || '/' |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="制作日期">{{ |
| | | detailData.preparedAt || "--" |
| | | detailData.preparedAt || '/' |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="制单人">{{ |
| | | detailData.preparedUserName || "--" |
| | | detailData.preparedUserName || '/' |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="退料人">{{ |
| | | detailData.returnUserName || "--" |
| | | detailData.returnUserName || '/' |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="发货类型">{{ |
| | | getShippingTypeLabel(detailData.shippingType) |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item v-if="String(detailData.shippingType) === '1'" label="发货车牌号">{{ |
| | | detailData.truckPlateNo || "--" |
| | | detailData.truckPlateNo || '/' |
| | | }}</el-descriptions-item> |
| | | <template v-else-if="String(detailData.shippingType) === '2'"> |
| | | <el-descriptions-item label="快递公司">{{ |
| | | detailData.expressCompany || "--" |
| | | detailData.expressCompany || '/' |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="快递单号">{{ |
| | | detailData.expressNo || "--" |
| | | detailData.expressNo || '/' |
| | | }}</el-descriptions-item> |
| | | </template> |
| | | <el-descriptions-item label="整单折扣额">{{ |
| | | formatAmount(detailData.totalDiscountAmount) |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="整单折扣率">{{ |
| | | detailData.totalDiscountRate ?? "--" |
| | | detailData.totalDiscountRate ?? '/' |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="成交金额">{{ |
| | | formatAmount(detailData.totalAmount) |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="创建人">{{ |
| | | detailData.createUserName || "--" |
| | | detailData.createUserName || '/' |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="创建时间">{{ |
| | | detailData.createTime || "--" |
| | | detailData.createTime || '/' |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="最近更新时间">{{ |
| | | detailData.updateTime || "--" |
| | | detailData.updateTime || '/' |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="备注" :span="3">{{ |
| | | detailData.remark || "--" |
| | | detailData.remark || '/' |
| | | }}</el-descriptions-item> |
| | | </el-descriptions> |
| | | |
| | |
| | | label: "退货方式", |
| | | prop: "returnType", |
| | | formatData: (val) => |
| | | returnTypeOptions.find((item) => item.value === val)?.label || "--", |
| | | returnTypeOptions.find((item) => item.value === val)?.label || '/', |
| | | }, |
| | | { |
| | | label: "供应商名称", |
| | |
| | | width: 100, |
| | | formatData: (val) => |
| | | projectPhaseOptions.find((item) => String(item.value) === String(val)) |
| | | ?.label || "--", |
| | | ?.label || '/', |
| | | }, |
| | | { |
| | | label: "关联的采购订单号", |
| | |
| | | tableLoading.value = false; |
| | | tableData.value = (res.data.records || []).map((row) => ({ |
| | | ...row, |
| | | truckPlateDisplay: String(row?.shippingType) === "1" ? (row?.truckPlateNo || "--") : "--", |
| | | expressCompanyDisplay: String(row?.shippingType) === "2" ? (row?.expressCompany || "--") : "--", |
| | | expressNoDisplay: String(row?.shippingType) === "2" ? (row?.expressNo || "--") : "--", |
| | | truckPlateDisplay: String(row?.shippingType) === "1" ? (row?.truckPlateNo || '/') : '/', |
| | | expressCompanyDisplay: String(row?.shippingType) === "2" ? (row?.expressCompany || '/') : '/', |
| | | expressNoDisplay: String(row?.shippingType) === "2" ? (row?.expressNo || '/') : '/', |
| | | })); |
| | | page.total = res.data.total; |
| | | }) |
| | |
| | | const getReturnTypeLabel = (value) => { |
| | | return ( |
| | | returnTypeOptions.find((item) => String(item.value) === String(value)) |
| | | ?.label || "--" |
| | | ?.label || '/' |
| | | ); |
| | | }; |
| | | |
| | | const getProjectPhaseLabel = (value) => { |
| | | return ( |
| | | projectPhaseOptions.find((item) => String(item.value) === String(value)) |
| | | ?.label || "--" |
| | | ?.label || '/' |
| | | ); |
| | | }; |
| | | |
| | |
| | | 1: "货车", |
| | | 2: "快递", |
| | | }; |
| | | return shippingTypeMap[String(value)] || shippingTypeMap[value] || "--"; |
| | | return shippingTypeMap[String(value)] || shippingTypeMap[value] || '/'; |
| | | }; |
| | | |
| | | const formatAmount = (value) => { |
| | | if (value === null || value === undefined || value === "") { |
| | | return "--"; |
| | | return '/'; |
| | | } |
| | | const num = Number(value); |
| | | if (Number.isNaN(num)) { |
| | |
| | | <div class="typeNum-right-top"> |
| | | <div class="typeNum-right-top-name">总数量</div> |
| | | <div class="typeNum-right-top-text">{{ getInspectStatValue(0, 'totalCount') }} <span |
| | | class="unit">个</span></div> |
| | | class="unit">吨</span></div> |
| | | </div> |
| | | <div class="typeNum-right-bottom"> |
| | | <div class="typeNum-right-top-name">已完成数</div> |
| | | <div class="typeNum-right-top-text">{{ getInspectStatValue(0, 'completedCount') }} <span |
| | | class="unit">个</span> |
| | | class="unit">吨</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="typeNum-right-top"> |
| | | <div class="typeNum-right-top-name">总数量</div> |
| | | <div class="typeNum-right-top-text">{{ getInspectStatValue(1, 'totalCount') }} <span |
| | | class="unit">个</span></div> |
| | | class="unit">吨</span></div> |
| | | </div> |
| | | <div class="typeNum-right-bottom"> |
| | | <div class="typeNum-right-top-name">已完成数</div> |
| | | <div class="typeNum-right-top-text">{{ getInspectStatValue(1, 'completedCount') }} <span |
| | | class="unit">个</span> |
| | | class="unit">吨</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="typeNum-right-top"> |
| | | <div class="typeNum-right-top-name">总数量</div> |
| | | <div class="typeNum-right-top-text">{{ getInspectStatValue(2, 'totalCount') }} <span |
| | | class="unit">个</span></div> |
| | | class="unit">吨</span></div> |
| | | </div> |
| | | <div class="typeNum-right-bottom"> |
| | | <div class="typeNum-right-top-name">已完成数</div> |
| | | <div class="typeNum-right-top-text">{{ getInspectStatValue(2, 'completedCount') }} <span |
| | | class="unit">个</span> |
| | | class="unit">吨</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | const stat = passRateStatisticsData.value.find(item => item.modelType === type); |
| | | if (stat) { |
| | | if (field === 'completionRate' || field === 'passRate') { |
| | | return stat[field] ? Number(stat[field]).toFixed(0) + '%' : '0%'; |
| | | return stat[field] ? Number(stat[field]).toFixed(2) + '%' : '0%'; |
| | | } |
| | | return stat[field]; |
| | | } |
| | |
| | | }, |
| | | yAxis: { |
| | | type: "value", |
| | | name: "数(个)", |
| | | name: "数(吨)", |
| | | }, |
| | | series: [ |
| | | { |
| | |
| | | prop="rectifyUserName" |
| | | width="120" |
| | | show-overflow-tooltip /> |
| | | <el-table-column label="整改责任人联系方式" |
| | | prop="rectifyUserMobile" |
| | | width="120" |
| | | show-overflow-tooltip /> |
| | | <el-table-column label="整改具体措施" |
| | | prop="rectifyMeasures" |
| | | width="120" |
| | |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="整改责任人"> |
| | | <span class="detail-title">{{ form.rectifyUserName }}</span> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="整改责任人联系方式"> |
| | | <span class="detail-title">{{ form.rectifyUserMobile }}</span> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="整改完成期限"> |
| | | <span class="detail-title">{{ dateOnly(form.rectifyTime) }}</span> |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="责任人联系电话" |
| | | prop="principalMobile"> |
| | | <el-input v-model="form.principalMobile" |
| | | readonly |
| | | placeholder="自动带出" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="管控责任人"> |
| | | {{ currentKnowledge.principalUserId }} |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="责任人联系电话"> |
| | | {{ currentKnowledge.principalMobile }} |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="风险等级"> |
| | | <el-tag :type="getTypeTagType(currentKnowledge.riskLevel)"> |
| | |
| | | { |
| | | label: "管控责任人", |
| | | prop: "principalUser", |
| | | showOverflowTooltip: true, |
| | | }, |
| | | { |
| | | label: "责任人联系电话", |
| | | prop: "principalMobile", |
| | | showOverflowTooltip: true, |
| | | }, |
| | | { |
| | |
| | | @change="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="快递单号:"> |
| | | <el-input |
| | | v-model="searchForm.expressNumber" |
| | | placeholder="请输入" |
| | | clearable |
| | | prefix-icon="Search" |
| | | style="width: 200px" |
| | | @change="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="项目名称:" prop="projectId"> |
| | | <el-select |
| | | v-model="searchForm.projectId" |
| | |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | label="快递公司" |
| | | prop="expressCompany" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | label="快递单号" |
| | | prop="expressNumber" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | label="审核状态" |
| | | prop="status" |
| | | align="center" |
| | |
| | | @change="handleShippingTypeChange" |
| | | > |
| | | <el-option label="货车" value="货车" /> |
| | | <el-option label="快递" value="快递" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="24" v-if="form.type === '货车'"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="发货车牌号:" prop="shippingCarNumber"> |
| | | <el-input |
| | | v-model="form.shippingCarNumber" |
| | | placeholder="请输入发货车牌号" |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24" v-else> |
| | | <el-form-item label="快递公司:" prop="expressCompany"> |
| | | <el-input |
| | | v-model="form.expressCompany" |
| | | placeholder="请输入快递公司" |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30" v-if="form.type === '快递'"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="快递单号:" prop="expressNumber"> |
| | | <el-input |
| | | v-model="form.expressNumber" |
| | | placeholder="请输入快递单号" |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="发货车牌号">{{ |
| | | detailRow.shippingCarNumber || "--" |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="快递公司">{{ |
| | | detailRow.expressCompany || "--" |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="快递单号" :span="2">{{ |
| | | detailRow.expressNumber || "--" |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="出库单号" :span="2">{{ |
| | | detailRow.outboundBatches || "--" |
| | |
| | | searchForm: { |
| | | salesContractNo: undefined, |
| | | shippingCarNumber: undefined, |
| | | expressNumber: undefined, |
| | | projectId: undefined, |
| | | shippingDateRange: [] |
| | | }, |
| | |
| | | customerName: "", |
| | | specificationModel: "", |
| | | productName: "", |
| | | type: "货车", // 货车, 快递 |
| | | type: "货车", |
| | | shippingDate: "", |
| | | shippingCarNumber: "", |
| | | expressCompany: "", |
| | | expressNumber: "", // 快递单号 |
| | | }, |
| | | rules: { |
| | | salesContractNo: [ |
| | |
| | | { |
| | | validator: (_, value, callback) => |
| | | validateShippingCarNumber(value, callback), |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | expressCompany: [ |
| | | { |
| | | validator: (_, value, callback) => |
| | | validateExpressCompany(value, callback), |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | |
| | | type: row.type || "货车", |
| | | shippingDate: row.shippingDate || getCurrentDate(), |
| | | shippingCarNumber: row.shippingCarNumber ?? "", |
| | | expressCompany: row.expressCompany ?? "", |
| | | expressNumber: row.expressNumber ?? "", |
| | | shippingDocument: row.shippingDocument ?? "", |
| | | isReconciled: row.isReconciled ?? 0, |
| | | statementArchivingStatus: row.statementArchivingStatus ?? "", |
| | |
| | | id: form.value.id, |
| | | type: form.value.type, |
| | | shippingDate: form.value.shippingDate, |
| | | shippingCarNumber: |
| | | form.value.type === "货车" ? form.value.shippingCarNumber : "", |
| | | expressCompany: |
| | | form.value.type === "快递" ? form.value.expressCompany : "", |
| | | expressNumber: |
| | | form.value.type === "快递" ? form.value.expressNumber : "", |
| | | shippingCarNumber: form.value.shippingCarNumber, |
| | | storageBlobDTOs: deliveryFileList.value || [], |
| | | }; |
| | | deductStock(payload).then((res) => { |
| | |
| | | }); |
| | | }; |
| | | |
| | | // 发货类型校验:货车时要求车牌,快递时要求快递公司 |
| | | // 发货车牌号校验 |
| | | const validateShippingCarNumber = (value, callback) => { |
| | | if (form.value.type === "货车") { |
| | | if (!value) return callback(new Error("请输入发货车牌号")); |
| | | } |
| | | callback(); |
| | | }; |
| | | const validateExpressCompany = (value, callback) => { |
| | | if (form.value.type === "快递") { |
| | | if (!value) return callback(new Error("请输入快递公司")); |
| | | } |
| | | if (!value) return callback(new Error("请输入发货车牌号")); |
| | | callback(); |
| | | }; |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | // 发货类型切换时清空对应字段 |
| | | const handleShippingTypeChange = (val) => { |
| | | if (val === "货车") { |
| | | form.value.expressCompany = ""; |
| | | form.value.expressNumber = ""; |
| | | } else { |
| | | form.value.shippingCarNumber = ""; |
| | | } |
| | | }; |
| | | const handleShippingTypeChange = () => {}; |
| | | |
| | | // 获取审核状态文本 |
| | | const getApprovalStatusText = (status) => { |
| | |
| | | <span>{{ scope.row.pendingApprovalQuantity || 0 }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="快递公司" |
| | | prop="expressCompany" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | label="快递单号" |
| | | prop="expressNumber" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column label="发货车牌" minWidth="100px" align="center"> |
| | | <template #default="scope"> |
| | | <div> |
| | |
| | | @change="handleDeliveryTypeChange" |
| | | > |
| | | <el-option label="货车" value="货车" /> |
| | | <el-option label="快递" value="快递" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="24" v-if="deliveryForm.type === '货车'"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="发货车牌号:" prop="shippingCarNumber"> |
| | | <el-input |
| | | v-model="deliveryForm.shippingCarNumber" |
| | | placeholder="请输入发货车牌号" |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24" v-else> |
| | | <el-form-item label="快递公司:" prop="expressCompany"> |
| | | <el-input |
| | | v-model="deliveryForm.expressCompany" |
| | | placeholder="请输入快递公司" |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30" v-if="deliveryForm.type === '快递'"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="快递单号:" prop="expressNumber"> |
| | | <el-input |
| | | v-model="deliveryForm.expressNumber" |
| | | placeholder="请输入快递单号" |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | |
| | | } |
| | | callback(); |
| | | }; |
| | | const validateDeliveryExpressCompany = (_rule, value, callback) => { |
| | | if (deliveryForm.value.type === "快递" && !value) { |
| | | return callback(new Error("请输入快递公司")); |
| | | } |
| | | callback(); |
| | | }; |
| | | const deliveryFormData = reactive({ |
| | | deliveryForm: { |
| | | shippingCarNumber: "", |
| | | expressCompany: "", |
| | | expressNumber: "", |
| | | type: "货车", // 货车, 快递 |
| | | type: "货车", |
| | | shippingDocument: "", |
| | | isReconciled: 0, |
| | | statementArchivingStatus: "", |
| | |
| | | deliveryRules: { |
| | | shippingCarNumber: [ |
| | | { validator: validateDeliveryShippingCarNumber, trigger: "blur" }, |
| | | ], |
| | | expressCompany: [ |
| | | { validator: validateDeliveryExpressCompany, trigger: "blur" }, |
| | | ], |
| | | type: [{ required: true, message: "请选择发货类型", trigger: "change" }], |
| | | }, |
| | |
| | | ); |
| | | deliveryForm.value = { |
| | | shippingCarNumber: "", |
| | | expressCompany: "", |
| | | expressNumber: "", |
| | | type: "货车", |
| | | batchNo: [], |
| | | batchNoList, |
| | |
| | | salesLedgerId: salesLedgerId, |
| | | salesLedgerProductId: currentDeliveryRow.value.id, |
| | | type: deliveryForm.value.type, |
| | | shippingCarNumber: |
| | | deliveryForm.value.type === "货车" |
| | | ? deliveryForm.value.shippingCarNumber |
| | | : "", |
| | | expressCompany: |
| | | deliveryForm.value.type === "快递" |
| | | ? deliveryForm.value.expressCompany |
| | | : "", |
| | | expressNumber: |
| | | deliveryForm.value.type === "快递" |
| | | ? deliveryForm.value.expressNumber |
| | | : "", |
| | | shippingCarNumber: deliveryForm.value.shippingCarNumber, |
| | | storageBlobDTOs: deliveryFileList.value || [], |
| | | batchNo: deliveryForm.value.batchNo, |
| | | batchNoDetailList: selectedBatchRows.map((item) => ({ |
| | |
| | | }; |
| | | |
| | | // 关闭发货弹框 |
| | | const handleDeliveryTypeChange = (val) => { |
| | | if (val === "货车") { |
| | | deliveryForm.value.expressCompany = ""; |
| | | deliveryForm.value.expressNumber = ""; |
| | | } else { |
| | | deliveryForm.value.shippingCarNumber = ""; |
| | | } |
| | | }; |
| | | const handleDeliveryTypeChange = () => {}; |
| | | |
| | | const closeDeliveryDia = () => { |
| | | proxy.resetForm("deliveryFormRef"); |
| | |
| | | <!-- </el-select>--> |
| | | <!-- </el-col>--> |
| | | <el-col :span="6"> |
| | | <el-select v-model="searchForm.projectId" placeholder="请选择项目名称" clearable filterable> |
| | | <el-option v-for="item in projectOptions" :key="item.id" :label="item.no + ' - ' + item.title" :value="item.id" /> |
| | | </el-select> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-button type="primary" @click="handleSearch">搜索</el-button> |
| | | <el-button @click="resetSearch">重置</el-button> |
| | | <el-button style="float: right;" type="primary" @click="handleAdd"> |
| | |
| | | > |
| | | <el-table-column align="center" label="序号" type="index" width="60" /> |
| | | <el-table-column prop="quotationNo" label="报价单号" /> |
| | | <el-table-column prop="projectName" label="项目名称" /> |
| | | <el-table-column prop="customer" label="客户名称" /> |
| | | <el-table-column prop="salesperson" label="业务员" width="100" /> |
| | | <el-table-column prop="quotationDate" label="报价日期" width="120" /> |
| | |
| | | <el-col :span="12"> |
| | | <el-form-item label="付款方式" prop="paymentMethod"> |
| | | <el-input v-model="form.paymentMethod" placeholder="请输入付款方式" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="项目名称" prop="projectId"> |
| | | <el-select v-model="form.projectId" placeholder="请选择项目名称" style="width: 100%" clearable filterable> |
| | | <el-option v-for="item in projectOptions" :key="item.id" :label="item.no + ' - ' + item.title" :value="item.id" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | <el-dialog v-model="viewDialogVisible" title="报价详情" width="800px"> |
| | | <el-descriptions :column="2" border> |
| | | <el-descriptions-item label="报价单号">{{ currentQuotation.quotationNo }}</el-descriptions-item> |
| | | <el-descriptions-item label="项目名称">{{ currentQuotation.projectName }}</el-descriptions-item> |
| | | <el-descriptions-item label="客户名称">{{ currentQuotation.customer }}</el-descriptions-item> |
| | | <el-descriptions-item label="业务员">{{ currentQuotation.salesperson }}</el-descriptions-item> |
| | | <el-descriptions-item label="报价日期">{{ currentQuotation.quotationDate }}</el-descriptions-item> |
| | |
| | | import {modelList, productTreeList} from "@/api/basicData/product.js"; |
| | | import {listCustomer} from "@/api/basicData/customer.js"; |
| | | import { userListNoPage } from "@/api/system/user.js"; |
| | | import { listProject } from "@/api/projectManagement/project.js"; |
| | | |
| | | // 响应式数据 |
| | | const loading = ref(false) |
| | | const searchForm = reactive({ |
| | | quotationNo: '', |
| | | customerId: '', |
| | | status: '', |
| | | projectId: undefined |
| | | status: '' |
| | | }) |
| | | |
| | | const quotationList = ref([]) |
| | | const userList = ref([]) |
| | | const productOptions = ref([]); |
| | | const modelOptions = ref([]); |
| | | const projectOptions = ref([]); |
| | | const pagination = reactive({ |
| | | total: 3, |
| | | currentPage: 1, |
| | |
| | | const form = reactive({ |
| | | quotationNo: '', |
| | | customerId: undefined, |
| | | projectId: undefined, |
| | | customer: '', |
| | | salesperson: '', |
| | | quotationDate: '', |
| | |
| | | searchForm.quotationNo = '' |
| | | searchForm.customer = '' |
| | | searchForm.status = '' |
| | | searchForm.projectId = undefined |
| | | // 重置到第一页并重新查询 |
| | | pagination.currentPage = 1 |
| | | handleSearch() |
| | |
| | | dialogVisible.value = true |
| | | getProductOptions(); |
| | | fetchCustomerOptions(); |
| | | fetchProjectOptions(); |
| | | } |
| | | |
| | | const fetchProjectOptions = () => { |
| | | if (projectOptions.value.length > 0) return |
| | | listProject({current: -1,size:-1}).then((res) => { |
| | | projectOptions.value = res.data.records; |
| | | }); |
| | | } |
| | | |
| | | const fetchCustomerOptions = () => { |
| | |
| | | unitPrice: product.unitPrice || 0, |
| | | amount: product.amount || 0 |
| | | })) : [], |
| | | totalAmount: row.totalAmount || 0, |
| | | projectName: row.projectName || '' |
| | | totalAmount: row.totalAmount || 0 |
| | | } |
| | | viewDialogVisible.value = true |
| | | } |
| | |
| | | // 先加载产品树数据,否则 el-tree-select 无法反显产品名称 |
| | | await getProductOptions() |
| | | await fetchCustomerOptions() |
| | | await fetchProjectOptions() |
| | | |
| | | // 只复制需要的字段,避免将组件引用放入响应式对象 |
| | | form.quotationNo = row.quotationNo || '' |
| | | form.customer = row.customer || '' |
| | | form.customerId = row.customerId || undefined |
| | | form.projectId = row.projectId || undefined |
| | | form.salesperson = row.salesperson || '' |
| | | form.quotationDate = row.quotationDate || '' |
| | | form.validDate = row.validDate || '' |
| | |
| | | const resetForm = () => { |
| | | form.customer = '' |
| | | form.customerId = undefined |
| | | form.projectId = undefined |
| | | form.salesperson = '' |
| | | form.quotationDate = '' |
| | | form.validDate = '' |
| | |
| | | getUserList() |
| | | handleSearch() |
| | | fetchCustomerOptions() |
| | | fetchProjectOptions() |
| | | }) |
| | | </script> |
| | | |