cz 1 yıl önce
ebeveyn
işleme
56238038f7

+ 7 - 6
src/components/product/SelectGoods.vue

@@ -30,7 +30,7 @@ import { computed, ref } from "vue";
 
 const tableHeight = ref(0);
 const getTableHeight = () => {
-  tableHeight.value = window.innerHeight - 455;
+  tableHeight.value = window.innerHeight - 300;
 };
 getTableHeight();
 window.addEventListener("resize", () => {
@@ -204,11 +204,12 @@ const handleSelect = (row) => {
   //     message: "该产品已选择",
   //     type: "info",
   //   });
-  goodList.value.push({
-    ...row,
-    goodType: sourceList.value.pagination.definition,
-  });
-  proxy.$emit("pushGoods", goodList.value);
+  // goodList.value.push({
+  //   ...row,
+  //   goodType: sourceList.value.pagination.definition,
+  // });
+  const item = { ...row, goodType: sourceList.value.pagination.definition };
+  proxy.$emit("pushGoods", item);
   // return ElMessage({
   //   message: "选择成功",
   //   type: "success",

+ 30 - 135
src/views/JXSK/production/bom/index.vue

@@ -2,137 +2,69 @@
   <div class="tenant">
     <!-- <Banner /> -->
     <div class="content">
-      <byTable
-        :source="sourceList.data"
-        :pagination="sourceList.pagination"
-        :config="config"
-        :loading="loading"
-        highlight-current-row
-        :selectConfig="selectConfig"
-        :table-events="{
+      <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" highlight-current-row
+               :selectConfig="selectConfig" :table-events="{
           //element talbe事件都能传
           select: select,
-        }"
-        :action-list="[
+        }" :action-list="[
           {
             text: '添加BOM',
             action: () => openModal('add'),
           },
-        ]"
-        @get-list="getList"
-      >
+        ]" @get-list="getList">
         <template #versionSlot="{ item }">
-          <div
-            style="cursor: pointer; color: #409eff"
-            @click="hanldeOpenVer(item)"
-          >
+          <div style="cursor: pointer; color: #409eff" @click="hanldeOpenVer(item)">
             v{{ item.versionNumber }}
           </div>
         </template>
       </byTable>
     </div>
-    <el-dialog
-      :title="titleText"
-      v-model="dialogVisible"
-      width="70%"
-      v-loading="submitLoading"
-      destroy-on-close
-    >
-      <byForm
-        :formConfig="formConfig"
-        :formOption="formOption"
-        v-model="formData.data"
-        :rules="rules"
-        ref="byform"
-      >
+    <el-dialog :title="titleText" v-model="dialogVisible" width="70%" v-loading="submitLoading" destroy-on-close>
+      <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="byform">
         <template #slotFile>
           <div style="width: 100%">
-            <el-upload
-              v-model:fileList="fileList"
-              :show-file-list="false"
-              class="upload-demo"
-              action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
-              :data="uploadData"
-              :before-upload="handleBeforeUpload"
-              accept=".rar,.zip"
-            >
+            <el-upload v-model:fileList="fileList" :show-file-list="false" class="upload-demo"
+                       action="https://winfaster.obs.cn-south-1.myhuaweicloud.com" :data="uploadData" :before-upload="handleBeforeUpload"
+                       accept=".rar,.zip">
               <el-button type="primary">选 择</el-button>
             </el-upload>
             <div>
               <div style="margin-top: 15px">
-                <el-tag
-                  style="margin-right: 10px"
-                  class="ml-2"
-                  type="info"
-                  v-for="(item, index) in fileListCopy"
-                  :key="index"
-                  >{{ item.fileName }}</el-tag
-                >
+                <el-tag style="margin-right: 10px" class="ml-2" type="info" v-for="(item, index) in fileListCopy"
+                        :key="index">{{ item.fileName }}</el-tag>
               </div>
             </div>
           </div>
         </template>
         <template #slot>
           <div style="width: 100%">
