| | |
| | | |
| | | <script setup> |
| | | import { ref, onMounted } from "vue"; |
| | | import { onLoad } from "@dcloudio/uni-app"; |
| | | import FooterButtons from "@/components/FooterButtons.vue"; |
| | | |
| | | const showToast = message => { |
| | |
| | | icon: "none", |
| | | }); |
| | | }; |
| | | |
| | | import { formatDateToYMD } from "@/utils/ruoyi"; |
| | | import { userListNoPageByTenantId } from "@/api/system/user"; |
| | | import { productionReport } from "@/api/productionManagement/productionReporting"; |
| | | import { addProductMain } from "@/api/productionManagement/productionReporting"; |
| | | import { getInfo } from "@/api/login"; |
| | | |
| | | // 表单引用 |
| | |
| | | const goBack = () => { |
| | | uni.navigateBack(); |
| | | }; |
| | | const parsedOrderRow = ref({}); |
| | | // 提交表单 |
| | | const submitForm = async () => { |
| | | submitting.value = true; |
| | |
| | | return; |
| | | } |
| | | |
| | | addProductMain(reportForm).then(res => { |
| | | addProductMain(form.value).then(res => { |
| | | if (res.code === 200) { |
| | | showToast("报工成功"); |
| | | submitting.value = false; |
| | |
| | | }; |
| | | |
| | | // 页面加载时初始化数据 |
| | | onMounted(() => { |
| | | // 获取传递过来的orderRow参数 |
| | | const pages = getCurrentPages(); |
| | | const currentPage = pages[pages.length - 1]; |
| | | const orderRow = currentPage.options.orderRow; |
| | | form.value.remainingQuantity = 1; |
| | | if (orderRow) { |
| | | parsedOrderRow.value = JSON.parse(orderRow); |
| | | onLoad(options => { |
| | | console.log(options, "options"); |
| | | const orderRow = JSON.parse(options.orderRow); |
| | | console.log(orderRow, "orderRow======########"); |
| | | |
| | | form.value.quantity = parsedOrderRow.value.quantity; |
| | | form.value.productProcessRouteItemId = |
| | | parsedOrderRow.value.productProcessRouteItemId; |
| | | form.value.workOrderId = parsedOrderRow.value.id; |
| | | form.value.reportWork = parsedOrderRow.value.reportWork; |
| | | form.value.productMainId = parsedOrderRow.value.productMainId; |
| | | } |
| | | form.value.remainingQuantity = 1; |
| | | form.value.quantity = orderRow.quantity; |
| | | form.value.productProcessRouteItemId = orderRow.productProcessRouteItemId; |
| | | form.value.workOrderId = orderRow.id; |
| | | form.value.reportWork = orderRow.reportWork; |
| | | form.value.productMainId = orderRow.productMainId; |
| | | getInfo().then(res => { |
| | | form.value.userId = res.user.userId; |
| | | form.value.userName = res.user.userName; |