| | |
| | | </up-form-item> |
| | | <up-form-item label="供应商名称" |
| | | prop="supplierName" |
| | | required |
| | | > |
| | | required> |
| | | <up-input v-model="form.supplierName" |
| | | readonly |
| | | :disabled="isReadOnly" |
| | |
| | | <up-input v-model="form.paymentMethod" |
| | | :disabled="isReadOnly" |
| | | placeholder="请输入付款方式" /> |
| | | </up-form-item> |
| | | <up-form-item label="车牌号" |
| | | prop="carPlateNumber"> |
| | | <up-input v-model="form.carPlateNumber" |
| | | :disabled="isReadOnly" |
| | | placeholder="请输入车牌号" /> |
| | | </up-form-item> |
| | | <up-form-item label="运输单位/个人" |
| | | prop="transportUnitOrPerson"> |
| | | <up-input v-model="form.transportUnitOrPerson" |
| | | :disabled="isReadOnly" |
| | | placeholder="请输入运输单位/个人" /> |
| | | </up-form-item> |
| | | <up-form-item label="签订日期" |
| | | required |
| | |
| | | placeholder="请输入" |
| | | disabled /> |
| | | </up-form-item> |
| | | <view class="approval-process"> |
| | | <view class="approval-header"> |
| | | <text class="approval-title">审核流程</text> |
| | | <text class="approval-desc">每个步骤只能选择一个审批人</text> |
| | | </view> |
| | | <view class="approval-steps"> |
| | | <view v-for="(step, stepIndex) in approverNodes" |
| | | :key="stepIndex" |
| | | class="approval-step"> |
| | | <view class="step-dot"></view> |
| | | <view class="step-title"> |
| | | <text>审批人</text> |
| | | </view> |
| | | <view class="approver-container"> |
| | | <view v-if="step.nickName" |
| | | class="approver-item"> |
| | | <view class="approver-avatar"> |
| | | <text class="avatar-text">{{ step.nickName.charAt(0) }}</text> |
| | | <view class="status-dot"></view> |
| | | </view> |
| | | <view class="approver-info"> |
| | | <text class="approver-name">{{ step.nickName }}</text> |
| | | </view> |
| | | <view class="delete-approver-btn" |
| | | v-if="!isReadOnly" |
| | | @click="removeApprover(stepIndex)">×</view> |
| | | </view> |
| | | <view v-else-if="!isReadOnly" |
| | | class="add-approver-btn" |
| | | @click="addApprover(stepIndex)"> |
| | | <view class="add-circle">+</view> |
| | | <text class="add-label">选择审批人</text> |
| | | </view> |
| | | </view> |
| | | <view class="step-line" |
| | | v-if="stepIndex < approverNodes.length - 1"></view> |
| | | <view class="delete-step-btn" |
| | | v-if="approverNodes.length > 1 && !isReadOnly" |
| | | @click="removeApprovalStep(stepIndex)">删除节点</view> |
| | | </view> |
| | | </view> |
| | | <view class="add-step-btn" v-if="!isReadOnly"> |
| | | <u-button icon="plus" |
| | | plain |
| | | type="primary" |
| | | style="width: 100%" |
| | | @click="addApprovalStep">新增节点</u-button> |
| | | </view> |
| | | </view> |
| | | <up-popup :show="showTimePicker" |
| | | mode="bottom" |
| | | @close="showTimePicker = false"> |
| | |
| | | placeholder="请输入" |
| | | @blur="formatAmount(idx)" /> |
| | | </up-form-item> |
| | | <up-form-item label="运费单价(元)" |
| | | prop="freightUnitPrice" |
| | | :rules="productRules"> |
| | | <up-input v-model="product.freightUnitPrice" |
| | | type="number" |
| | | :disabled="!canEditProducts" |
| | | placeholder="请输入" |
| | | @blur="formatFreightUnitPrice(idx)" /> |
| | | </up-form-item> |
| | | <up-form-item label="总运费(元)" |
| | | prop="totalFreight" |
| | | :rules="productRules"> |
| | | <up-input v-model="product.totalFreight" |
| | | type="number" |
| | | :disabled="!canEditProducts" |
| | | placeholder="请输入" |
| | | @blur="formatTotalFreight(idx)" /> |
| | | </up-form-item> |
| | | <!-- 含税总价 --> |
| | | <up-form-item label="含税总价(元)" |
| | | prop="taxInclusiveTotalPrice" |
| | |
| | | supplierName: "", |
| | | projectName: "", |
| | | paymentMethod: "", |
| | | carPlateNumber: "", |
| | | transportUnitOrPerson: "", |
| | | recorderId: "", |
| | | recorderName: "", |
| | | entryDate: "", |
| | |
| | | taxRate: "", |
| | | taxInclusiveUnitPrice: "", |
| | | quantity: "", |
| | | freightUnitPrice: "", |
| | | totalFreight: "", |
| | | taxInclusiveTotalPrice: "", |
| | | taxExclusiveTotalPrice: "", |
| | | invoiceType: "", |
| | |
| | | } |
| | | }; |
| | | |
| | | const formatFreightUnitPrice = idx => { |
| | | if (productData.value[idx].freightUnitPrice) { |
| | | const value = parseFloat(productData.value[idx].freightUnitPrice); |
| | | if (!isNaN(value)) { |
| | | productData.value[idx].freightUnitPrice = value.toFixed(2); |
| | | } |
| | | } |
| | | const quantity = parseFloat(productData.value[idx].quantity); |
| | | const unitPrice = parseFloat(productData.value[idx].freightUnitPrice); |
| | | if (!quantity || quantity <= 0 || !unitPrice) return; |
| | | productData.value[idx].totalFreight = (unitPrice * quantity).toFixed(2); |
| | | }; |
| | | |
| | | const formatTotalFreight = idx => { |
| | | if (productData.value[idx].totalFreight) { |
| | | const value = parseFloat(productData.value[idx].totalFreight); |
| | | if (!isNaN(value)) { |
| | | productData.value[idx].totalFreight = value.toFixed(2); |
| | | } |
| | | } |
| | | const quantity = parseFloat(productData.value[idx].quantity); |
| | | const totalFreight = parseFloat(productData.value[idx].totalFreight); |
| | | if (!quantity || quantity <= 0 || !totalFreight) return; |
| | | productData.value[idx].freightUnitPrice = (totalFreight / quantity).toFixed( |
| | | 2 |
| | | ); |
| | | }; |
| | | |
| | | // 数量输入框失焦 |
| | | const formatAmount = idx => { |
| | | if (productData.value[idx].quantity) { |
| | |
| | | approverNodes.value = [{ id: 1, userId: null, nickName: null }]; |
| | | nextApproverId = 2; |
| | | } |
| | | |
| | | form.value.carPlateNumber = |
| | | res?.carPlateNumber ?? editData.value?.carPlateNumber ?? ""; |
| | | form.value.transportUnitOrPerson = |
| | | res?.transportUnitOrPerson ?? editData.value?.transportUnitOrPerson ?? ""; |
| | | }); |
| | | console.log(editData.value); |
| | | // 填充基本信息 |
| | |
| | | form.value.id = editData.value.id || ""; |
| | | form.value.supplierId = editData.value.supplierId || ""; |
| | | form.value.executionDate = editData.value.executionDate || ""; |
| | | form.value.carPlateNumber = editData.value.carPlateNumber || ""; |
| | | form.value.transportUnitOrPerson = editData.value.transportUnitOrPerson || ""; |
| | | }; |
| | | |
| | | const getSalesNoList = () => { |
| | |
| | | color: #3b82f6; |
| | | font-size: 14px; |
| | | } |
| | | </style> |
| | | </style> |