cz 1 an în urmă
părinte
comite
4e2278b53e

+ 1 - 1
src/permission.js

@@ -21,7 +21,7 @@ NProgress.configure({
   showSpinner: false
 });
 // 配置白名单
-const whiteList = ['/login', '/register', '/jxst/pro/qrDetails', '/jxst/pro/materialDetails'];
+const whiteList = ['/login', '/register', '/jxst/pro/qr', '/jxst/pro/materialDetails'];
 
 router.beforeEach((to, from, next) => {
   NProgress.start()

+ 30 - 130
src/views/JXSK/production/qrDetails/index.vue

@@ -35,32 +35,14 @@
       </div>
     </div>
 
-    <el-dialog
-      title="登录"
-      v-if="printDialog"
-      v-model="printDialog"
-      :width="width"
-      :close-on-click-modal="false"
-    >
-      <el-form
-        ref="loginRef"
-        :model="loginForm"
-        :rules="loginRules"
-        v-loading="loading"
-      >
+    <el-dialog title="登录" v-if="printDialog" v-model="printDialog" :width="width" :close-on-click-modal="false">
+      <el-form ref="loginRef" :model="loginForm" :rules="loginRules" v-loading="loading">
         <div class="form">
           <el-form-item prop="username">
-            <el-input
-              v-model="loginForm.username"
-              placeholder="账号"
-            ></el-input>
+            <el-input v-model="loginForm.username" placeholder="账号"></el-input>
           </el-form-item>
           <el-form-item prop="password">
-            <el-input
-              v-model="loginForm.password"
-              placeholder="密码"
-              type="password"
-            ></el-input>
+            <el-input v-model="loginForm.password" placeholder="密码" type="password"></el-input>
           </el-form-item>
         </div>
       </el-form>
@@ -71,13 +53,7 @@
       </template>
     </el-dialog>
 
-    <el-dialog
-      title="工单详情"
-      v-if="detailsDialog"
-      v-model="detailsDialog"
-      :width="width"
-      :close-on-click-modal="false"
-    >
+    <el-dialog title="工单详情" v-if="detailsDialog" v-model="detailsDialog" :width="width" :close-on-click-modal="false">
       <TitleInfo content="客户信息"></TitleInfo>
       <div style="padding-left: 1.25rem; margin: 0.625rem 0">
         客户名称:{{ detailsData.customerName }}
@@ -92,15 +68,11 @@
       </div>
 
       <TitleInfo content="生产信息"></TitleInfo>
-      <div
-        v-for="(item, index) in detailsData.productionTaskDetailRecordList"
-        :key="item.id"
-        style="
+      <div v-for="(item, index) in detailsData.productionTaskDetailRecordList" :key="item.id" style="
           margin-top: 0.625rem;
           margin-bottom: 1.25rem;
           padding-left: 1.25rem;
-        "
-      >
+        ">
         <div>工序名称: {{ item.productionProcessesName }}</div>
         <div>工序开始时间: {{ item.receivedTime }}</div>
         <div>工序结束时间: {{ item.createTime }}</div>
@@ -111,88 +83,33 @@
       </template>
     </el-dialog>
 
-    <el-dialog
-      title="售后申请"
-      v-if="afterSalesDialog"
-      v-model="afterSalesDialog"
-      :width="width"
-      :close-on-click-modal="false"
-    >
-      <el-form
-        ref="afterSalesRef"
-        :model="afterSalesForm"
-        :rules="afterSalesRules"
-        v-loading="loading"
-        label-width="5rem"
-      >
+    <el-dialog title="售后申请" v-if="afterSalesDialog" v-model="afterSalesDialog" :width="width" :close-on-click-modal="false">
+      <el-form ref="afterSalesRef" :model="afterSalesForm" :rules="afterSalesRules" v-loading="loading" label-width="5rem">
         <div class="form">
           <TitleInfo content="产品信息"></TitleInfo>
           <el-form-item prop="productSn" label="产品Sn">
-            <el-input
-              v-model="afterSalesForm.productSn"
-              placeholder=" "
-              disabled
-            ></el-input>
+            <el-input v-model="afterSalesForm.productSn" placeholder=" " disabled></el-input>
           </el-form-item>
-          <el-form-item
-            prop="productName"
-            label="产品名称"
-            style="margin-top: 1.25rem"
-          >
-            <el-input
-              v-model="afterSalesForm.productName"
-              placeholder=" "
-              disabled
-            ></el-input>
+          <el-form-item prop="productName" label="产品名称" style="margin-top: 1.25rem">
+            <el-input v-model="afterSalesForm.productName" placeholder=" " disabled></el-input>
           </el-form-item>
-          <el-form-item
-            prop="productSpec"
-            label="规格型号"
-            style="margin-top: 1.25rem"
-          >
-            <el-input
-              v-model="afterSalesForm.productSpec"
-              placeholder=""
-              disabled
-            ></el-input>
+          <el-form-item prop="productSpec" label="规格型号" style="margin-top: 1.25rem">
+            <el-input v-model="afterSalesForm.productSpec" placeholder="" disabled></el-input>
           </el-form-item>
           <TitleInfo content="售后信息"></TitleInfo>
-          <el-form-item
-            prop="type"
-            label="售后类型"
-            style="margin-top: 1.25rem"
-          >
-            <el-select
-              v-model="afterSalesForm.type"
-              placeholder="请选择售后类型"
-              style="width: 100%"
-            >
-              <el-option
-                v-for="item in afterSaleType"
-                :key="item.value"
-                :label="item.label"
-                :value="item.value"
-              />
+          <el-form-item prop="type" label="售后类型" style="margin-top: 1.25rem">
+            <el-select v-model="afterSalesForm.type" placeholder="请选择售后类型" style="width: 100%">
+              <el-option v-for="item in afterSaleType" :key="item.value" :label="item.label" :value="item.value" />
             </el-select>
           </el-form-item>
           <el-form-item prop="contactName" label="联系人">
-            <el-input
-              v-model="afterSalesForm.contactName"
-              placeholder="请输入联系人"
-            ></el-input>
+            <el-input v-model="afterSalesForm.contactName" placeholder="请输入联系人"></el-input>
           </el-form-item>
           <el-form-item prop="contactInfo" label="联系方式">
-            <el-input
-              v-model="afterSalesForm.contactInfo"
-              placeholder="请输入联系方式"
-            ></el-input>
+            <el-input v-model="afterSalesForm.contactInfo" placeholder="请输入联系方式"></el-input>
           </el-form-item>
           <el-form-item prop="remark" label="售后说明">
-            <el-input
-              v-model="afterSalesForm.remark"
-              placeholder="请输入售后说明"
-              type="textarea"
-            ></el-input>
+            <el-input v-model="afterSalesForm.remark" placeholder="请输入售后说明" type="textarea"></el-input>
           </el-form-item>
           <el-form-item prop="fileList" label="售后附件">
             <div style="width: 100%">
@@ -205,25 +122,12 @@
               >
                 <el-button>选择</el-button>
               </el-upload> -->
-              <input
-                ref="input"
-                type="file"
-                accept="image/*"
-                capture="camera"
-                multiple
-                @change="handleFileChange"
-              />
+              <input ref="input" type="file" accept="image/*" capture="camera" multiple @change="handleFileChange" />
 
-              <div
-                v-if="
+              <div v-if="
                   afterSalesForm.fileList && afterSalesForm.fileList.length > 0
-                "
-              >
-                <div
-                  v-for="(item, index) in afterSalesForm.fileList"
-                  :key="item.id"
-                  style="margin-top: 0.1875rem"
-                >
+                ">
+                <div v-for="(item, index) in afterSalesForm.fileList" :key="item.id" style="margin-top: 0.1875rem">
                   <el-tag class="mx-1" closable @close="handleRemove(index)">
                     {{ item.fileName }}
                   </el-tag>
@@ -235,12 +139,8 @@
       </el-form>
 
       <template #footer>
-        <el-button @click="afterSalesDialog = false" size="large"
-          >取 消</el-button
-        >
-        <el-button @click="submit" type="primary" size="large"
-          >提交售后</el-button
-        >
+        <el-button @click="afterSalesDialog = false" size="large">取 消</el-button>
+        <el-button @click="submit" type="primary" size="large">提交售后</el-button>
       </template>
     </el-dialog>
   </div>
@@ -283,7 +183,7 @@ const login = () => {
           detailsDialog.value = true;
           proxy
             .post("/productionTaskDetail/snInfo", {
-              productSn: route.query.productSn,
+              productSn: route.query.sn,
             })
             .then((res) => {
               printDialog.value = false;
@@ -326,7 +226,7 @@ const getDict = () => {
     },
     method: "post",
     data: {
-      productSn: route.query.productSn,
+      productSn: route.query.sn,
     },
   }).then((res) => {
     otherData.value = res.data;
@@ -389,10 +289,10 @@ const onPreviewFile = (file) => {
 
 onMounted(() => {
   nextTick(() => {
-    if (route.query && route.query.productSn) {
+    if (route.query && route.query.sn) {
       proxy.$refs.code.innerHTML = ""; //清除二维码方法一
       new QRCode(proxy.$refs.code, {
-        text: route.query.productSn, //页面地址 ,如果页面需要参数传递请注意哈希模式#
+        text: route.query.sn, //页面地址 ,如果页面需要参数传递请注意哈希模式#
         width: 100,
         height: 100,
         colorDark: "#000000",

+ 1 - 5
src/views/JXSK/production/task/index.vue

@@ -570,11 +570,7 @@ const handlePrint = (row) => {
     key = key.padStart(3, "0");
     let obj = {
       productSn: code + "-" + key,
-      url:
-        "http://139.9.102.170:10021/jxst/pro/qrDetails?productSn=" +
-        code +
-        "-" +
-        key,
+      url: "139.9.102.170:10021/jxst/pro/qr?sn=" + code + "-" + key,
     };
     arr.push(obj);
   }

+ 29 - 3
src/views/purchaseSales/outAndInWarehouse/manualDelivery/index.vue

@@ -12,7 +12,7 @@
     </div>
 
     <el-dialog title="手动出库" v-if="dialogVisible" v-model="dialogVisible" width="1300" v-loading="loadingDialog">
-      <div style="width:100%;display:flex">
+      <div style="width:100%;display:flex;z-index:9999">
         <div style="flex:1;overflow:auto;height:calc(100vh - 270px)">
           <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit">
             <template #workOrderId>
@@ -43,7 +43,7 @@
                   <el-table-column prop="productUnit" label="单位" width="80" :formatter="
                                   (row) => dictValueLabel(row.productUnit, productUnit)
                 " />
-                  <el-table-column label="出库数量" width="160">
+                  <el-table-column label="出库数量" width="160" prop="quantity">
                     <template #default="{ row, $index }">
                       <div style="width: 100%">
                         <el-form-item :prop="'list.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true">
@@ -71,7 +71,7 @@
               <div class="titlea" @click.stop="handleClickScan">
                 {{btnTitle}}
               </div>
-              <el-input v-model="scanValue" :disabled="!isScan" ref="scanInput" @change="handleScanValueChange" @blur="handleScanBlur"
+              <el-input v-model="scanValue" type="password" :disabled="!isScan" ref="scanInput" @change="handleScanValueChange" @blur="handleScanBlur"
                         class="input" />
             </div>
           </el-card>
@@ -439,9 +439,35 @@ const timer = ref(null);
 const handleScanValueChange = (val) => {
   if (val) {
     let value = val;
+    let arr = [];
+    if (value.includes("sn")) {
+      arr = value.split("=");
+    }
     scanValue.value = "";
     timer.value && clearTimeout(timer.value);
     timer.value = setTimeout(() => {
+      if (arr.length > 1) {
+        return proxy
+          .post("/productionTaskDetail/snInfo", {
+            productSn: arr[arr.length - 1],
+          })
+          .then(
+            (res) => {
+              formData.data.list.push({
+                isScan: "1",
+                productCode: res.productCode,
+                productId: res.productId,
+                productName: res.productName,
+                productSpec: res.productSpec,
+                productUnit: res.productUnit,
+                quantity: 1,
+                purchaseDetailId: "",
+              });
+            },
+            (err) => {}
+          );
+      }
+
       proxy.post("/purchaseDetail/detail", { id: value }).then(
         (res) => {
           formData.data.list.push({

+ 28 - 2
src/views/purchaseSales/outAndInWarehouse/manualWarehousing/index.vue

@@ -46,7 +46,7 @@
                   <el-table-column prop="productUnit" label="单位" width="80" :formatter="
                   (row) => dictValueLabel(row.productUnit, productUnit)
                 " />
-                  <el-table-column label="入库数量" width="160">
+                  <el-table-column label="入库数量" width="160" prop="quantity">
                     <template #default="{ row, $index }">
                       <div style="width: 100%">
                         <el-form-item :prop="'list.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true">
@@ -74,7 +74,7 @@
               <div class="titlea" @click.stop="handleClickScan">
                 {{btnTitle}}
               </div>
-              <el-input v-model="scanValue" :disabled="!isScan" ref="scanInput" @change="handleScanValueChange" @blur="handleScanBlur"
+              <el-input v-model="scanValue" type="password" :disabled="!isScan" ref="scanInput" @change="handleScanValueChange" @blur="handleScanBlur"
                         class="input" />
             </div>
           </el-card>
@@ -423,9 +423,35 @@ const timer = ref(null);
 const handleScanValueChange = (val) => {
   if (val) {
     let value = val;
+    let arr = [];
+    if (value.includes("sn")) {
+      arr = value.split("=");
+    }
     scanValue.value = "";
     timer.value && clearTimeout(timer.value);
     timer.value = setTimeout(() => {
+      if (arr.length > 1) {
+        return proxy
+          .post("/productionTaskDetail/snInfo", {
+            productSn: arr[arr.length - 1],
+          })
+          .then(
+            (res) => {
+              formData.data.list.push({
+                isScan: "1",
+                productCode: res.productCode,
+                productId: res.productId,
+                productName: res.productName,
+                productSpec: res.productSpec,
+                productUnit: res.productUnit,
+                quantity: 1,
+                purchaseDetailId: "",
+              });
+            },
+            (err) => {}
+          );
+      }
+
       proxy.post("/purchaseDetail/detail", { id: value }).then(
         (res) => {
           formData.data.list.push({

+ 37 - 3
src/views/purchaseSales/outAndInWarehouse/waitingForDelivery/index.vue

@@ -60,7 +60,7 @@
                   <el-table-column prop="productUnit" label="单位" width="80" :formatter="
                                   (row) => dictValueLabel(row.productUnit, productUnit)
                 " />
-                  <el-table-column label="出库数量" width="160">
+                  <el-table-column label="出库数量" width="160" prop="quantity">
                     <template #default="{ row, $index }">
                       <div style="width: 100%">
                         <el-form-item :prop="'stockWaitDetailsList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true">
@@ -88,7 +88,7 @@
               <div class="titlea" @click.stop="handleClickScan">
                 {{btnTitle}}
               </div>
-              <el-input v-model="scanValue" :disabled="!isScan" ref="scanInput" @change="handleScanValueChange" @blur="handleScanBlur"
+              <el-input v-model="scanValue" type="password" :disabled="!isScan" ref="scanInput" @change="handleScanValueChange" @blur="handleScanBlur"
                         class="input" />
             </div>
           </el-card>
@@ -574,9 +574,43 @@ const timer = ref(null);
 const handleScanValueChange = (val) => {
   if (val) {
     let value = val;
+    let arr = [];
+    if (value.includes("sn")) {
+      arr = value.split("=");
+    }
     scanValue.value = "";
     timer.value && clearTimeout(timer.value);
     timer.value = setTimeout(() => {
+      if (arr.length > 1) {
+        return proxy
+          .post("/productionTaskDetail/snInfo", {
+            productSn: arr[arr.length - 1],
+          })
+          .then(
+            (res) => {
+              if (res.productId != rowData.value.productId) {
+                ElMessage({
+                  message: "请扫正确的产品",
+                  type: "info",
+                });
+              } else {
+                formData.data.stockWaitDetailsList.push({
+                  id: rowData.value.id,
+                  isScan: "1",
+                  productCode: res.productCode,
+                  productId: res.productId,
+                  productName: res.productName,
+                  productSpec: res.productSpec,
+                  productUnit: res.productUnit,
+                  quantity: 1,
+                  purchaseDetailId: "",
+                });
+              }
+            },
+            (err) => {}
+          );
+      }
+
       proxy.post("/purchaseDetail/detail", { id: value }).then(
         (res) => {
           if (res.bussinessId != rowData.value.productId) {
@@ -683,7 +717,7 @@ const handleDelete = (index) => {
     cursor: pointer;
   }
   .input {
-    opacity: 1;
+    opacity: 0;
     position: absolute;
     top: 0;
     left: 0;

+ 282 - 29
src/views/purchaseSales/outAndInWarehouse/waitingForStorage/index.vue

@@ -14,18 +14,78 @@
       </byTable>
     </div>
 
-    <el-dialog title="入库" v-if="dialogVisible" v-model="dialogVisible" width="400" v-loading="loadingDialog">
-      <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit">
-        <template #file>
-          <div style="width: 100%">
-            <el-upload v-model:fileList="formData.data.fileList" action="https://winfaster.obs.cn-south-1.myhuaweicloud.com" multiple
-                       :on-preview="onPreviewFile">
-              <!-- <el-button type="primary" plain disabled>选择</el-button> -->
+    <el-dialog title="入库" v-if="dialogVisible" v-model="dialogVisible" width="1300" v-loading="loadingDialog">
+      <div style="width:100%;display:flex">
+        <div style="flex:1;overflow:auto;height:calc(100vh - 270px)">
+          <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit">
+            <template #details>
+              <div style="width: 100%">
+                <el-button type="primary" @click="clickAdd()">添加明细</el-button>
+                <el-table :data="formData.data.stockWaitDetailsList" show-summary :summary-method="getSummaries" style=" margin-top: 16px">
+                  <el-table-column type="index" width="60" align="center" />
+                  <el-table-column label="是否扫码" width="80">
+                    <template #default="{ row, $index }">
+                      <div>
+                        <span style="padding: 4px" :class="[row.isScan == 1 ? 'active' : 'disActive']">
+                          {{
+                proxy.dictValueLabel(row.isScan, scanData)
+              }}
+                        </span>
+                      </div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column prop="productCode" label="产品编码" width="140" />
+                  <el-table-column prop="productName" label="产品名称" min-width="160" />
+                  <el-table-column prop="productSpec" label="规格型号" width="120" />
+                  <el-table-column prop="productUnit" label="单位" width="80" :formatter="
+                                  (row) => dictValueLabel(row.productUnit, productUnit)
+                " />
+                  <el-table-column label="入库数量" width="160" prop="quantity">
+                    <template #default="{ row, $index }">
+                      <div style="width: 100%">
+                        <el-form-item :prop="'stockWaitDetailsList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true">
+                          <el-input-number v-model="row.quantity" placeholder="请输入出库数量" style="width: 100%" :precision="0" :controls="false" :min="1"
+                                           :disabled="row.isScan =='1'" onmousewheel="return false;" />
+                        </el-form-item>
+                      </div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column align="center" label="操作" width="80" fixed="right">
+                    <template #default="{ row, $index }">
+                      <el-button type="primary" link @click="handleDelete($index)">删除</el-button>
+                    </template>
+                  </el-table-column>
+                </el-table>
+              </div>
+            </template>
+            <template #file>
+              <div style="width: 100%">
+                <el-upload v-model:fileList="formData.data.fileList" action="https://winfaster.obs.cn-south-1.myhuaweicloud.com" multiple
+                           :on-preview="onPreviewFile">
+                  <!-- <el-button type="primary" plain disabled>选择</el-button> -->
+
+                </el-upload>
+              </div>
+            </template>
+          </byForm>
+        </div>
+        <div style="width:300px;margin-left:20px">
+          <el-card class="box-card" style="height:100%;position: relative;">
+            <div class="box">
+              <img src="@/assets/images/scanz.png" class="img" v-if="!isScan" />
+              <img src="@/assets/images/scaning.gif" class="img" v-if="isScan" />
+              <div class="titlea" @click.stop="handleClickScan">
+                {{btnTitle}}
+              </div>
+              <el-input v-model="scanValue" type="password" :disabled="!isScan" ref="scanInput" style="ime-mode:active"
+                        @change="handleScanValueChange" @blur="handleScanBlur" class="input" />
+
+            </div>
+          </el-card>
+        </div>
+
+      </div>
 
-            </el-upload>
-          </div>
-        </template>
-      </byForm>
       <template #footer>
         <el-button @click="dialogVisible = false" size="large">取 消</el-button>
         <el-button type="primary" @click="submitForm()" size="large">确 定</el-button>
@@ -408,13 +468,18 @@ const formConfig = computed(() => {
       required: true,
       data: warehouseList.value,
     },
+    // {
+    //   type: "number",
+    //   prop: "warehousingQuantity",
+    //   label: "入库数量",
+    //   precision: 0,
+    //   min: 1,
+    //   controls: false,
+    // },
     {
-      type: "number",
-      prop: "warehousingQuantity",
-      label: "入库数量",
-      precision: 0,
-      min: 1,
-      controls: false,
+      type: "slot",
+      slotName: "details",
+      label: "入库明细",
     },
     {
       type: "slot",
@@ -429,6 +494,7 @@ const rules = ref({
   warehousingQuantity: [
     { required: true, message: "请输入入库数量", trigger: "blur" },
   ],
+  quantity: [{ required: true, message: "请输入入库数量", trigger: "blur" }],
 });
 const submitForm = () => {
   submit.value.handleSubmit(() => {
@@ -439,21 +505,29 @@ const submitForm = () => {
     //     type: "info",
     //   });
     // }
-    let stockWaitDetailsList = [
-      {
-        id: formData.data.id,
-        productId: formData.data.productId,
-        quantity: formData.data.warehousingQuantity,
-        isScan: "0",
-        purchaseDetailId: "",
-      },
-    ];
+    if (!(formData.data.stockWaitDetailsList.length > 0)) {
+      return ElMessage({
+        message: "请添加入库明细",
+        type: "info",
+      });
+    }
+    const total = formData.data.stockWaitDetailsList.reduce(
+      (val, x) => (val += x.quantity),
+      0
+    );
+    if (Number(total) > Number(formData.data.waitQuantity)) {
+      return ElMessage({
+        message: "入库数量不可大于待入库数量",
+        type: "info",
+      });
+    }
+
     proxy
       .post("/stockWait/add", {
         id: formData.data.stockWaitId,
         warehouseId: formData.data.warehouseId,
         quantity: formData.data.warehousingQuantity,
-        stockWaitDetailsList,
+        stockWaitDetailsList: formData.data.stockWaitDetailsList,
       })
       .then(
         () => {
@@ -472,9 +546,12 @@ const submitForm = () => {
   });
 };
 const showType = ref(-1);
+const rowDataOne = ref({});
 const clickOperation = (row) => {
+  rowDataOne.value = row;
   showType.value = row.businessType;
   formData.data = row;
+  formData.data.stockWaitDetailsList = [];
   loadingDialog.value = false;
   dialogVisible.value = true;
   if (showType.value == 2) {
@@ -551,17 +628,193 @@ const handlePrintOne = (row) => {
     }
   });
 };
+
+const clickAdd = () => {
+  formData.data.stockWaitDetailsList.push({
+    id: formData.data.id,
+    isScan: "0",
+    productCode: formData.data.productCode,
+    productId: formData.data.productId,
+    productName: formData.data.productName,
+    productSpec: formData.data.productSpec,
+    productUnit: formData.data.productUnit,
+    quantity: undefined,
+    purchaseDetailId: "",
+  });
+};
+
+const getSummaries = (param) => {
+  const { columns, data } = param; //columns是每列的信息,data是每行的信息
+  const sums = [];
+  columns.forEach((column, index) => {
+    if (index === 0) {
+      sums[index] = "合计"; //此处是在index=0的这一列显示为“合计”
+      return;
+    }
+    const values = data.map((item) => Number(item[column.property]));
+    if (column.property === "quantity") {
+      sums[index] = values.reduce((prev, curr) => {
+        const value = Number(curr);
+        if (!isNaN(value)) {
+          return Number(parseFloat(prev + curr).toFixed(4));
+        } else {
+          return prev;
+        }
+      }, 0);
+      sums[index];
+    }
+  });
+  return sums;
+};
+
+const scanData = ref([
+  {
+    label: "是",
+    value: "1",
+  },
+  {
+    label: "否",
+    value: "0",
+  },
+]);
+const scanValue = ref("");
+const isScan = ref(false);
+const btnTitle = ref("扫码入库");
+const scanInput = ref(null);
+const handleClickScan = () => {
+  isScan.value = !isScan.value;
+  btnTitle.value = isScan.value ? "扫码中···" : "扫码入库";
+  if (isScan.value) {
+    scanInput.value.focus();
+  }
+};
+const handleScanBlur = () => {
+  setTimeout(() => {
+    scanValue.value = "";
+    isScan.value = false;
+    btnTitle.value = "扫码入库";
+  }, 100);
+};
+
+const timer = ref(null);
+const handleScanValueChange = (val) => {
+  if (val) {
+    let value = val;
+    let arr = [];
+    if (value.includes("sn")) {
+      arr = value.split("=");
+    }
+    scanValue.value = "";
+    timer.value && clearTimeout(timer.value);
+    timer.value = setTimeout(() => {
+      if (arr.length > 1) {
+        return proxy
+          .post("/productionTaskDetail/snInfo", {
+            productSn: arr[arr.length - 1],
+          })
+          .then(
+            (res) => {
+              if (res.productId != rowDataOne.value.productId) {
+                ElMessage({
+                  message: "请扫正确的产品",
+                  type: "info",
+                });
+              } else {
+                formData.data.stockWaitDetailsList.push({
+                  id: rowDataOne.value.id,
+                  isScan: "1",
+                  productCode: res.productCode,
+                  productId: res.productId,
+                  productName: res.productName,
+                  productSpec: res.productSpec,
+                  productUnit: res.productUnit,
+                  quantity: 1,
+                  purchaseDetailId: "",
+                });
+              }
+            },
+            (err) => {}
+          );
+      }
+
+      proxy.post("/purchaseDetail/detail", { id: value }).then(
+        (res) => {
+          if (res.bussinessId != rowDataOne.value.productId) {
+            ElMessage({
+              message: "请扫正确的产品",
+              type: "info",
+            });
+          } else {
+            formData.data.stockWaitDetailsList.push({
+              id: rowDataOne.value.id,
+              isScan: "1",
+              productCode: res.productCode,
+              productId: res.bussinessId,
+              productName: res.productName,
+              productSpec: res.productSpec,
+              productUnit: res.productUnit,
+              quantity: 1,
+              purchaseDetailId: val,
+            });
+          }
+        },
+        (err) => {}
+      );
+    }, 301);
+  }
+};
+
+const handleDelete = (index) => {
+  formData.data.stockWaitDetailsList.splice(index, 1);
+};
 </script>
 
 <style lang="scss" scoped>
+.active {
+  background: #a6dd82;
+  color: #fff;
+  border-radius: 4px;
+}
+
 .tenant {
   padding: 20px;
 }
 ::v-deep(.el-input-number .el-input__inner) {
   text-align: left;
 }
-.active {
-  background: #a6dd82;
+
+.box {
+  position: absolute;
+  top: 50%;
+  transform: translate(0, -50%);
+  .img {
+    width: 260px;
+    height: 260px;
+    object-fit: contain;
+    vertical-align: middle;
+    // cursor: pointer;
+    z-index: 10;
+  }
+  .titlea {
+    position: absolute;
+    top: 50%;
+    left: 50%;
+    transform: translate(-50%, -50%);
+    font-size: 30px;
+    font-weight: 700;
+    color: #5df5e9;
+    cursor: pointer;
+  }
+  .input {
+    opacity: 0;
+    position: absolute;
+    top: 0;
+    left: 0;
+  }
+}
+
+.disActive {
+  background: #fa9841;
   color: #fff;
   border-radius: 4px;
 }