-            <el-button type="primary" plain @click="openMaterial = true"
-              >添加物料/半成品</el-button
-            >
-            <el-button type="primary" plain> Excel导入</el-button>
-            <el-form
-              ref="tableForm"
-              :model="formData.data"
-              :rules="rules"
-              label-width="0px"
-              style="margin-top: 15px"
-            >
+            <el-button type="primary" plain @click="openMaterial = true">添加物料/半成品</el-button>
+            <!-- <el-button type="primary" plain> Excel导入</el-button> -->
+            <el-form ref="tableForm" :model="formData.data" :rules="rules" label-width="0px" style="margin-top: 15px">
               <el-table :data="formData.data.bomDetailList">
                 <el-table-column prop="productCode" label="物料编码" />
                 <el-table-column prop="productName" label="物料名称" />
                 <el-table-column prop="productSpec" label="规格型号" />
-                <el-table-column
-                  prop="productUnit"
-                  label="单位"
-                  :formatter="
+                <el-table-column prop="productUnit" label="单位" :formatter="
                     (row) => dictValueLabel(row.productUnit, materialUnit)
-                  "
-                />
+                  " />
                 <el-table-column prop="quantity" label="数量" width="150">
                   <template #default="{ row, $index }">
-                    <el-form-item
-                      :prop="'bomDetailList.' + $index + '.quantity'"
-                      :rules="rules.quantity"
-                      :inline-message="true"
-                    >
-                      <el-input-number
-                        v-model="row.quantity"
-                        :precision="2"
-                        :controls="false"
-                        :min="1"
-                      />
+                    <el-form-item :prop="'bomDetailList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true">
+                      <el-input-number v-model="row.quantity" :precision="2" :controls="false" :min="1" />
                     </el-form-item>
                   </template>
                 </el-table-column>
                 <el-table-column prop="zip" label="成本" width="150">
                   <template #default="{ row, $index }">
-                    <el-form-item
-                      :prop="'bomDetailList.' + $index + '.cost'"
-                      :rules="rules.cost"
-                      :inline-message="true"
-                    >
-                      <el-input-number
-                        v-model="row.cost"
-                        :precision="2"
-                        :controls="false"
-                        :min="1"
-                      />
+                    <el-form-item :prop="'bomDetailList.' + $index + '.cost'" :rules="rules.cost" :inline-message="true">
+                      <el-input-number v-model="row.cost" :precision="2" :controls="false" :min="1" />
                     </el-form-item>
                   </template>
                 </el-table-column>
                 <el-table-column prop="zip" label="操作" width="100">
                   <template #default="{ $index }">
-                    <el-button type="primary" link @click="handleRemove($index)"
-                      >删除</el-button
-                    >
+                    <el-button type="primary" link @click="handleRemove($index)">删除</el-button>
                   </template>
                 </el-table-column>
               </el-table>
@@ -142,27 +74,15 @@
       </byForm>
       <template #footer>
         <div v-if="isShowBtns">
-          <el-button @click="dialogVisible = false" size="large"
-            >取 消</el-button
-          >
-          <el-button
-            type="primary"
-            v-no-double-click="submitForm"
-            size="large"
-            :loading="submitLoading"
-          >
+          <el-button @click="dialogVisible = false" size="large">取 消</el-button>
+          <el-button type="primary" v-no-double-click="submitForm" size="large" :loading="submitLoading">
             确 定
           </el-button>
         </div>
       </template>
     </el-dialog>
 
-    <el-dialog
-      v-model="openMaterial"
-      title="选择物料/半成品"
-      width="70%"
-      append-to-body
-    >
+    <el-dialog v-model="openMaterial" title="选择物料/半成品" width="70%" append-to-body>
       <SelectMaterial @handleSelect="handleSelect"></SelectMaterial>
       <template #footer>
         <span class="dialog-footer">
@@ -172,44 +92,19 @@
     </el-dialog>
 
     <el-dialog v-model="openVersion" title="切换版本" width="30%">
-      <byForm
-        :formConfig="formConfig1"
-        :formOption="formOption"
-        v-model="formData.data1"
-        :rules="rules1"
-        ref="byform1"
-      >
+      <byForm :formConfig="formConfig1" :formOption="formOption" v-model="formData.data1" :rules="rules1" ref="byform1">
         <template #versionSlot>
           <div>
