Selaa lähdekoodia

报损管理功能

cz 1 vuosi sitten
vanhempi
commit
607d985340

+ 5 - 0
src/components/product/SelectAllGood.vue

@@ -305,6 +305,7 @@ const getList = (req) => {
         businessIdList: productIdList,
         data: sourceList.value.data,
         att: "id",
+        businessType: "0",
         fileAtt: "fileList",
         filePathAtt: "fileUrl",
       });
@@ -393,6 +394,10 @@ const handleSubmit = () => {
 const clickSelect = (item) => {
   proxy.$emit("selectGood", item);
 };
+
+const handleClickFile = (file) => {
+  window.open(file.fileUrl, "_blank");
+};
 </script>
 
 <style lang="scss" scoped>

+ 30 - 43
src/views/MES/supplementaryOrder/index.vue

@@ -66,93 +66,80 @@ const dialogVisible = ref(false);
 const modalType = ref("add");
 const statusData = ref([
   {
-    label: "未开始",
-    value: "0",
-  },
-  {
-    label: "进行中",
+    label: "补单",
     value: "1",
   },
   {
-    label: "已完成",
+    label: "丢件",
     value: "2",
   },
 ]);
 const selectConfig = computed(() => [
   // {
-  //   label: "生产状态",
-  //   prop: "produceStatus",
+  //   label: "报损类型",
+  //   prop: "type",
   //   data: statusData.value,
   // },
-  // {
-  //   type: "time",
-  //   label: "交期",
-  //   placeholder: "开始日期",
-  //   prop: "staDeliveryPeriod",
-  //   placeholderOne: "结束日期",
-  //   propOne: "endDeliveryPeriod",
-  // },
-  // {
-  //   type: "time",
-  //   label: "下单日期",
-  //   placeholder: "开始日期",
-  //   prop: "beginTime",
-  //   placeholderOne: "结束日期",
-  //   propOne: "endTime",
-  // },
 ]);
 const config = computed(() => {
   return [
     {
       attrs: {
+        label: "报损类型",
+        prop: "type",
+        width: 100,
+      },
+      render(val) {
+        return proxy.dictValueLabel(val, statusData.value);
+      },
+    },
+    {
+      attrs: {
         label: "发起时间",
-        prop: "orderCode",
-        // width: 150,
+        prop: "repoTime",
+        width: 160,
       },
     },
     {
       attrs: {
         label: "责任人",
-        prop: "quantity",
-        // width: 160,
+        prop: "respUserName",
+        width: 160,
       },
     },
     {
       attrs: {
         label: "生产订单",
-        prop: "userName",
-        // width: 160,
+        prop: "prodOrderCode",
+        width: 140,
       },
     },
     {
       attrs: {
         label: "物品编号",
-        prop: "createTime",
-        // width: 160,
+        prop: "materialCode",
+        width: 160,
       },
     },
     {
       attrs: {
-        label: "物品编号",
-        prop: "processesName",
-        // width: 120,
+        label: "物品名称",
+        prop: "materialName",
+        "min-width": 200,
       },
-      // render(val) {
-      //   return proxy.dictValueLabel(val, statusData.value);
-      // },
     },
     {
       attrs: {
         label: "数量",
-        prop: "createTime",
-        // width: 160,
+        prop: "quantity",
+        width: 100,
       },
     },
     {
       attrs: {
         label: "备注",
-        prop: "createTime",
-        // width: 160,
+        prop: "remark",
+        "min-width": 200,
       },
     },
 
@@ -228,7 +215,7 @@ const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
   proxy
-    .post("/productionReportingDetail/page", sourceList.value.pagination)
+    .post("/reportLossesDetails/page", sourceList.value.pagination)
     .then((res) => {
       sourceList.value.data = res.rows;
       sourceList.value.pagination.total = res.total;

+ 42 - 16
src/views/purchaseSales/outAndInWarehouse/inventoryInquiry/index.vue

@@ -15,11 +15,17 @@
                 text: '导出Excel',
                 action: () => deriveExcel(),
               }, -->
+        <template #pic="{ item }">
+          <div v-if="item.fileList&&item.fileList.length > 0">
+            <img :src="item.fileList[0].fileUrl" class="pic" @click="handleClickFile(item.fileList[0])" />
+          </div>
+          <div v-else></div>
+        </template>
         <template #size="{ item }">
           <div v-if="item.productLength && item.productWidth && item.productHeight">
-            <span>{{ item.productLength }}cm</span>*
-            <span>{{ item.productWidth }}cm</span>*
-            <span>{{ item.productHeight }}cm</span>
+            <span>{{ item.productLength }}</span>*
+            <span>{{ item.productWidth }}</span>*
+            <span>{{ item.productHeight }}</span>
           </div>
         </template>
         <template #btn="{ item }">
@@ -120,6 +126,14 @@ const config = computed(() => {
     },
     {
       attrs: {
+        label: "图片",
+        slot: "pic",
+        align: "center",
+        width: 80,
+      },
+    },
+    {
+      attrs: {
         label: "物品类型",
         prop: "productDefinition",
         width: 80,
@@ -132,14 +146,14 @@ const config = computed(() => {
       attrs: {
         label: "所属分类",
         prop: "productClassifyName",
-        width: 150,
+        width: 170,
       },
     },
     {
       attrs: {
         label: "物品编码",
         prop: "productCustomCode",
-        width: 150,
+        width: 170,
       },
     },
     {
@@ -151,9 +165,9 @@ const config = computed(() => {
     },
     {
       attrs: {
-        label: "尺寸",
+        label: "尺寸 (cm)",
         slot: "size",
-        width: 160,
+        width: 120,
       },
     },
     // {
@@ -170,22 +184,22 @@ const config = computed(() => {
       attrs: {
         label: "库存数量",
         prop: "quantity",
-        width: 140,
-      },
-    },
-    {
-      attrs: {
-        label: "结存单价",
-        prop: "unitPrice",
-        width: 120,
+        width: 100,
       },
     },
+    // {
+    //   attrs: {
+    //     label: "结存单价",
+    //     prop: "unitPrice",
+    //     width: 120,
+    //   },
+    // },
 
     {
       attrs: {
         label: "操作",
         slot: "btn",
-        width: 120,
+        width: 80,
         fixed: "right",
         align: "center",
       },
@@ -298,6 +312,18 @@ const getList = (req) => {
     setTimeout(() => {
       loading.value = false;
     }, 200);
+    const productIdList = res.rows.map((x) => x.productId);
+    // 请求文件数据并回显
+    if (productIdList.length > 0) {
+      proxy.getFileData({
+        businessIdList: productIdList,
+        data: sourceList.value.data,
+        att: "productId",
+        businessType: "0",
+        fileAtt: "fileList",
+        filePathAtt: "fileUrl",
+      });
+    }
   });
 };
 

+ 34 - 11
src/views/purchaseSales/outAndInWarehouse/manualDelivery/index.vue

@@ -11,14 +11,14 @@
       </byTable>
     </div>
 
-    <el-dialog title="手动出库" v-if="dialogVisible" v-model="dialogVisible" width="1000" v-loading="loadingDialog">
+    <el-dialog title="手动出库" v-if="dialogVisible" v-model="dialogVisible" width="1200" v-loading="loadingDialog">
       <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.list" style="width: 100%; margin-top: 16px">
-              <el-table-column prop="productCode" label="产品编码" width="140" />
-              <el-table-column prop="productName" label="产品名称" min-width="160" />
+              <el-table-column prop="productCode" label="编码" width="160" />
+              <el-table-column prop="productName" label="名称" min-width="160" />
               <el-table-column label="尺寸 (cm)" min-width="100">
                 <template #default="{ row, $index }">
                   <div style="width: 100%">
@@ -55,7 +55,7 @@
       </template>
     </el-dialog>
 
-    <el-dialog v-model="openProduct" title="选择商品" width="80%" append-to-body destroy-on-close>
+    <el-dialog v-model="openProduct" title="物品选择" width="90%" append-to-body destroy-on-close>
       <InventoryInquiry :selectStatus="true" :warehouseId="formData.data.warehouseId" @selectGood="selectGood" :key="formData.data.warehouseId">
       </InventoryInquiry>
     </el-dialog>
@@ -104,6 +104,7 @@ const sourceList = ref({
     warehouseId: "",
     type: "",
     opType: "2",
+    isRestitution: "",
   },
 });
 const loading = ref(false);
@@ -121,7 +122,7 @@ const selectConfig = computed(() => {
     },
     {
       label: "是否已归还",
-      prop: "type",
+      prop: "isRestitution",
       data: [
         {
           label: "是",
@@ -139,6 +140,14 @@ const config = computed(() => {
   return [
     {
       attrs: {
+        label: "单号",
+        prop: "code",
+        width: 120,
+        fixed: "left",
+      },
+    },
+    {
+      attrs: {
         label: "出库原因",
         prop: "type",
         width: 110,
@@ -151,7 +160,7 @@ const config = computed(() => {
       attrs: {
         label: "仓库名称",
         prop: "warehouseName",
-        width: 220,
+        width: 150,
       },
     },
     {
@@ -165,7 +174,7 @@ const config = computed(() => {
       attrs: {
         label: "物品名称",
         prop: "productName",
-        "min-width": 220,
+        "min-width": 250,
       },
     },
     // {
@@ -188,7 +197,7 @@ const config = computed(() => {
     {
       attrs: {
         label: "关联生产订单",
-        prop: "productCode",
+        prop: "prodOrderCode",
         width: 150,
       },
       render(val) {
@@ -206,7 +215,7 @@ const config = computed(() => {
       },
       render(val) {
         if (val) {
-          return val;
+          return val.slice(0, 10);
         }
         return "-";
       },
@@ -219,7 +228,7 @@ const config = computed(() => {
       },
       render(val) {
         if (val) {
-          return val;
+          return val.slice(0, 10);
         }
         return "-";
       },
@@ -233,9 +242,23 @@ const config = computed(() => {
     },
     {
       attrs: {
+        label: "领料人",
+        prop: "exWarehousePerson",
+        width: 110,
+      },
+    },
+    {
+      attrs: {
+        label: "备注",
+        prop: "remark",
+        "min-width": 200,
+      },
+    },
+    {
+      attrs: {
         label: "操作人",
         prop: "opUserName",
-        width: 140,
+        width: 110,
       },
     },
     {

+ 56 - 11
src/views/purchaseSales/outAndInWarehouse/manualWarehousing/index.vue

@@ -11,14 +11,21 @@
       </byTable>
     </div>
 
-    <el-dialog title="手动入库" v-if="dialogVisible" v-model="dialogVisible" width="1000" v-loading="loadingDialog">
+    <el-dialog title="手动入库" v-if="dialogVisible" v-model="dialogVisible" width="1200" v-loading="loadingDialog">
       <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit">
         <template #details>
           <div style="width: 100%">
             <el-button type="primary" @click="openProduct = true">添加明细</el-button>
             <el-table :data="formData.data.list" style="width: 100%; margin-top: 16px">
-              <el-table-column prop="productCode" label="产品编码" width="140" />
-              <el-table-column prop="productName" label="产品名称" min-width="220" />
+              <el-table-column label="图片" width="70" align="center">
+                <template #default="{ row, $index }">
+                  <div style="width: 100%">
+                    <img v-if="row.fileUrl" :src="row.fileUrl" class="pic" @click="handleClickFile(row.fileUrl)" />
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column prop="productCode" label="编码" width="160" />
+              <el-table-column prop="productName" label="名称" min-width="220" />
               <el-table-column label="尺寸 (cm)" min-width="160">
                 <template #default="{ row, $index }">
                   <div style="width: 100%">
@@ -54,7 +61,7 @@
       </template>
     </el-dialog>
 
-    <el-dialog v-if="openProduct" v-model="openProduct" title="物选择" width="90%" append-to-body>
+    <el-dialog v-if="openProduct" v-model="openProduct" title="物选择" width="90%" append-to-body>
       <SelectAllGood @selectGood="selectGood"></SelectAllGood>
       <!-- <SelectMaterial @selectMaterial="selectMaterial"></SelectMaterial> -->
     </el-dialog>
@@ -67,7 +74,7 @@ import byTable from "@/components/byTable/index";
 import byForm from "@/components/byForm/index";
 import { ElMessage } from "element-plus";
 import SelectAllGood from "@/components/product/SelectAllGood";
-import SelectMaterial from "@/components/product/SelectMaterial.vue";
+// import SelectMaterial from "@/components/product/SelectMaterial.vue";
 const { proxy } = getCurrentInstance();
 const warehouseList = ref([]);
 const materialUnitData = computed(
@@ -133,6 +140,14 @@ const config = computed(() => {
   return [
     {
       attrs: {
+        label: "单号",
+        prop: "code",
+        width: 120,
+        fixed: "left",
+      },
+    },
+    {
+      attrs: {
         label: "入库原因",
         prop: "type",
         width: 110,
@@ -145,7 +160,7 @@ const config = computed(() => {
       attrs: {
         label: "仓库名称",
         prop: "warehouseName",
-        width: 220,
+        width: 150,
       },
     },
     {
@@ -182,7 +197,7 @@ const config = computed(() => {
     {
       attrs: {
         label: "关联生产订单",
-        prop: "productCode",
+        prop: "prodOrderCode",
         width: 150,
       },
       render(val) {
@@ -201,9 +216,23 @@ const config = computed(() => {
     },
     {
       attrs: {
+        label: "申请入库人",
+        prop: "exWarehousePerson",
+        width: 110,
+      },
+    },
+    {
+      attrs: {
+        label: "备注",
+        prop: "remark",
+        "min-width": 200,
+      },
+    },
+    {
+      attrs: {
         label: "操作人",
         prop: "opUserName",
-        width: 140,
+        width: 110,
       },
     },
     {
@@ -245,10 +274,16 @@ const getDict = () => {
       pageNum: 1,
       pageSize: 9999,
       isRestitution: 0,
+      type: "3",
     })
     .then((res) => {
       lendData.value = res.rows.map((x) => ({
-        label: x.code,
+        label:
+          x.expectRestitutionTime.slice(0, 10) +
+          " " +
+          x.exWarehousePerson +
+          " " +
+          x.remarks,
         value: x.id,
       }));
     });
@@ -258,8 +293,10 @@ const getDict = () => {
       pageNum: 1,
       pageSize: 9999,
       isSeek: 0,
+      type: "5",
     })
     .then((res) => {
+      console.log(res.rows, "sss");
       lendDataOne.value = res.rows.map((x) => ({
         label: x.code,
         value: x.id,
@@ -320,7 +357,7 @@ const formConfig = computed(() => {
       label: "入库原因",
       required: true,
       data: inBoundReason.value,
-      fn: () => {
+      fn: (val) => {
         if (["101", "102", "108", "109"].includes(val)) {
           formData.data.borrowId = "";
           formData.data.loseId = "";
@@ -361,7 +398,6 @@ const formConfig = computed(() => {
       itemWidth: 50,
       isShow: formData.data.type == "103",
     },
-
     {
       type: "input",
       itemType: "textarea",
@@ -455,7 +491,12 @@ const selectMaterial = (row) => {
 };
 
 const selectGood = (row) => {
+  let fileUrl = "";
+  if (row.fileList && row.fileList.length > 0) {
+    fileUrl = row.fileList[0].fileUrl;
+  }
   formData.data.list.push({
+    fileUrl: fileUrl,
     productCode: row.customCode,
     productId: row.id,
     productName: row.name,
@@ -500,6 +541,10 @@ const acquireSelectList = () => {
   }
   return data;
 };
+
+const handleClickFile = (fileUrl) => {
+  window.open(fileUrl, "_blank");
+};
 </script>
 
 <style lang="scss" scoped>

+ 47 - 33
src/views/purchaseSales/stockManage/inventory/index.vue

@@ -28,13 +28,20 @@
               添加物品
             </el-button>
             <el-table :data="formData.data.list" :row-class-name="changeClass">
-              <el-table-column prop="productCode" label="物品编码" />
-              <el-table-column prop="productName" label="物品名称" />
-              <el-table-column prop="productUnit" label="单位" :formatter="
+              <el-table-column label="图片" width="70" align="center">
+                <template #default="{ row, $index }">
+                  <div style="width: 100%">
+                    <img v-if="row.fileUrl" :src="row.fileUrl" class="pic" @click="handleClickFile(row.fileUrl)" />
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column prop="productCode" label="物品编码" width="160" />
+              <el-table-column prop="productName" label="物品名称" min-width="160" />
+              <!-- <el-table-column prop="productUnit" label="单位" :formatter="
                   (row) => dictValueLabel(row.productUnit, productUnit)
-                " />
-              <el-table-column prop="quantity" label="库存数量" />
-              <el-table-column prop="checkQuantity" label="盘点数量" min-width="150">
+                " /> -->
+              <el-table-column prop="quantity" label="库存数量" width="100" />
+              <el-table-column prop="checkQuantity" label="盘点数量" width="140">
                 <template #default="{ row, $index }">
                   <el-form-item :prop="'list.' + $index + '.checkQuantity'" :rules="rules.checkQuantity" :inline-message="true"
                                 class="margin-b-0 wid100">
@@ -43,8 +50,8 @@
                   </el-form-item>
                 </template>
               </el-table-column>
-              <el-table-column prop="result" label="盘点结果" />
-              <el-table-column prop="zip" label="操作" width="100" v-if="modalType == 'add'">
+              <el-table-column prop="result" label="盘点结果" width="80" />
+              <el-table-column prop="zip" label="操作" width="80" v-if="modalType == 'add'">
                 <template #default="{ $index }">
                   <el-button type="primary" link @click="handleRemove($index)">删除</el-button>
                 </template>
@@ -60,10 +67,10 @@
         </el-button>
       </template>
     </el-dialog>
-    <el-dialog v-if="openProduct" v-model="openProduct" title="选择物品" width="90%" append-to-body>
-      <!-- <SelectGoods :selectList="acquireSelectList()" @cancel="openProduct = false" @pushGoods="pushGoods"></SelectGoods> -->
+    <el-dialog v-if="openProduct" v-model="openProduct" title="物品选择" width="90%" append-to-body>
+      <SelectAllGood @selectGood="selectMaterial"></SelectAllGood>
 
-      <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
+      <!-- <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
         <el-tab-pane label="产品" name="first">
           <SelectProduct @selectProduct="selectMaterial"></SelectProduct>
         </el-tab-pane>
@@ -71,7 +78,7 @@
           <SelectMaterial @selectMaterial="selectMaterial"></SelectMaterial>
         </el-tab-pane>
 
-      </el-tabs>
+      </el-tabs> -->
     </el-dialog>
   </div>
 </template>
@@ -83,9 +90,9 @@ import byTable from "@/components/byTable/index";
 import byForm from "@/components/byForm/index";
 import { computed, defineComponent, ref } from "vue";
 import useUserStore from "@/store/modules/user";
-import SelectGoods from "@/components/product/SelectGoods";
-import SelectMaterial from "@/components/product/SelectMaterial.vue";
-import SelectProduct from "@/components/product/SelectProduct.vue";
+import SelectAllGood from "@/components/product/SelectAllGood";
+// import SelectMaterial from "@/components/product/SelectMaterial.vue";
+// import SelectProduct from "@/components/product/SelectProduct.vue";
 const activeName = ref("first");
 const loading = ref(false);
 const submitLoading = ref(false);
@@ -379,7 +386,7 @@ const pushGoods = (goods) => {
     const ids = arr.map((x) => x.productId);
     if (formData.data.warehouseId) {
       proxy
-        .post("/stock/pageByWarehouse", {
+        .post("/stock/page", {
           id: formData.data.warehouseId,
           productIds: ids,
         })
@@ -414,7 +421,12 @@ const pushGoods = (goods) => {
 const selectMaterial = (row) => {
   let flag = formData.data.list.some((x) => x.productId == row.id);
   if (!flag) {
+    let fileUrl = "";
+    if (row.fileList && row.fileList.length > 0) {
+      fileUrl = row.fileList[0].fileUrl;
+    }
     formData.data.list.push({
+      fileUrl: fileUrl,
       productCode: row.customCode,
       productId: row.id,
       productName: row.name,
@@ -425,35 +437,33 @@ const selectMaterial = (row) => {
     const ids = formData.data.list.map((x) => x.productId);
     if (formData.data.warehouseId) {
       proxy
-        .post("/stock/pageByWarehouse", {
+        .post("/stock/page", {
           id: formData.data.warehouseId,
           productIds: ids,
         })
         .then((res) => {
-          const productList = res.rows;
-          if (productList.length > 0) {
-            for (let i = 0; i < arr.length; i++) {
-              const e = arr[i];
-              const current = productList.find(
-                (x) => x.productId === e.productId
-              );
-              if (current) {
-                formData.data.list.push({ ...e, quantity: current.quantity });
-              } else {
-                formData.data.list.push({ ...e, quantity: 0 });
+          if (res.rows && res.rows.length > 0) {
+            for (let i = 0; i < formData.data.list.length; i++) {
+              const iele = formData.data.list[i];
+              let quantity = 0;
+              for (let j = 0; j < res.rows.length; j++) {
+                const jele = res.rows[j];
+                if (iele.productId == jele.productId) {
+                  quantity = jele.quantity;
+                }
               }
+              iele.quantity = quantity;
             }
           } else {
-            for (let i = 0; i < arr.length; i++) {
-              const e = arr[i];
-              formData.data.list.push({ ...e, quantity: 0 });
+            for (let i = 0; i < formData.data.list.length; i++) {
+              formData.data.list[i].quantity = 0;
             }
           }
         });
     }
     proxy.msgTip("选择成功");
   } else {
-    proxy.msgTip("该物已选择", 2);
+    proxy.msgTip("该物已选择", 2);
   }
 };
 
@@ -473,7 +483,7 @@ const handleRemove = (index) => {
 //     modalType.value == "add"
 //   ) {
 //     proxy
-//       .post("/stock/pageByWarehouse", {
+//       .post("/stock/page", {
 //         id: formData.data.warehouseId,
 //         productIds: list.map((x) => x.productId),
 //       })
@@ -555,6 +565,10 @@ const acquireSelectList = () => {
   }
   return data;
 };
+
+const handleClickFile = (fileUrl) => {
+  window.open(fileUrl, "_blank");
+};
 </script>
 
 <style lang="scss" scoped>