| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="数量" prop="number"> |
| | | <el-input-number :step="0.01" :min="0" style="width: 100%" |
| | | <el-input-number :min="1" style="width: 100%" |
| | | v-model="form.number" |
| | | disabled |
| | | placeholder="请输入数量" |
| | | @change="mathNum" |
| | | /> |
| | |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="预计运行时间" prop="planRuntimeTime"> |
| | | <el-date-picker |
| | | style="width: 100%" |
| | | v-model="form.planRuntimeTime" |
| | | format="YYYY-MM-DD" |
| | | value-format="YYYY-MM-DD" |
| | | type="date" |
| | | placeholder="请选择录入日期" |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | </template> |
| | |
| | | number: [{ required: true, trigger: "blur", message: "请输入" }], |
| | | taxIncludingPriceUnit: [{ required: true, trigger: "blur", message: "请输入" }], |
| | | taxRate: [{ required: true, trigger: "change", message: "请输入" }], |
| | | planRuntimeTime: [{ required: true, trigger: "change", message: "请选择" }], |
| | | } |
| | | |
| | | const { form, resetForm } = useFormData({ |
| | |
| | | storageLocation: undefined, // 存放位置 |
| | | enableDepreciation: false, // 是否启用折旧 |
| | | unit: undefined, // 单位 |
| | | number: undefined, // 数量 |
| | | number: 1, // 数量 |
| | | taxIncludingPriceUnit: undefined, // 含税单价 |
| | | taxIncludingPriceTotal: undefined, // 含税总价 |
| | | taxRate: undefined, // 税率 |
| | | unTaxIncludingPriceTotal: undefined, // 不含税总价 |
| | | // createUser: useUserStore().nickName, // 录入人 |
| | | createTime: dayjs().format("YYYY-MM-DD HH:mm:ss"), // 录入日期 |
| | | planRuntimeTime: dayjs().format("YYYY-MM-DD"), // 录入日期 |
| | | }); |
| | | |
| | | const loadForm = async (id) => { |
| | |
| | | form.storageLocation = data.storageLocation; |
| | | form.enableDepreciation = data.enableDepreciation; |
| | | form.unit = data.unit; |
| | | form.number = data.number; |
| | | form.number = 1; |
| | | form.taxIncludingPriceUnit = data.taxIncludingPriceUnit; |
| | | form.taxIncludingPriceTotal = data.taxIncludingPriceTotal; |
| | | form.taxRate = data.taxRate; |
| | |
| | | const mathNum = () => { |
| | | if (!form.taxIncludingPriceUnit) { |
| | | ElMessage.error("请输入单价"); |
| | | return; |
| | | } |
| | | if (!form.number) { |
| | | ElMessage.error("请输入数量"); |
| | | return; |
| | | } |
| | | form.taxIncludingPriceTotal = calculateTaxIncludeTotalPrice( |