曹睿
2025-04-24 5519cbf2e00c7ba4c650a542d98da99978124a30
test: 测试生产管理
已修改19个文件
614 ■■■■■ 文件已修改
src/api/product/manage.ts 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/product/twist.ts 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/product_card/index.vue 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/index/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/mine/index.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/production/detail/twistDetail.vue 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/production/detail/wireDetail.vue 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/production/list/index.vue 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/production/twist/backman/index.vue 52 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/production/twist/receive/plate/index.vue 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/production/twist/receive/steelCore/index.vue 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/production/twist/report/form.vue 92 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/production/twist/report/index.vue 40 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/production/twist/selfInspect/index.vue 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/production/wire/backman/form.vue 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/production/wire/backman/index.vue 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/production/wire/report/wire.vue 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/production/wire/report/wireForm.vue 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/production/wire/selfInspect/index.vue 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/product/manage.ts
@@ -36,6 +36,31 @@
      data: params,
    });
  },
  // 查询杂工信息
  getBackmanDetail(params: any) {
    return request<BaseResult<any>>({
      url: "/app/getBackmanDetail",
      method: "GET",
      data: params,
    });
  },
  // 获取杂工项目
  getBackmanDetailByType(params: any) {
    return request<BaseResult<any>>({
      url: "/app/getBackmanDetailByType",
      method: "GET",
      data: params,
    });
  },
  addBackmanDetail(params: any) {
    return request<BaseResult<any>>({
      url: "/app/addBackmanDetail",
      method: "POST",
      data: params,
    });
  },
};
export default ManageApi;
src/api/product/twist.ts
@@ -11,10 +11,10 @@
    });
  },
  // 新增拉丝报工
  addWireOutput(data: any) {
  // 新增绞丝报工
  addTwistOutput(data: any) {
    return request<BaseResult<any>>({
      url: "/app/addWireOutput",
      url: "/app/addWireOutput1",
      method: "POST",
      data: data,
    });
src/components/product_card/index.vue
@@ -2,9 +2,9 @@
  <wd-card class="card_bg">
    <template #title>
      <view class="flex justify-between w-full">
        <text class="font-medium text-[#252525]">设备编号: {{ data.deviceModel }}</text>
        <text class="font-medium text-[#252525]">设备编号: {{ data[map.deviceModel] }}</text>
        <wd-tag color="#0D867F" bg-color="#E7F4EC">
          <text class="text-xs">{{ data.model }}</text>
          <text class="text-xs">{{ data[map.model] }}</text>
        </wd-tag>
      </view>
    </template>
@@ -16,7 +16,7 @@
          </view>
          <text class="text-[#646874] mx-2">
            总需求数量:
            <text class="text-[#252525]">{{ data.totalAmount }}m</text>
            <text class="text-[#252525]">{{ data[map.totalAmount] }}m</text>
          </text>
        </view>
      </wd-col>
@@ -29,7 +29,7 @@
          </view>
          <text class="text-[#646874] mx-2">
            已生产数量:
            <text class="text-[#252525]">{{ data.amount }}m</text>
            <text class="text-[#252525]">{{ data[map.amount] }}m</text>
          </text>
        </view>
      </wd-col>
@@ -40,7 +40,7 @@
          </view>
          <text class="text-[#646874] mx-2">
            待排产数量:
            <text class="text-[#252525]">{{ data.unAmount }}m</text>
            <text class="text-[#252525]">{{ data[map.unAmount] }}m</text>
          </text>
        </view>
      </wd-col>
@@ -54,6 +54,10 @@
    type: Object,
    default: () => {},
  },
  map: {
    type: Object,
    default: () => {},
  },
});
</script>
src/pages/index/index.vue
@@ -32,7 +32,7 @@
    </wd-grid>
    <!-- 数据统计 -->
    <wd-grid :column="2" :gutter="2">
    <!-- <wd-grid :column="2" :gutter="2">
      <wd-grid-item use-slot custom-class="custom-item">
        <view class="flex justify-start pl-5">
          <view class="flex-center">
@@ -55,7 +55,7 @@
          </view>
        </view>
      </wd-grid-item>
    </wd-grid>
    </wd-grid> -->
    <wd-card>
      <template #title>
