| | |
| | | import HomeApi from "@/api/home"; |
| | | |
| | | const paramsId = ref(); |
| | | const projectIdFromRoute = ref<string | number>(""); |
| | | const cardData = reactive({ |
| | | type: "绞线", |
| | | deviceModel: undefined, |
| | |
| | | } |
| | | }; |
| | | |
| | | // 获取当前可用的 projectId(优先 API 返回,其次路由参数) |
| | | const getProjectId = () => { |
| | | return detailData.value.projectId || projectIdFromRoute.value || ""; |
| | | }; |
| | | |
| | | // 处理报工点击 |
| | | const handleReportClick = async () => { |
| | | const currentProjectId = getProjectId(); |
| | | // 先请求验证变更接口 |
| | | try { |
| | | const { code } = await TwistApi.verifyChanges({ projectId: detailData.value.projectId }); |
| | | const { code } = await TwistApi.verifyChanges({ projectId: currentProjectId }); |
| | | if (code !== 200) { |
| | | return; |
| | | } |
| | |
| | | |
| | | // 如果有 prepareId,正常跳转 |
| | | uni.navigateTo({ |
| | | url: `/pages/production/twist/report/index?id=${paramsId.value}`, |
| | | url: `/pages/production/twist/report/index?id=${paramsId.value}&projectId=${currentProjectId}`, |
| | | }); |
| | | }; |
| | | |
| | | onLoad(async (options: any) => { |
| | | paramsId.value = options.id; |
| | | projectIdFromRoute.value = options.projectId || ""; |
| | | await getDetailData(options.id); |
| | | // 获取并缓存生产准备ID |
| | | await initPrepareId(); |
| | |
| | | import HomeApi from "@/api/home"; |
| | | |
| | | const paramsId = ref(); |
| | | const projectIdFromRoute = ref<string | number>(""); |
| | | const cardData = reactive({ |
| | | deviceModel: undefined, |
| | | model: undefined, |
| | |
| | | } |
| | | }; |
| | | |
| | | // 获取当前可用的 projectId(优先 API 返回,其次路由参数) |
| | | const getProjectId = () => { |
| | | return detailData.value.projectId || projectIdFromRoute.value || ""; |
| | | }; |
| | | |
| | | // 处理报工点击 |
| | | const handleReportClick = async () => { |
| | | const currentProjectId = getProjectId(); |
| | | // 先请求验证变更接口 |
| | | try { |
| | | const { code } = await WireApi.verifyChanges({ projectId: detailData.value.projectId }); |
| | | const { code } = await WireApi.verifyChanges({ projectId: currentProjectId }); |
| | | if (code !== 200) { |
| | | return; |
| | | } |
| | |
| | | const totalWeight = |
| | | cardData.totalWeight !== undefined && cardData.totalWeight !== null ? cardData.totalWeight : ""; |
| | | uni.navigateTo({ |
| | | url: `/pages/production/wire/report/wire?id=${paramsId.value}&model=${cardData.model}&oneLength=${cardData.oneLength}&isMonofil=${isMonofil}&meterWeight=${meterWeight}&totalWeight=${totalWeight}`, |
| | | url: `/pages/production/wire/report/wire?id=${paramsId.value}&model=${cardData.model}&oneLength=${cardData.oneLength}&isMonofil=${isMonofil}&meterWeight=${meterWeight}&totalWeight=${totalWeight}&projectId=${currentProjectId}`, |
| | | }); |
| | | }; |
| | | |
| | | onLoad(async (options: any) => { |
| | | paramsId.value = options.id; |
| | | projectIdFromRoute.value = options.projectId || ""; |
| | | await getDetailData(options.id); |
| | | // 获取并缓存生产准备ID |
| | | await initPrepareId(); |
| | |
| | | :key="index" |
| | | :data="item" |
| | | :map="map" |
| | | @click="toDetail(item.id, item.type)" |
| | | @click="toDetail(item.id, item.type, item.projectId)" |
| | | /> |
| | | </z-paging> |
| | | <wd-toast /> |
| | |
| | | const emits = defineEmits(["ok"]); |
| | | const list = ref<any[]>([]); |
| | | |
| | | const toDetail = (id: number, type: string) => { |
| | | const toDetail = (id: number, type: string, projectId?: string | number) => { |
| | | const projectIdParam = projectId ? `&projectId=${projectId}` : ""; |
| | | // toast.show("点击卡片"); |
| | | if (type == "拉丝") { |
| | | uni.navigateTo({ |
| | | url: `/pages/production/detail/wireDetail?id=${id}`, |
| | | url: `/pages/production/detail/wireDetail?id=${id}${projectIdParam}`, |
| | | }); |
| | | } else if (type == "绞线") { |
| | | uni.navigateTo({ |
| | | url: `/pages/production/detail/twistDetail?id=${id}`, |
| | | url: `/pages/production/detail/twistDetail?id=${id}${projectIdParam}`, |
| | | }); |
| | | } |
| | | }; |
| | |
| | | const props = defineProps<{ |
| | | firstTareValue?: number; |
| | | teamId?: string | number | null; |
| | | projectId?: string | number; |
| | | isFirstReport?: boolean; // 是否是第一条报工 |
| | | }>(); |
| | | |
| | |
| | | type: "绞线", |
| | | actuallyLength: model.actuallyLength, |
| | | tare: model.tare || firstTareValue, |
| | | projectId: props.projectId || undefined, |
| | | // 从主表获取的字段 |
| | | model: mainTableData.value.model, // 规格型号 |
| | | oneLength: mainTableData.value.totalLength, |
| | |
| | | ref="twistFormRef" |
| | | :first-tare-value="twistReportList.length > 0 ? twistReportList[0].tare : undefined" |
| | | :team-id="teamId" |
| | | :project-id="projectId" |
| | | :is-first-report="twistReportList.length === 0" |
| | | /> |
| | | </wd-popup> |
| | |
| | | }; |
| | | const pagingRef = ref(); |
| | | const paramsId = ref(); |
| | | const projectId = ref<string | number>(""); |
| | | const twistFormRef = ref(); |
| | | const toast = useToast(); |
| | | const dialog = reactive({ |
| | |
| | | |
| | | onLoad(async (options: any) => { |
| | | paramsId.value = options.id; |
| | | projectId.value = options.projectId || ""; |
| | | // 获取并缓存班组ID |
| | | await initTeamId(); |
| | | // 获取主表数据 |
| | |
| | | <view style="margin: 10rpx"> |
| | | <text class="title">结构标准值和实测</text> |
| | | </view> |
| | | <wd-col |
| | | :span="24" |
| | | v-for="(item, index) in structureItems" |
| | | :key="index" |
| | | style="padding-bottom: 10px" |
| | | > |
| | | <wd-form-item |
| | | :label="item.structureName" |
| | | label-width="180px" |
| | | style="color: red" |
| | | required |
| | | /> |
| | | <wd-form-item label="标准值" prop="structureValue"> |
| | | <text>{{ item.structureValue || "-" }}</text> |
| | | </wd-form-item> |
| | | <wd-form-item label="实测根数" prop="actualValue1" required> |
| | | <wd-input |
| | | v-model="item.actualValue1" |
| | | placeholder="请输入根数" |
| | | clearable |
| | | type="number" |
| | | :disabled="isViewMode" |
| | | <template v-for="(item, index) in structureItems" :key="index"> |
| | | <wd-col |
| | | :span="24" |
| | | v-if="!item.structureName?.includes('钢')" |
| | | style="padding-bottom: 10px" |
| | | > |
| | | <wd-form-item |
| | | :label="item.structureName" |
| | | label-width="180px" |
| | | style="color: red" |
| | | required |
| | | /> |
| | | </wd-form-item> |
| | | <wd-form-item label="实测直径" prop="actualValue2" required> |
| | | <wd-input |
| | | v-model="item.actualValue2" |
| | | placeholder="请输入直径" |
| | | clearable |
| | | type="number" |
| | | :disabled="isViewMode" |
| | | > |
| | | <template #append>mm</template> |
| | | </wd-input> |
| | | </wd-form-item> |
| | | </wd-col> |
| | | <wd-form-item label="标准值" prop="structureValue"> |
| | | <text>{{ item.structureValue || "-" }}</text> |
| | | </wd-form-item> |
| | | <wd-form-item label="实测根数" prop="actualValue1" required> |
| | | <wd-input |
| | | v-model="item.actualValue1" |
| | | placeholder="请输入根数" |
| | | clearable |
| | | type="number" |
| | | :disabled="isViewMode" |
| | | /> |
| | | </wd-form-item> |
| | | <wd-form-item label="实测直径" prop="actualValue2" required> |
| | | <wd-input |
| | | v-model="item.actualValue2" |
| | | placeholder="请输入直径" |
| | | clearable |
| | | type="number" |
| | | :disabled="isViewMode" |
| | | > |
| | | <template #append>mm</template> |
| | | </wd-input> |
| | | </wd-form-item> |
| | | </wd-col> |
| | | </template> |
| | | </wd-row> |
| | | |
| | | <!-- 绞线工艺质量控制 --> |
| | |
| | | const userStore = useUserStore(); |
| | | |
| | | const paramsId = ref(); |
| | | const projectId = ref<string | number>(""); |
| | | const parentData = ref<any>(null); |
| | | const childList = ref<any[]>([]); |
| | | const model = ref(); |
| | |
| | | teamId: getTeamId(), |
| | | type: "拉丝", |
| | | wireId: paramsId.value, |
| | | projectId: projectId.value || undefined, |
| | | poleNumber: parentData.value.poleNumber, |
| | | poleModel: parentData.value.poleModel, |
| | | supplier: parentData.value.supplier, |
| | |
| | | |
| | | onLoad(async (options: any) => { |
| | | paramsId.value = options.wireId; |
| | | projectId.value = options.projectId || ""; |
| | | |
| | | // 从页面参数中获取父级数据 |
| | | parentData.value = { |
| | |
| | | const toast = useToast(); |
| | | const userStore = useUserStore(); |
| | | const paramsId = ref(); |
| | | const projectId = ref<string | number>(""); |
| | | const model = ref(); |
| | | const oneLength = ref(); |
| | | const isMonofil = ref(); |
| | |
| | | const meterWeightParam = meterWeight.value !== undefined && meterWeight.value !== null ? meterWeight.value : ""; |
| | | const totalWeightParam = totalWeight.value !== undefined && totalWeight.value !== null ? totalWeight.value : ""; |
| | | uni.navigateTo({ |
| | | url: `/pages/production/wire/report/reportManage?wireId=${paramsId.value}&parentId=${parentRow.id}&poleNumber=${parentRow.poleNumber}&poleModel=${parentRow.poleModel}&polePackageNumber=${parentRow.polePackageNumber}&poleWeight=${parentRow.poleWeight}&supplier=${parentRow.supplier || ""}&isMonofil=${isMonofilParam}&meterWeight=${meterWeightParam}&totalWeight=${totalWeightParam}`, |
| | | url: `/pages/production/wire/report/reportManage?wireId=${paramsId.value}&parentId=${parentRow.id}&poleNumber=${parentRow.poleNumber}&poleModel=${parentRow.poleModel}&polePackageNumber=${parentRow.polePackageNumber}&poleWeight=${parentRow.poleWeight}&supplier=${parentRow.supplier || ""}&isMonofil=${isMonofilParam}&meterWeight=${meterWeightParam}&totalWeight=${totalWeightParam}&projectId=${projectId.value}`, |
| | | }); |
| | | }; |
| | | |
| | |
| | | |
| | | onLoad(async (options: any) => { |
| | | paramsId.value = options.id; |
| | | projectId.value = options.projectId || ""; |
| | | model.value = options.model; |
| | | oneLength.value = options.oneLength; |
| | | isMonofil.value = options.isMonofil; |
| | |
| | | <view style="margin: 10rpx"> |
| | | <text class="title">{{ "结构标准值和实测" }}</text> |
| | | </view> |
| | | <wd-col |
| | | :span="24" |
| | | v-for="(item, index) in formData.structureItems" |
| | | :key="index" |
| | | style="padding-bottom: 10px" |
| | | > |
| | | <wd-form-item |
| | | prop="structureItemsGroup" |
| | | :label="formatValue(item.structureName)" |
| | | label-width="400rpx" |
| | | style="color: red" |
| | | required |
| | | ></wd-form-item> |
| | | <wd-form-item label="标准值" prop="structureValue" required> |
| | | {{ formatValue(item.structureValue) }} |
| | | </wd-form-item> |
| | | <wd-form-item label="实测根数" prop="actualValue1" required> |
| | | <template v-if="isEdit"> |
| | | <wd-input v-model="item.actualValue1" placeholder="请输入实测根数" type="number" /> |
| | | </template> |
| | | <template v-else> |
| | | {{ formatValue(item.actualValue1, "根") }} |
| | | </template> |
| | | </wd-form-item> |
| | | <wd-form-item label="实测直径" prop="actualValue2" required> |
| | | <template v-if="isEdit"> |
| | | <wd-input |
| | | v-model="item.actualValue2" |
| | | placeholder="请输入实测直径(mm)" |
| | | type="number" |
| | | /> |
| | | </template> |
| | | <template v-else> |
| | | {{ formatValue(item.actualValue2, "mm") }} |
| | | </template> |
| | | </wd-form-item> |
| | | </wd-col> |
| | | <template v-for="(item, index) in formData.structureItems" :key="index"> |
| | | <wd-col |
| | | :span="24" |
| | | v-if="!item.structureName?.includes('钢')" |
| | | style="padding-bottom: 10px" |
| | | > |
| | | <wd-form-item |
| | | prop="structureItemsGroup" |
| | | :label="formatValue(item.structureName)" |
| | | label-width="400rpx" |
| | | style="color: red" |
| | | required |
| | | ></wd-form-item> |
| | | <wd-form-item label="标准值" prop="structureValue" required> |
| | | {{ formatValue(item.structureValue) }} |
| | | </wd-form-item> |
| | | <wd-form-item label="实测根数" prop="actualValue1" required> |
| | | <template v-if="isEdit"> |
| | | <wd-input v-model="item.actualValue1" placeholder="请输入实测根数" type="number" /> |
| | | </template> |
| | | <template v-else> |
| | | {{ formatValue(item.actualValue1, "根") }} |
| | | </template> |
| | | </wd-form-item> |
| | | <wd-form-item label="实测直径" prop="actualValue2" required> |
| | | <template v-if="isEdit"> |
| | | <wd-input |
| | | v-model="item.actualValue2" |
| | | placeholder="请输入实测直径(mm)" |
| | | type="number" |
| | | /> |
| | | </template> |
| | | <template v-else> |
| | | {{ formatValue(item.actualValue2, "mm") }} |
| | | </template> |
| | | </wd-form-item> |
| | | </wd-col> |
| | | </template> |
| | | </wd-row> |
| | | |
| | | <!-- 绞线工艺质量控制(可编辑) --> |