曹睿
3 天以前 665c18b68a5dedba63e00f89f763539967fb7f08
feat: 拉丝添加报工,铝杆支持扫码输入
已修改9个文件
171 ■■■■ 文件已修改
src/pages/login/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/production/detail/wireDetail.vue 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/production/twist/receive/monofil.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/production/twist/report/form.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/production/twist/report/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/production/wire/receive/index.vue 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/production/wire/report/wire.vue 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/production/wire/report/wireForm.vue 104 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/production/wire/selfInspect/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/login/index.vue
@@ -96,7 +96,7 @@
// 登录表单数据
const loginFormData = ref<LoginFormData>({
  username: "31601016",
  username: "32408083",
  // username: "32308027",
  password: "cxjt1234",
});
src/pages/production/detail/wireDetail.vue
@@ -15,7 +15,7 @@
        <wd-grid-item
          icon="computer"
          link-type="navigateTo"
          :url="`/pages/production/wire/report/wire?id=${paramsId}`"
          :url="`/pages/production/wire/report/wire?id=${paramsId}&model=${cardData.model}&oneLength=${cardData.oneLength}`"
          text="报工"
        />
        <!-- <wd-grid-item
@@ -30,12 +30,12 @@
          :url="`/pages/production/wire/backman/index?id=${paramsId}`"
          text="杂工"
        />
        <wd-grid-item
        <!-- <wd-grid-item
          icon="wallet"
          link-type="navigateTo"
          url="/pages/production/wire/receive/index"
          text="材料领用"
        />
        /> -->
      </wd-grid>
    </view>
  </view>