src/pages/mine/index.vue
@@ -39,7 +39,7 @@
    </view>
    <!-- 数据统计 -->
    <view class="stats-container">
    <!-- <view class="stats-container">
      <view class="stat-item" @click="navigateToSection('wallet')">
        <view class="stat-value">0.00</view>
        <view class="stat-label">我的余额</view>
@@ -54,10 +54,10 @@
        <view class="stat-value">0</view>
        <view class="stat-label">浏览历史</view>
      </view>
    </view>
    </view> -->
    <!-- 我的订单 -->
    <view class="card-container">
    <!-- <view class="card-container">
      <view class="card-header">
        <view class="card-title">
          <wd-icon name="cart" size="18" :color="themeStore.primaryColor" />
@@ -101,7 +101,7 @@
          <view class="status-label">售后</view>
        </view>
      </view>
    </view>
    </view> -->
    <!-- 常用工具 -->
    <view class="card-container">
src/pages/production/detail/twistDetail.vue
@@ -1,6 +1,15 @@
<template>
  <view>
    <ProductCard :data="cardData" />
    <ProductCard
      :data="cardData"
      :map="{
        deviceModel: 'deviceModel',
        model: 'model',
        totalAmount: 'totalAmount',
        amount: 'amount',
        unAmount: 'unAmount',
      }"
    />
    <view class="mx-3">
      <wd-grid class="rounded-lg" clickable>
        <wd-grid-item
@@ -18,7 +27,7 @@
        <wd-grid-item
          icon="tips"
          link-type="navigateTo"
          url="/pages/production/twist/backman/index"
          :url="`/pages/production/twist/backman/index?id=${paramsId}`"
          text="杂工"
        />
        <wd-grid-item
src/pages/production/detail/wireDetail.vue
@@ -1,6 +1,15 @@
<template>
  <view class="pt-2">
    <ProductCard :data="cardData" />
    <ProductCard
      :data="cardData"
      :map="{
        deviceModel: 'deviceModel',
        model: 'model',
        totalAmount: 'totalAmount',
        amount: 'amount',
        unAmount: 'unAmount',
      }"
    />
    <view class="mx-3">
      <wd-grid class="rounded-lg" clickable>
        <wd-grid-item
@@ -18,7 +27,7 @@
        <wd-grid-item
          icon="tips"
          link-type="navigateTo"
          url="/pages/production/wire/backman/index"
          :url="`/pages/production/wire/backman/index?id=${paramsId}`"
          text="杂工"
        />
        <wd-grid-item
src/pages/production/list/index.vue
@@ -13,13 +13,8 @@
      <ProductCard
        v-for="(item, index) in list"
        :key="index"
        :data="{
          deviceModel: item.deviceModel,
          model: item.model,
          totalAmount: item.totalLength,
          amount: item.length,
          unAmount: item.unLength,
        }"
        :data="item"
        :map="map"
        @click="toDetail(item.id, item.type)"
      />
    </z-paging>