-            <el-select
-              v-model="formData.data1.versionNumber"
-              placeholder="请选择版本号"
-              @change="changeRowData"
-            >
-              <el-option
-                v-for="item in versionData"
-                :label="'v' + item.versionNumber"
-                :value="item.versionNumber"
-              />
+            <el-select v-model="formData.data1.versionNumber" placeholder="请选择版本号" @change="changeRowData">
+              <el-option v-for="item in versionData" :label="'v' + item.versionNumber" :value="item.versionNumber" />
             </el-select>
-            <el-button
-              type="primary"
-              link
-              style="margin-left: 10px"
-              @click="handleGetDetails"
-              v-if="formData.data1.versionNumber"
-              >查看</el-button
-            >
+            <el-button type="primary" link style="margin-left: 10px" @click="handleGetDetails" v-if="formData.data1.versionNumber">查看</el-button>
           </div>
         </template>
       </byForm>
       <template #footer>
         <el-button @click="openVersion = false" size="large">取 消</el-button>
-        <el-button
-          type="primary"
-          @click="handleChangeVer('byform1')"
-          size="large"
-        >
+        <el-button type="primary" @click="handleChangeVer('byform1')" size="large">
           确 定
         </el-button>
       </template>

+ 19 - 24
src/views/JXSK/production/workOrder/index.vue

@@ -38,6 +38,17 @@
               <el-button text type="primary" @click="handleSelectRow(item)">选择</el-button>
             </div>
             <div v-else>
+
+              <!-- 研发 -->
+              <span v-if="isYanFa">
+                <el-button text type="primary" @click="handleUploadFile(item, false)">{{
+                    item.researchStatus ? "查看" : "上传"
+                  }}设计资料</el-button>
+
+                <el-button text type="primary" @click="getDtl(item, item.bomStatus ? true : false)">{{ item.bomStatus ? "查看" : "调整" }}BOM</el-button>
+
+              </span>
+
               <!-- 制图 -->
               <div v-if="isZhiTu && item.researchStatus">
                 <span v-if="item.isCustomized == 1">
@@ -61,35 +72,13 @@
                   <el-button text type="primary" @click="handleUploadFile(item, true)">查看设计资料</el-button>
                 </span>
               </div>
-              <!-- 研发 -->
-              <span v-if="isYanFa">
-                <el-button text type="primary" @click="handleUploadFile(item, false)">{{
-                    item.researchStatus ? "查看" : "上传"
-                  }}设计资料</el-button>
-              </span>
-              <!-- 都不是 -->
-              <div v-if="!isYanFa && !isZhiTu && item.researchStatus">
+              <div v-if="isDianGong && item.researchStatus">
                 <span v-if="item.isCustomized == 1">
                   <el-button text type="primary"
                              @click="getDtl(item, item.bomStatus ? true : false)">{{ item.bomStatus ? "查看" : "调整" }}BOM</el-button>
                 </span>
-                <span v-if="item.isCustomized == 1">
-                  <el-button text type="primary" @click="
-                      getDtlOne(item, item.technologyStatus ? true : false)
-                    ">{{
-                      item.technologyStatus ? "查看" : "调整"
-                    }}工艺</el-button>
-                </span>
-                <span v-if="item.productionQuantity == null">
-                  <el-button text type="primary" @click="handleOut(item)">下发</el-button>
-                </span>
-                <span>
-                  <el-button text type="primary" @click="handlePrint(item)">打印</el-button>
-                </span>
-                <span>
-                  <el-button text type="primary" @click="handleUploadFile(item, true)">查看设计资料</el-button>
-                </span>
               </div>
+
             </div>
           </div>
         </template>
@@ -903,6 +892,8 @@ const getDict = () => {
 };
 const isYanFa = ref(false);
 const isZhiTu = ref(false);