@@ -53,6 +53,7 @@
  totalAmount: undefined,
  amount: undefined,
  unAmount: undefined,
  oneLength: undefined,
});
const getDetailData = async (id: string) => {
@@ -64,6 +65,7 @@
  cardData.totalAmount = data.totalAmount;
  cardData.amount = data.amount;
  cardData.unAmount = data.unAmount;
  cardData.oneLength = data.oneLength;
};
onLoad((options: any) => {
src/pages/production/twist/receive/monofil.vue
@@ -47,7 +47,7 @@
const toast = useToast();
const getScanCode = async (code: any) => {
  // console.log("自定义扫描的结果回调函数:", code);
  console.log("自定义扫描的结果回调函数:", code);
  // let parseData = code.trim();
  console.log("code:===========", JSON.parse(code.code));
  console.log("id:=============", JSON.parse(code.code).id);
src/pages/production/twist/report/form.vue
@@ -73,7 +73,7 @@
  poleWeight: undefined, // 杆重(kg)
  monofilamentNumber: undefined, // 单丝盘号
  actuallyWeight: undefined, // 实际重量(kg)
  ontLength: undefined, // 盘长(m)
  oneLength: undefined, // 盘长(m)
  theoryWeight: undefined, // 理论重量(kg)
  model: undefined, // 规格型号
});
src/pages/production/twist/report/index.vue
@@ -67,7 +67,7 @@
  },
  {
    label: "盘长(m)",
    prop: "ontLength",
    prop: "oneLength",
  },
  {
    label: "理论重量(kg)",
@@ -122,7 +122,7 @@
<style lang="scss" scoped>
.list {
  height: calc(100vh - 120px);
  height: calc(100vh - 80px);
  padding: 12px;
  background: #f3f9f8;
src/pages/production/wire/receive/index.vue
@@ -1,7 +1,9 @@
<template>
  <view class="page pt-2">
    <CardTitle title="拉丝领用" :hideAction="true" @action="addReport" />
    <z-paging ref="paging" refresher-only class="list">
      <template #top>
        <CardTitle title="拉丝领用" :hideAction="true" @action="addReport" />
      </template>
      <wd-card type="rectangle" custom-class="round">
        <template #title>
          <view class="flex justify-between">
src/pages/production/wire/report/wire.vue
@@ -17,7 +17,7 @@
              <text class="text-[#0D867F] ml-2 font-medium">生产人</text>
              <text class="text-[#333333] ml-2">{{ item.productUser }}</text>
            </view>
            <view class="text-[#A8A8A8]" @click="toEdit">编辑</view>
            <!-- <view class="text-[#A8A8A8]" @click="toEdit">编辑</view> -->
          </view>
        </template>
        <ProductionCard :data="cardAttr" :value="item" />
@@ -57,26 +57,40 @@
  {
    label: "领用杆号",
    prop: "poleNumber",
    span: 24,
  },
  {
    label: "单丝盘号",
    prop: "monofilamentNumber",
    span: 24,
  },
  {
    label: "杆型号",
    prop: "poleModel",
  },
  {
    label: "杆包号",
    prop: "polePackageNumber",
  },
  {
    label: "杆重(kg)",
    prop: "poleWeight",
  },
  {
    label: "单丝盘号",
    prop: "monofilamentNumber",
  },
  {
    label: "规格型号",
    prop: "model",
  },
  {
    label: "盘型号",
    prop: "dishModel",
  },
  {
    label: "盘长(m)",
    prop: "oneLength",
  },
  {
    label: "理论重量(kg)",
    prop: "theoryWeight",
    label: "实际长度",
    prop: "actuallyLength",
  },
  {
    label: "实际重量(kg)",
@@ -86,18 +100,19 @@
const wireReportList = ref<any[]>([]);
const toEdit = () => {
  uni.navigateTo({
    url: "/pages/production/wire/report/wireEdit",
  });
};
// const toEdit = () => {
//   uni.navigateTo({
//     url: "/pages/production/wire/report/wireEdit",
//   });
// };
const addReport = () => {
  dialog.visible = true;
};
const submit = () => {
  dialog.visible = wireFormRef.value.submit();
  dialog.visible = !wireFormRef.value.submit();
  pagingRef.value.reload();
};
const cancel = () => {
@@ -127,7 +142,7 @@
<style lang="scss" scoped>
.list {
  height: calc(100vh - 120px);
  height: calc(100vh - 30px);
  padding: 12px;
  background: #f3f9f8;
src/pages/production/wire/report/wireForm.vue
@@ -6,9 +6,12 @@
        label="领用杆号"
        label-width="100px"
        prop="poleNumber"
        clearable
        placeholder="请输入领用杆号"
      />
      >
        <template #suffix>
          <wd-icon name="scan" @click="openScan" />
        </template>
      </wd-input>
      <wd-input
        v-model="model.poleWeight"
        label="杆重"
@@ -18,12 +21,12 @@
        placeholder="请输入杆重"
      />
      <wd-input
        v-model="model.monofilamentNumber"
        label="单丝盘号"
        v-model="model.poleModel"
        label="杆型号"
        label-width="100px"
        prop="monofilamentNumber"
        prop="poleModel"
        clearable
        placeholder="请输入机台"
        placeholder="请输入杆型号"
      />
      <wd-input
        v-model="model.model"
@@ -34,31 +37,60 @@
        placeholder="请输入规格型号"
      />
      <wd-input
        v-model="model.ontLength"
        label="盘长"
        v-model="model.oneLength"
        label="盘长(m)"
        label-width="100px"
        prop="ontLength"
        prop="oneLength"
        clearable
        placeholder="请输入盘长"
      />
      <wd-input
        v-model="model.theoryWeight"
        label="理论重量"
        v-model="model.polePackageNumber"
        label-width="100px"
        prop="theoryWeight"
        prop="polePackageNumber"
        clearable
        placeholder="请输入理论重量"
      />
        placeholder="请输入杆包号"
      >
          <template #label>
            <span style="color: #F56C6C">杆包号</span>
          </template>
      </wd-input>
      <wd-input
        v-model="model.dishModel"
        label-width="100px"
        prop="dishModel"
        clearable
        placeholder="请输入盘型号"
      >
          <template #label>
            <span style="color: #F56C6C">盘型号</span>
          </template>
      </wd-input>
      <wd-input
        v-model="model.actuallyLength"
        label-width="100px"
        prop="actuallyLength"
        clearable
        placeholder="请输入实际长度"
      >
          <template #label>
            <span style="color: #F56C6C">实际长度(m)</span>
          </template>
      </wd-input>
      <wd-input
        v-model="model.actuallyWeight"
        label="实际重量"
        label-width="100px"
        prop="actuallyWeight"
        clearable
        placeholder="请输入实际重量"
      />
      >
          <template #label>
            <span style="color: #F56C6C">实际重量(kg)</span>
          </template>
      </wd-input>
    </wd-cell-group>
    <wd-toast />
    <Scan ref="scanRef" />
  </wd-form>
</template>
@@ -66,16 +98,21 @@
import useFormData from "@/hooks/useFormData";
import { useToast } from "wot-design-uni";
import WireApi from "@/api/product/wire";
import Scan from "@/components/scan/index.vue";
const paramsId = ref();
const scanRef = ref();
const toast = useToast();
const { form: model } = useFormData({
const { form: model, resetForm } = useFormData({
  poleNumber: undefined, // 领用杆号
  poleWeight: undefined, // 客户名称
  monofilamentNumber: undefined, // 单丝盘号
  poleWeight: undefined, // 杆重
  poleModel: undefined, // 杆型号
  model: undefined, // 规格型号
  polePackageNumber: undefined, // 杆包号
  dishModel: undefined, // 盘型号
  oneLength: undefined, // 盘长
  singleDisc: undefined, // 单丝盘长
  actuallyLength: undefined, // 实际长度
  actuallyWeight: undefined, // 实际重量
});
const submit = async () => {
@@ -86,6 +123,7 @@
  });
  if (code == 200) {
    toast.success("提交成功");
    resetForm()
    return true;
  } else {
    toast.error("提交失败");
@@ -93,8 +131,32 @@
  }
};
const openScan = () => {
  scanRef.value.triggerScan();
};
//  监听扫码
const getScanCode = (code: any) => {
  console.log("自定义扫描的结果回调函数:", code.code);
  // console.log("自定义扫描的结果回调函数", JSON.parse(code));
  const arr = code.code.split(",");
  model.poleNumber = arr[3]; //  领用杆号
  model.poleWeight = arr[4]; //  杆重
  model.poleModel = 'Φ' + arr[1].slice(2); //  杆型号
};
onLoad((options: any) => {
  paramsId.value = options.id;
  model.model = options.model;
  console.log("options", options);
  model.oneLength = options.oneLength;
  // 开启广播监听事件
  uni.$on("scan", getScanCode);
});
onUnload(() => {
  // 开启广播监听事件
  uni.$off("scan", getScanCode);
});
defineExpose({
@@ -103,8 +165,6 @@
</script>
<style lang="scss" scoped>
.form_box {
}
.submit_btn {
  position: absolute;
  bottom: 0;
src/pages/production/wire/selfInspect/index.vue
@@ -96,7 +96,7 @@
<style lang="scss" scoped>
.list {
  height: calc(100vh - 120px);
  height: calc(100vh - 30px);
  padding: 12px;
  background: #f3f9f8;