@@ -34,6 +29,13 @@
const userStore = useUserStore();
const userInfo: any = computed(() => userStore.userInfo);
const pagingRef = ref();
const map = reactive({
  deviceModel: "deviceModel",
  model: "model",
  totalAmount: "totalAmount",
  amount: "amount",
  unAmount: "unAmount",
});
const props = defineProps({
  api: {
    type: Function,
@@ -68,12 +70,25 @@
    size: pageSize,
  });
  if (code == 200) {
    if (data.total == 0) {
    if (data.type == "绞线") {
      map.deviceModel = "deviceModel";
      map.model = "model";
      map.totalAmount = "totalLength";
      map.amount = "length";
      map.unAmount = "unLength";
    } else if (data.type == "拉丝") {
      map.deviceModel = "deviceModel";
      map.model = "model";
      map.totalAmount = "totalAmount";
      map.amount = "amount";
      map.unAmount = "unAmount";
    }
    if (data.data.total == 0) {
      pagingRef.value.complete(true);
    } else {
      pagingRef.value.complete(data.records);
      pagingRef.value.complete(data.data.records);
    }
    emits("ok", data.total);
    emits("ok", data.data.total);
  }
};
</script>
src/pages/production/twist/backman/index.vue
@@ -1,8 +1,16 @@
<template>
  <view class="page pt-2">
    <CardTitle title="绞线杂工信息" :hideAction="true" @action="addReport" />
    <view class="list">
      <wd-card type="rectangle" custom-class="round">
  <view class="list">
    <z-paging
      ref="pagingRef"
      v-model="cardList"
      :fixed="false"
      :auto-show-back-to-top="true"
      @query="getList"
    >
      <template #top>
        <CardTitle title="绞线杂工信息" :hideAction="true" @action="addReport" />
      </template>
      <wd-card v-for="(item, index) in cardList" :key="index" type="rectangle" custom-class="round">
        <template #title>
          <view class="flex justify-between">
            <view>
@@ -14,7 +22,7 @@
        </template>
        <ProductionCard :data="cardAttr" color="#0D867F" />
      </wd-card>
    </view>
    </z-paging>
    <wd-popup v-model="dialog.visible" position="bottom" custom-class="yl-popup">
      <view class="action px-3">
        <wd-button type="text" @click="cancel">取消</wd-button>
@@ -31,12 +39,17 @@
import ProductionCard from "../../components/ProductionCard.vue";
import { useToast } from "wot-design-uni";
import BackmanForm from "./form.vue";
import { onLoad } from "@dcloudio/uni-app";
import zPaging from "@/components/z-paging/z-paging.vue";
import ManageApi from "@/api/product/manage";
const paramsId = ref();
const pagingRef = ref();
const toast = useToast();
const dialog = reactive({
  visible: false,
});
const cardList = ref<any[]>([]);
const cardAttr = ref<any[]>([
  {
    label: "单位",
@@ -83,20 +96,29 @@
  toast.show("取消");
  dialog.visible = false;
};
const getList = async () => {
  const { code, data } = await ManageApi.getBackmanDetail({
    wireId: paramsId.value,
  });
  if (code == 200) {
    pagingRef.value.complete(data);
  }
};
onLoad((options: any) => {
  paramsId.value = options.id;
});
</script>
<style lang="scss" scoped>
.page {
.list {
  height: calc(100vh - 80px);
  padding: 12px;
  background: #f3f9f8;
  .list {
    height: calc(100vh - 120px);
    margin: 12px;
    overflow: scroll;
    :deep() {
      .round {
        border-radius: 4px;
      }
  :deep() {
    .round {
      border-radius: 4px;
    }
  }
}
src/pages/production/twist/receive/plate/index.vue
@@ -17,21 +17,21 @@
              <wd-icon name="a-rootlist" color="#0D867F"></wd-icon>
              <text class="text-[#252525] ml-2 font-medium">{{ item.diskMaterial }}</text>
            </view>
            <view class="text-[#A8A8A8]" @click="toEdit">编辑</view>
            <view class="text-[#A8A8A8]" @click="toEdit(item.id)">编辑</view>
          </view>
        </template>
        <ProductionCard :data="cardAttr" :value="item" color="#0D867F" />
      </wd-card>
    </z-paging>
    <wd-popup v-model="dialog.visible" position="bottom" custom-class="yl-popup">
      <view class="action px-3">
        <wd-button type="text" @click="cancel">取消</wd-button>
        <wd-button type="text" @click="submit">确定</wd-button>
      </view>
      <PlateForm ref="plateFormRef" @refresh="reloadList" />
    </wd-popup>
    <wd-toast />
  </view>
  <wd-popup v-model="dialog.visible" position="bottom" custom-class="yl-popup">
    <view class="action px-3">
      <wd-button type="text" @click="cancel">取消</wd-button>
      <wd-button type="text" @click="submit">确定</wd-button>
    </view>
    <PlateForm ref="plateFormRef" @refresh="reloadList" />
  </wd-popup>
  <wd-toast />
</template>
<script setup lang="ts">
@@ -74,9 +74,9 @@
  },
]);
const toEdit = () => {
const toEdit = (id: number) => {
  uni.navigateTo({
    url: "/pages/production/twist/receive/plate/edit",
    url: `/pages/production/twist/receive/plate/edit?id=${id}`,
  });
};
src/pages/production/twist/receive/steelCore/index.vue
@@ -17,7 +17,7 @@
              <wd-icon name="a-rootlist" color="#0D867F"></wd-icon>
              <text class="text-[#252525] ml-2 font-medium">{{ item.model }}</text>
            </view>
            <view class="text-[#A8A8A8]" @click="toEdit">编辑</view>
            <view class="text-[#A8A8A8]" @click="toEdit(item.id)">编辑</view>
          </view>
        </template>
        <ProductionCard :data="cardAttr" :value="item" color="#0D867F" />
@@ -69,9 +69,9 @@
  },
]);
const toEdit = () => {
const toEdit = (id: number) => {
  uni.navigateTo({
    url: "/pages/production/twist/receive/steelCore/edit",
    url: `/pages/production/twist/receive/steelCore/edit?id=${id}`,
  });
};
@@ -79,9 +79,8 @@
  dialog.visible = true;
};
const submit = () => {
  toast.show("提交");
  dialog.visible = false;
const submit = async () => {
  dialog.visible = !(await steelCoreRef.value.submit());
};
const cancel = () => {
src/pages/production/twist/report/form.vue
@@ -3,75 +3,59 @@
    <wd-cell-group :border="true">
      <wd-input
        v-model="model.contractNo"
        label="合同号"
        label="领用杆号"
        label-width="100px"
        prop="contractNo"
        clearable
        placeholder="请输入合同号"
        placeholder="请输入领用杆号"
      />
      <wd-input
        v-model="model.status"
        label="状态"
        label="杆重(kg)"
        label-width="100px"
        prop="status"
        clearable
        placeholder="请输入状态"
        placeholder="请输入杆重"
      />
      <wd-input
        v-model="model.clientName"
        label="客户名称"
        label="单丝盘号"
        label-width="100px"
        prop="clientName"
        clearable
        placeholder="请输入客户名称"
        placeholder="请输入单丝盘号"
      />
      <wd-input
        v-model="model.workbench"
        label="机台"
        label="实际重量(kg)"
        label-width="100px"
        prop="workbench"
        clearable
        placeholder="请输入机台"
        placeholder="请输入实际重量"
      />
      <wd-input
        v-model="model.quality"
        label="质量追溯号"
        label-width="100px"
        prop="quality"
        clearable
        placeholder="请输入质量追溯号"
      />
      <wd-input
        v-model="model.specification"
        label="规格型号"
        label-width="100px"
        prop="specification"
        clearable
        placeholder="请输入规格型号"
      />
      <wd-input
        v-model="model.disc"
        label="盘长(m)"
        label-width="100px"
        prop="disc"
        prop="quality"
        clearable
        placeholder="请输入盘长"
      />
      <wd-input
        v-model="model.produced"
        label="已生产(m)"
        v-model="model.specification"
        label="理论重量(kg)"
        label-width="100px"
        prop="produced"
        prop="specification"
        clearable
        placeholder="请输入已生产"
        placeholder="请输入理论重量"
      />
      <wd-input
        v-model="model.beProduced"
        label="待生产(m)"
        v-model="model.disc"
        label="规格型号"
        label-width="100px"
        prop="beProduced"
        prop="disc"
        clearable
        placeholder="请输入单丝盘长"
        placeholder="请输入规格型号"
      />
    </wd-cell-group>
  </wd-form>
@@ -79,17 +63,41 @@
<script lang="ts" setup>
import useFormData from "@/hooks/useFormData";
import { useToast } from "wot-design-uni";
import TwistApi from "@/api/product/twist";
const paramsId = ref();
const toast = useToast();
const { form: model } = useFormData({
  contractNo: undefined, // 合同号
  status: undefined, // 状态
  clientName: undefined, // 客户名称
  workbench: undefined, // 机台
  quality: undefined, // 质量追溯号
  specification: undefined, // 规格型号
  disc: undefined, // 盘长
  produced: undefined, // 已生产
  beProduced: undefined, // 待生产
  poleNumber: undefined, // 领用杆号
  poleWeight: undefined, // 杆重(kg)
  monofilamentNumber: undefined, // 单丝盘号
  actuallyWeight: undefined, // 实际重量(kg)
  ontLength: undefined, // 盘长(m)
  theoryWeight: undefined, // 理论重量(kg)
  model: undefined, // 规格型号
});
const submit = async () => {
  const { code } = await TwistApi.addTwistOutput({
    wireId: paramsId.value,
    ...model,
  });
  if (code == 200) {
    toast.success("提交成功");
    return true;
  } else {
    toast.error("提交失败");
    return false;
  }
};
onLoad((options: any) => {
  paramsId.value = options.id;
});
defineExpose({
  submit,
});
</script>
src/pages/production/twist/report/index.vue
@@ -1,6 +1,6 @@
<template>
  <view class="page pt-2">
    <z-paging ref="pagingRef" v-model="twistReportList" class="list" @query="getTwistReportList">
  <view class="list">
    <z-paging ref="pagingRef" v-model="twistReportList" :fixed="false" @query="getTwistReportList">
      <template #top>
        <CardTitle title="报工信息" :hideAction="true" :full="false" @action="addReport" />
      </template>
@@ -10,14 +10,14 @@
            <view>
              <wd-icon name="user" color="#0D867F"></wd-icon>
              <text class="text-[#0D867F] ml-2 font-medium">生产人</text>
              <text class="text-[#333333] ml-2">方兆玉</text>
              <text class="text-[#333333] ml-2">{{ item.productUser }}</text>
            </view>
            <view class="text-[#A8A8A8]" @click="toEdit">编辑</view>
          </view>
        </template>
        <ProductionCard :data="cardAttr" :value="item" />
        <template #footer>
          <wd-button size="small" plain @click="toCheck">自检</wd-button>
          <wd-button size="small" plain @click="toCheck(item.id)">自检</wd-button>
        </template>
      </wd-card>
    </z-paging>
@@ -27,7 +27,7 @@
        <wd-button type="text" @click="cancel">取消</wd-button>
        <wd-button type="text" @click="submit">确定</wd-button>
      </view>
      <TwistForm />
      <TwistForm ref="twistFormRef" />
    </wd-popup>
    <wd-toast />
  </view>
@@ -42,6 +42,7 @@
const pagingRef = ref();
const paramsId = ref();
const twistFormRef = ref();
const toast = useToast();
const dialog = reactive({
  visible: false,
@@ -61,8 +62,8 @@
    prop: "monofilamentNumber",
  },
  {
    label: "规格型号",
    prop: "model",
    label: "实际重量(kg)",
    prop: "actuallyWeight",
  },
  {
    label: "盘长(m)",
@@ -73,8 +74,8 @@
    prop: "theoryWeight",
  },
  {
    label: "实际重量(kg)",
    prop: "actuallyWeight",
    label: "规格型号",
    prop: "model",
  },
]);
@@ -91,8 +92,7 @@
};
const submit = () => {
  toast.show("提交");
  dialog.visible = false;
  dialog.visible = twistFormRef.value.submit();
};
const cancel = () => {
@@ -100,9 +100,9 @@
  dialog.visible = false;
};
const toCheck = () => {
const toCheck = (id: number) => {
  uni.navigateTo({
    url: "/pages/production/twist/selfInspect/index",
    url: `/pages/production/twist/selfInspect/index?id=${id}`,
  });
};
@@ -121,16 +121,14 @@
</script>
<style lang="scss" scoped>
.page {
.list {
  height: calc(100vh - 120px);
  padding: 12px;
  background: #f3f9f8;
  .list {
    margin: 12px;
    :deep() {
      .round {
        border-radius: 4px;
      }
  :deep() {
    .round {
      border-radius: 4px;
    }
  }
}
src/pages/production/twist/selfInspect/index.vue
@@ -1,20 +1,22 @@
<template>
  <view class="page pt-2">
    <CardTitle title="绞线自检" :hideAction="true" @action="addReport" />
    <view class="list">
      <wd-card type="rectangle" custom-class="round">
  <view class="list">
    <z-paging ref="pagingRef" v-model="cardList" :fixed="false" @query="getList">
      <template #top>
        <CardTitle title="绞线自检" :hideAction="false" />
      </template>
      <wd-card v-for="(item, index) in cardList" :key="index" type="rectangle" custom-class="round">
        <template #title>
          <view class="flex justify-between">
            <view>
              <wd-icon name="a-rootlist" color="#0D867F"></wd-icon>
              <text class="text-[#252525] ml-2 font-medium">自检项目名称</text>
              <text class="text-[#252525] ml-2 font-medium">{{ item.inspectionProject }}</text>
            </view>
            <view class="text-[#A8A8A8]" @click="toEdit">编辑</view>
          </view>
        </template>
        <ProductionCard :data="cardAttr" color="#0D867F" />
        <ProductionCard :data="cardAttr" :value="item" color="#0D867F" />
      </wd-card>
    </view>
    </z-paging>
    <wd-popup v-model="dialog.visible" position="bottom" custom-class="yl-popup">
      <view class="action px-3">
        <wd-button type="text" @click="cancel">取消</wd-button>
@@ -31,7 +33,10 @@
import ProductionCard from "../../components/ProductionCard.vue";
import { useToast } from "wot-design-uni";
import SelfInspectForm from "./form.vue";
import ManageApi from "@/api/product/manage";
const pagingRef = ref();
const paramsId = ref();
const toast = useToast();
const dialog = reactive({
  visible: false,
@@ -39,25 +44,27 @@
const cardAttr = ref<any[]>([
  {
    label: "单位",
    value: "nΩ·m",
    prop: "inspectionUnit",
  },
  {
    label: "标准值",
    value: "1246",
    prop: "standardValue",
  },
  {
    label: "自检值",
    value: "1245",
    prop: "inspectionItem",
  },
  {
    label: "自检结果",
    value: "不合格",
    prop: "inspectionResult",
    color: "#FF1E1E",
  },
]);
const addReport = () => {
  dialog.visible = true;
};
const cardList = ref<any[]>([]);
// const addReport = () => {
//   dialog.visible = true;
// };
const toEdit = () => {
  uni.navigateTo({
@@ -73,20 +80,29 @@
  toast.show("取消");
  dialog.visible = false;
};
const getList = async () => {
  const { data } = await ManageApi.getSelfInspection({
    outPutId: paramsId.value,
    type: "绞线",
  });
  pagingRef.value.complete(data);
};
onLoad((options: any) => {
  paramsId.value = options.id;
});
</script>
<style lang="scss" scoped>
.page {
.list {
  height: calc(100vh - 120px);
  padding: 12px;
  background: #f3f9f8;
  .list {
    height: calc(100vh - 120px);
    margin: 12px;
    overflow: scroll;
    :deep() {
      .round {
        border-radius: 4px;
      }
  :deep() {
    .round {
      border-radius: 4px;
    }
  }
}
src/pages/production/wire/backman/form.vue
@@ -1,13 +1,12 @@
<template>
  <wd-form ref="form" :model="model" class="relative form_box">
    <wd-cell-group :border="true">
      <wd-input
      <wd-picker
        v-model="model.workbench"
        :columns="columns"
        label="杂工名称"
        label-width="100px"
        prop="workbench"
        clearable
        placeholder="请输入杂工名称"
        placeholder="请选择杂工名称"
      />
      <wd-input
        v-model="model.poleNo"
@@ -47,6 +46,13 @@
<script setup lang="ts">
import useFormData from "@/hooks/useFormData";
import ManageApi from "@/api/product/manage";
import { onLoad } from "@dcloudio/uni-app";
import { useToast } from "wot-design-uni";
const columns = ref([]);
const paramsId = ref();
const toast = useToast();
const { form: model } = useFormData({
  backmanName: undefined, // 杂工名称
  unit: undefined, // 单位
@@ -54,6 +60,37 @@
  caller: undefined, // 报工人
  callerDate: undefined, // 报工日期
});
const getBackman = async () => {
  const { data } = await ManageApi.getBackmanDetailByType({ type: "拉丝" });
  columns.value = data.map((item: any) => item.backmanProject);
};
const submit = async () => {
  const { code } = await ManageApi.addBackmanDetail([
    {
      wireId: paramsId.value,
      type: "拉丝",
      ...model,
    },
  ]);
  if (code == 200) {
    toast.success("提交成功");
    return true;
  } else {
    toast.error("提交失败");
    return false;
  }
};
onLoad((options: any) => {
  paramsId.value = options.id;
  getBackman();
});
defineExpose({
  submit,
});
</script>
<style lang="scss" scoped>
.form_box {
src/pages/production/wire/backman/index.vue
@@ -1,8 +1,10 @@
<template>
  <view class="page pt-2">
    <CardTitle title="杂工信息" :hideAction="true" @action="addReport" />
    <view class="list">
      <wd-card type="rectangle" custom-class="round">
  <view class="list">
    <z-paging ref="pagingRef" v-model="cardList" :fixed="false" @query="getList">
      <template #top>
        <CardTitle title="杂工信息" :full="false" :hideAction="true" @action="addReport" />
      </template>
      <wd-card v-for="(item, index) in cardList" :key="index" type="rectangle" custom-class="round">
        <template #title>
          <view class="flex justify-between">
            <view>
@@ -14,13 +16,13 @@
        </template>
        <ProductionCard :data="cardAttr" color="#0D867F" />
      </wd-card>
    </view>
    </z-paging>
    <wd-popup v-model="dialog.visible" position="bottom" custom-class="yl-popup">
      <view class="action px-3">
        <wd-button type="text" @click="cancel">取消</wd-button>
        <wd-button type="text" @click="submit">确定</wd-button>
      </view>
      <BackmanForm />
      <BackmanForm ref="backmanFormRef" />
    </wd-popup>
    <wd-toast />
  </view>
@@ -31,7 +33,11 @@
import ProductionCard from "../../components/ProductionCard.vue";
import { useToast } from "wot-design-uni";
import BackmanForm from "./form.vue";
import ManageApi from "@/api/product/manage";
const pagingRef = ref();
const backmanFormRef = ref();
const paramsId = ref();
const toast = useToast();
const dialog = reactive({
  visible: false,
@@ -64,6 +70,8 @@
  },
]);
const cardList = ref<any[]>([]);
const toEdit = () => {
  uni.navigateTo({
    url: "/pages/production/wire/backman/edit",
@@ -75,28 +83,36 @@
};
const submit = () => {
  toast.show("提交");
  dialog.visible = false;
  dialog.visible = backmanFormRef.value.submit();
};
const cancel = () => {
  toast.show("取消");
  dialog.visible = false;
};
const getList = async () => {
  const { data } = await ManageApi.getBackmanDetail({
    outPutId: paramsId.value,
    type: "拉丝",
  });
  pagingRef.value.complete(data);
};
onLoad((options: any) => {
  paramsId.value = options.id;
});
</script>
<style lang="scss" scoped>
.page {
.list {
  height: calc(100vh - 120px);
  padding: 12px;
  background: #f3f9f8;
  .list {
    height: calc(100vh - 120px);
    margin: 12px;
    overflow: scroll;
    :deep() {
      .round {
        border-radius: 4px;
      }
  :deep() {
    .round {
      border-radius: 4px;
    }
  }
}
src/pages/production/wire/report/wire.vue
@@ -1,6 +1,6 @@
<template>
  <view class="page pt-2">
    <z-paging ref="pagingRef" v-model="wireReportList" class="list" @query="getWireReportList">
  <view class="list">
    <z-paging ref="pagingRef" v-model="wireReportList" :fixed="false" @query="getWireReportList">
      <template #top>
        <CardTitle title="报工信息" :hideAction="true" :full="false" @action="addReport" />
      </template>
@@ -26,7 +26,6 @@
        </template>
      </wd-card>
    </z-paging>
    <wd-popup v-model="dialog.visible" position="bottom" custom-class="yl-popup">
      <view class="action px-3">
        <wd-button type="text" @click="cancel">取消</wd-button>
@@ -45,7 +44,6 @@
import zPaging from "@/components/z-paging/z-paging.vue";
import { onLoad } from "@dcloudio/uni-app";
import ManageApi from "@/api/product/manage";
import WireApi from "@/api/product/wire";
const pagingRef = ref();
const wireFormRef = ref();
@@ -74,7 +72,7 @@
  },
  {
    label: "盘长(m)",
    prop: "ontLength",
    prop: "oneLength",
  },
  {
    label: "理论重量(kg)",
@@ -98,13 +96,8 @@
  dialog.visible = true;
};
const submit = async () => {
  toast.show("提交");
  await WireApi.addWireOutput({
    wireId: paramsId.value,
    type: "拉丝",
    ...wireFormRef.value.model,
  });
const submit = () => {
  dialog.visible = wireFormRef.value.submit();
};
const cancel = () => {
@@ -133,17 +126,14 @@
</script>
<style lang="scss" scoped>
.page {
.list {
  height: calc(100vh - 120px);
  padding: 12px;
  background: #f3f9f8;
  .list {
    margin: 12px;
    background: #f3f9f8;
    :deep() {
      .round {
        border-radius: 4px;
      }
  :deep() {
    .round {
      border-radius: 4px;
    }
  }
}
src/pages/production/wire/report/wireForm.vue
@@ -58,23 +58,47 @@
        placeholder="请输入实际重量"
      />
    </wd-cell-group>
    <wd-toast />
  </wd-form>
</template>
<script lang="ts" setup>
import useFormData from "@/hooks/useFormData";
import { useToast } from "wot-design-uni";
import WireApi from "@/api/product/wire";
const paramsId = ref();
const toast = useToast();
const { form: model } = useFormData({
  poleNumber: undefined, // 领用杆号
  poleWeight: undefined, // 客户名称
  monofilamentNumber: undefined, // 单丝盘号
  model: undefined, // 规格型号
  ontLength: undefined, // 盘长
  oneLength: undefined, // 盘长
  singleDisc: undefined, // 单丝盘长
});
const submit = async () => {
  const { code } = await WireApi.addWireOutput({
    wireId: paramsId.value,
    type: "拉丝",
    ...model,
  });
  if (code == 200) {
    toast.success("提交成功");
    return true;
  } else {
    toast.error("提交失败");
    return false;
  }
};
onLoad((options: any) => {
  paramsId.value = options.id;
});
defineExpose({
  model,
  submit,
});
</script>
src/pages/production/wire/selfInspect/index.vue
@@ -1,20 +1,22 @@
<template>
  <view class="page pt-2">
    <CardTitle title="拉丝自检" :hideAction="true" @action="addReport" />
    <view class="list">
      <wd-card type="rectangle" custom-class="round">
  <view class="list">
    <z-paging ref="pagingRef" v-model="cardList" :fixed="false" @query="getList">
      <template #top>
        <CardTitle title="拉丝自检" :hideAction="false" />
      </template>
      <wd-card v-for="(item, index) in cardList" :key="index" type="rectangle" custom-class="round">
        <template #title>
          <view class="flex justify-between">
            <view>
              <wd-icon name="a-rootlist" color="#0D867F"></wd-icon>
              <text class="text-[#252525] ml-2 font-medium">自检项目名称</text>
              <text class="text-[#252525] ml-2 font-medium">{{ item.inspectionProject }}</text>
            </view>
            <view class="text-[#A8A8A8]" @click="toEdit">编辑</view>
          </view>
        </template>
        <ProductionCard :data="cardAttr" color="#0D867F" />
        <ProductionCard :data="cardAttr" :value="item" color="#0D867F" />
      </wd-card>
    </view>
    </z-paging>
    <wd-popup v-model="dialog.visible" position="bottom" custom-class="yl-popup">
      <view class="action px-3">
        <wd-button type="text" @click="cancel">取消</wd-button>
@@ -31,7 +33,10 @@
import ProductionCard from "../../components/ProductionCard.vue";
import { useToast } from "wot-design-uni";
import SelfInspectForm from "./form.vue";
import ManageApi from "@/api/product/manage";
const pagingRef = ref();
const paramsId = ref();
const toast = useToast();
const dialog = reactive({
  visible: false,
@@ -39,25 +44,27 @@
const cardAttr = ref<any[]>([
  {
    label: "单位",
    value: "nΩ·m",
    prop: "inspectionUnit",
  },
  {
    label: "标准值",
    value: "1246",
    prop: "standardValue",
  },
  {
    label: "自检值",
    value: "1245",
    prop: "inspectionItem",
  },
  {
    label: "自检结果",
    value: "不合格",
    prop: "inspectionResult",
    color: "#FF1E1E",
  },
]);
const addReport = () => {
  dialog.visible = true;
};
const cardList = ref<any[]>([]);
// const addReport = () => {
//   dialog.visible = true;
// };
const toEdit = () => {
  uni.navigateTo({
@@ -73,20 +80,29 @@
  toast.show("取消");
  dialog.visible = false;
};
const getList = async () => {
  const { data } = await ManageApi.getSelfInspection({
    outPutId: paramsId.value,
    type: "拉丝",
  });
  pagingRef.value.complete(data);
};
onLoad((options: any) => {
  paramsId.value = options.id;
});
</script>
<style lang="scss" scoped>
.page {
.list {
  height: calc(100vh - 120px);
  padding: 12px;
  background: #f3f9f8;
  .list {
    height: calc(100vh - 120px);
    margin: 12px;
    overflow: scroll;
    :deep() {
      .round {
        border-radius: 4px;
      }
  :deep() {
    .round {
      border-radius: 4px;
    }
  }
}