+const isDianGong = ref(false);
+
 const checkShow = () => {
   // 当前账号角色是否是研发
   if (userInfo.roles.includes("dev")) {
@@ -912,6 +903,10 @@ const checkShow = () => {
   if (userInfo.roles.includes("design")) {
     isZhiTu.value = true;
   }
+  // 当前角色是否是电工
+  if (userInfo.roles.includes("electrician")) {
+    isDianGong.value = true;
+  }
 };
 checkShow();
 getList();

+ 9 - 6
src/views/purchaseSales/outAndInWarehouse/inventoryInquiry/index.vue

@@ -297,12 +297,15 @@ const clickSelect = (row) => {
   //     message: "该物品已选择",
   //     type: "info",
   //   });
-  goodList.value.push({
-    ...row,
-    goodType: sourceList.value.pagination.definition,
-  });
-  proxy.$emit("select", goodList.value);
-  goodList.value = [];
+  // goodList.value.push({
+  //   ...row,
+  //   goodType: sourceList.value.pagination.definition,
+  // });
+  // proxy.$emit("select", goodList.value);
+  // goodList.value = [];
+
+  const item = { ...row, goodType: sourceList.value.pagination.definition };
+  proxy.$emit("select", item);
 };
 const handleRemove = (index) => {
   goodList.value.splice(index, 1);

+ 82 - 38
src/views/purchaseSales/outAndInWarehouse/manualDelivery/index.vue

@@ -13,7 +13,7 @@
 
     <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 - 300px)">
+        <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>
               <div style="width: 100%">
@@ -27,9 +27,18 @@
               <div style="width: 100%">
                 <el-button type="primary" @click="clickAdd()">添加明细</el-button>
                 <el-table :data="formData.data.list" style=" margin-top: 16px">
-                  <el-table-column label="是否扫码" width="80" :formatter="
-                                     (row) => dictValueLabel(row.isScan, scanData)
-                " />
+                  <el-table-column type="index" width="50" />
+                  <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" />
@@ -313,23 +322,35 @@ const changeWarehouse = () => {
 };
 
 const pushGoods = (goods) => {
-  const arr = goods.map((item) => ({
-    isScan: "0",
-    productCode: item.productCode,
-    productId: item.productId,
-    productName: item.productName,
-    productSpec: item.productSpec,
-    productUnit: item.productUnit,
-    productQuantity: item.quantity,
-    quantity: undefined,
-    purchaseDetailId: "",
-  }));
-  formData.data.list = formData.data.list.concat(arr);
-  // openProduct.value = false;
-  return ElMessage({
-    message: "添加成功!",
-    type: "success",
-  });
+  console.log(goods, "asdad");
+  if (goods && goods.productId) {
+    //     const arr = goods.map((item) => ({
+    //   isScan: "0",
+    //   productCode: item.productCode,
+    //   productId: item.productId,
+    //   productName: item.productName,
+    //   productSpec: item.productSpec,
+    //   productUnit: item.productUnit,
+    //   productQuantity: item.quantity,
+    //   quantity: undefined,
+    //   purchaseDetailId: "",
+    // }));
+    formData.data.list.push({
+      isScan: "0",
+      productCode: goods.productCode,
+      productId: goods.productId,
+      productName: goods.productName,
+      productSpec: goods.productSpec,
+      productUnit: goods.productUnit,
+      productQuantity: goods.quantity,
+      quantity: undefined,
+      purchaseDetailId: "",
+    });
+    return ElMessage({
+      message: "添加成功!",
+      type: "success",
+    });
+  }
 };
 const submitForm = () => {
   submit.value.handleSubmit(() => {
@@ -396,33 +417,45 @@ 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();
+  if (!isScan.value) {
+    if (formData.data.warehouseId) {
+      isScan.value = !isScan.value;
+      btnTitle.value = isScan.value ? "扫码中···" : "扫码出库";
+      if (isScan.value) {
+        scanInput.value.focus();
+      }
+    } else {
+      ElMessage("请先选择仓库");
+    }
   }
 };
 const handleScanBlur = () => {
   setTimeout(() => {
+    scanValue.value = "";
     isScan.value = false;
     btnTitle.value = "扫码出库";
   }, 100);
 };
 const handleScanValueChange = (val) => {
   if (val) {
-    proxy.post("/purchaseDetail/detail", { id: val }).then((res) => {
-      formData.data.list.push({
-        isScan: "1",
-        productCode: res.productCode,
-        productId: res.bussinessId,
-        productName: res.productName,
-        productSpec: res.productSpec,
-        productUnit: res.productUnit,
-        quantity: 1,
-        purchaseDetailId: val,
-      });
-      scanValue.value = "";
-    });
+    proxy.post("/purchaseDetail/detail", { id: val }).then(
+      (res) => {
+        formData.data.list.push({
+          isScan: "1",
+          productCode: res.productCode,
+          productId: res.bussinessId,
+          productName: res.productName,
+          productSpec: res.productSpec,
+          productUnit: res.productUnit,
+          quantity: 1,
+          purchaseDetailId: val,
+        });
+        scanValue.value = "";
+      },
+      (err) => {
+        scanValue.value = "";
+      }
+    );
   }
 };
 </script>
@@ -463,4 +496,15 @@ const handleScanValueChange = (val) => {
     left: 0;
   }
 }
+
+.active {
+  background: #a6dd82;
+  color: #fff;
+  border-radius: 4px;
+}
+.disActive {
+  background: #fa9841;
+  color: #fff;
+  border-radius: 4px;
+}
 </style>

+ 86 - 37
src/views/purchaseSales/outAndInWarehouse/manualWarehousing/index.vue

@@ -13,7 +13,7 @@
 
     <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 - 300px)">
+        <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>
               <div style="width: 100%">
@@ -26,11 +26,20 @@
 
             <template #details>
               <div style="width: 100%">
-                <el-button type="primary" @click="openProduct = true">添加明细</el-button>
+                <el-button type="primary" @click="clickAdd()">添加明细</el-button>
                 <el-table :data="formData.data.list" style=" margin-top: 16px">
-                  <el-table-column label="是否扫码" width="80" :formatter="
-                                     (row) => dictValueLabel(row.isScan, scanData)
-                " />
+                  <el-table-column type="index" width="50" />
+                  <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" />
@@ -288,22 +297,39 @@ const openModal = () => {
   loadingDialog.value = false;
   dialogVisible.value = true;
 };
+const clickAdd = () => {
+  if (formData.data.warehouseId) {
+    openProduct.value = true;
+  } else {
+    ElMessage("请先选择仓库");
+  }
+};
 const pushGoods = (goods) => {
-  if (goods && goods.length > 0) {
-    formData.data.list = formData.data.list.concat(
-      goods.map((item) => {
-        return {
-          isScan: "0",
-          productCode: item.code,
-          productId: item.id,
-          productName: item.name,
-          productSpec: item.spec,
-          productUnit: item.unit,
-          quantity: undefined,
-          purchaseDetailId: "",
-        };
-      })
-    );
+  if (goods && goods.id) {
+    // formData.data.list = formData.data.list.concat(
+    //   goods.map((item) => {
+    //     return {
+    //       isScan: "0",
+    //       productCode: item.code,
+    //       productId: item.id,
+    //       productName: item.name,
+    //       productSpec: item.spec,
+    //       productUnit: item.unit,
+    //       quantity: undefined,
+    //       purchaseDetailId: "",
+    //     };
+    //   })
+    // );
+    formData.data.list.push({
+      isScan: "0",
+      productCode: goods.code,
+      productId: goods.id,
+      productName: goods.name,
+      productSpec: goods.spec,
+      productUnit: goods.unit,
+      quantity: undefined,
+      purchaseDetailId: "",
+    });
     ElMessage({
       message: "添加成功!",
       type: "success",
@@ -374,33 +400,45 @@ 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();
+  if (!isScan.value) {
+    if (formData.data.warehouseId) {
+      isScan.value = !isScan.value;
+      btnTitle.value = isScan.value ? "扫码中···" : "扫码入库";
+      if (isScan.value) {
+        scanInput.value.focus();
+      }
+    } else {
+      ElMessage("请先选择仓库");
+    }
   }
 };
 const handleScanBlur = () => {
   setTimeout(() => {
+    scanValue.value = "";
     isScan.value = false;
     btnTitle.value = "扫码入库";
   }, 100);
 };
 const handleScanValueChange = (val) => {
   if (val) {
-    proxy.post("/purchaseDetail/detail", { id: val }).then((res) => {
-      formData.data.list.push({
-        isScan: "1",
-        productCode: res.productCode,
-        productId: res.bussinessId,
-        productName: res.productName,
-        productSpec: res.productSpec,
-        productUnit: res.productUnit,
-        quantity: 1,
-        purchaseDetailId: val,
-      });
-      scanValue.value = "";
-    });
+    proxy.post("/purchaseDetail/detail", { id: val }).then(
+      (res) => {
+        formData.data.list.push({
+          isScan: "1",
+          productCode: res.productCode,
+          productId: res.bussinessId,
+          productName: res.productName,
+          productSpec: res.productSpec,
+          productUnit: res.productUnit,
+          quantity: 1,
+          purchaseDetailId: val,
+        });
+        scanValue.value = "";
+      },
+      (err) => {
+        scanValue.value = "";
+      }
+    );
   }
 };
 </script>
@@ -441,4 +479,15 @@ const handleScanValueChange = (val) => {
     left: 0;
   }
 }
+
+.active {
+  background: #a6dd82;
+  color: #fff;
+  border-radius: 4px;
+}
+.disActive {
+  background: #fa9841;
+  color: #fff;
+  border-radius: 4px;
+}
 </style>

+ 50 - 24
src/views/purchaseSales/outAndInWarehouse/waitingForDelivery/index.vue

@@ -36,15 +36,24 @@
 
     <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 - 300px)">
+        <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" style=" margin-top: 16px">
-                  <el-table-column label="是否扫码" width="80" :formatter="
-                                     (row) => dictValueLabel(row.isScan, scanData)
-                " />
+                  <el-table-column type="index" width="50" />
+                  <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" />
@@ -547,33 +556,39 @@ const handleClickScan = () => {
 };
 const handleScanBlur = () => {
   setTimeout(() => {
+    scanValue.value = "";
     isScan.value = false;
     btnTitle.value = "扫码出库";
   }, 100);
 };
 const handleScanValueChange = (val) => {
   if (val) {
-    proxy.post("/purchaseDetail/detail", { id: val }).then((res) => {
-      if (res.bussinessId != rowData.value.productId) {
-        ElMessage({
-          message: "请扫正确的产品",
-          type: "info",
-        });
-      } else {
-        formData.data.stockWaitDetailsList.push({
-          id: rowData.value.id,
-          isScan: "1",
-          productCode: res.productCode,
-          productId: res.bussinessId,
-          productName: res.productName,
-          productSpec: res.productSpec,
-          productUnit: res.productUnit,
-          quantity: 1,
-          purchaseDetailId: val,
-        });
+    proxy.post("/purchaseDetail/detail", { id: val }).then(
+      (res) => {
+        if (res.bussinessId != rowData.value.productId) {
+          ElMessage({
+            message: "请扫正确的产品",
+            type: "info",
+          });
+        } else {
+          formData.data.stockWaitDetailsList.push({
+            id: rowData.value.id,
+            isScan: "1",
+            productCode: res.productCode,
+            productId: res.bussinessId,
+            productName: res.productName,
+            productSpec: res.productSpec,
+            productUnit: res.productUnit,
+            quantity: 1,
+            purchaseDetailId: val,
+          });
+        }
+        scanValue.value = "";
+      },
+      (err) => {
+        scanValue.value = "";
       }
-      scanValue.value = "";
-    });
+    );
   }
 };
 
@@ -638,4 +653,15 @@ const handleDelete = (index) => {
     left: 0;
   }
 }
+
+.active {
+  background: #a6dd82;
+  color: #fff;
+  border-radius: 4px;
+}
+.disActive {
+  background: #fa9841;
+  color: #fff;
+  border-radius: 4px;
+}
 </style>