Browse Source

进销存模块单位问题

cz 1 year ago
parent
commit
6d743e6beb

+ 7 - 1
src/views/connect/E-mail/mail/com/mailList.vue

@@ -181,7 +181,13 @@ const { proxy } = getCurrentInstance();
 const mailStore = useMailStore();
 let loading = ref(false);
 const tableHeight = ref(0);
-tableHeight.value = window.innerHeight - 280;
+const getTableHeight = () => {
+  tableHeight.value = window.innerHeight - 280;
+};
+getTableHeight();
+window.addEventListener("resize", () => {
+  getTableHeight();
+});
 const tableData = reactive({
   data: [],
   pagination: {

+ 8 - 1
src/views/connect/E-mail/mail/com/right/contract/pi.vue

@@ -72,7 +72,14 @@
 </template>
   
 <script setup>
-const tableHeight = window.innerHeight - 280;
+const tableHeight = ref(0);
+const getTableHeight = () => {
+  tableHeight.value = window.innerHeight - 280;
+};
+getTableHeight();
+window.addEventListener("resize", () => {
+  getTableHeight();
+});
 const loading = ref(false);
 const sourceList = ref({
   data: [],

+ 8 - 1
src/views/connect/E-mail/mail/com/right/contract/quotation.vue

@@ -72,7 +72,14 @@
 </template>
   
 <script setup>
-const tableHeight = window.innerHeight - 280;
+const tableHeight = ref(0);
+const getTableHeight = () => {
+  tableHeight.value = window.innerHeight - 280;
+};
+getTableHeight();
+window.addEventListener("resize", () => {
+  getTableHeight();
+});
 const loading = ref(false);
 const sourceList = ref({
   data: [],

+ 8 - 1
src/views/connect/E-mail/mail/com/right/documents/index.vue

@@ -55,7 +55,14 @@
 </template>
   
 <script setup>
-const tableHeight = window.innerHeight - 209;
+const tableHeight = ref(0);
+const getTableHeight = () => {
+  tableHeight.value = window.innerHeight - 209;
+};
+getTableHeight();
+window.addEventListener("resize", () => {
+  getTableHeight();
+});
 const loading = ref(false);
 const sourceList = ref({
   data: [],

+ 8 - 1
src/views/connect/E-mail/mail/com/right/netdisk/enterprise.vue

@@ -108,7 +108,14 @@ const sourceList = ref({
   },
 });
 const treeListData = ref([]);
-const tableHeight = window.innerHeight - 250;
+const tableHeight = ref(0);
+const getTableHeight = () => {
+  tableHeight.value = window.innerHeight - 250;
+};
+getTableHeight();
+window.addEventListener("resize", () => {
+  getTableHeight();
+});
 const statusData = ref([
   {
     label: "草稿",

+ 8 - 1
src/views/connect/E-mail/mail/com/right/purchase/index.vue

@@ -84,7 +84,14 @@
 </template>
   
 <script setup>
-const tableHeight = window.innerHeight - 209;
+const tableHeight = ref(0);
+const getTableHeight = () => {
+  tableHeight.value = window.innerHeight - 209;
+};
+getTableHeight();
+window.addEventListener("resize", () => {
+  getTableHeight();
+});
 const loading = ref(false);
 const sourceList = ref({
   data: [],

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

@@ -55,7 +55,7 @@
                 label="规格型号"
                 width="160"
               />
-              <el-table-column prop="productUnit" label="单位" width="100" />
+              <el-table-column prop="productUnit" label="单位" width="100" :formatter="(row) => dictValueLabel(row.productUnit, productUnit)" />
               <el-table-column
                 prop="productQuantity"
                 label="库存数量"
@@ -132,6 +132,7 @@ import InventoryInquiry from "@/views/purchaseSales/outAndInWarehouse/inventoryI
 
 const { proxy } = getCurrentInstance();
 const warehouseList = ref([]);
+const productUnit = ref([]);
 const sourceList = ref({
   data: [],
   pagination: {
@@ -189,6 +190,9 @@ const config = computed(() => {
         prop: "productUnit",
         width: 120,
       },
+        render(unit) {
+        return proxy.dictValueLabel(unit, productUnit.value);
+      },
     },
     {
       attrs: {
@@ -224,6 +228,12 @@ const getDict = () => {
       });
     }
   });
+     proxy.getDictOne(['unit']).then((res) => {
+    productUnit.value = res["unit"].map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
+  });
 };
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };

+ 13 - 1
src/views/purchaseSales/outAndInWarehouse/manualWarehousing/index.vue

@@ -27,7 +27,7 @@
               <el-table-column prop="productCode" label="产品编码" width="140" />
               <el-table-column prop="productName" label="产品名称" min-width="220" />
               <el-table-column prop="productSpec" label="规格型号" min-width="220" />
-              <el-table-column prop="productUnit" label="单位" width="100" />
+              <el-table-column prop="productUnit" label="单位" width="100" :formatter="(row) => dictValueLabel(row.productUnit, productUnit)" />
               <el-table-column label="入库数量" width="160">
                 <template #default="{ row, $index }">
                   <div style="width: 100%">
@@ -67,6 +67,9 @@ import SelectGoods from "@/components/product/SelectGoods";
 
 const { proxy } = getCurrentInstance();
 const warehouseList = ref([]);
+const productUnit = ref([]);
+
+
 const sourceList = ref({
   data: [],
   pagination: {
@@ -124,6 +127,9 @@ const config = computed(() => {
         prop: "productUnit",
         width: 120,
       },
+       render(unit) {
+        return proxy.dictValueLabel(unit, productUnit.value);
+      },
     },
     {
       attrs: {
@@ -159,6 +165,12 @@ const getDict = () => {
       });
     }
   });
+   proxy.getDictOne(['unit']).then((res) => {
+    productUnit.value = res["unit"].map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
+  });
 };
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };

+ 9 - 1
src/views/purchaseSales/outAndInWarehouse/waitingForDelivery/index.vue

@@ -47,6 +47,7 @@ import { ElMessage } from "element-plus";
 const { proxy } = getCurrentInstance();
 const warehouseList = ref([]);
 const productType = ref([]);
+const productUnit = ref([]);
 const status = ref([
   {
     label: "待出库",
@@ -168,6 +169,9 @@ const config = computed(() => {
         prop: "productUnit",
         width: 120,
       },
+         render(unit) {
+        return proxy.dictValueLabel(unit, productUnit.value);
+      },
     },
     {
       attrs: {
@@ -223,11 +227,15 @@ const getDict = () => {
       });
     }
   });
-  proxy.getDictOne(["product_type"]).then((res) => {
+  proxy.getDictOne(["product_type",'unit']).then((res) => {
     productType.value = res["product_type"].map((x) => ({
       label: x.dictValue,
       value: x.dictKey,
     }));
+    productUnit.value = res["unit"].map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
   });
 };
 const getList = async (req) => {

+ 9 - 1
src/views/purchaseSales/outAndInWarehouse/waitingForStorage/index.vue

@@ -31,6 +31,7 @@ import { ElMessage } from "element-plus";
 const { proxy } = getCurrentInstance();
 const warehouseList = ref([]);
 const productType = ref([]);
+const productUnit = ref([]);
 const status = ref([
   {
     label: "待入库",
@@ -148,6 +149,9 @@ const config = computed(() => {
         prop: "productUnit",
         width: 120,
       },
+        render(unit) {
+        return proxy.dictValueLabel(unit, productUnit.value);
+      },
     },
     {
       attrs: {
@@ -203,11 +207,15 @@ const getDict = () => {
       });
     }
   });
-  proxy.getDictOne(["product_type"]).then((res) => {
+  proxy.getDictOne(["product_type",'unit']).then((res) => {
     productType.value = res["product_type"].map((x) => ({
       label: x.dictValue,
       value: x.dictKey,
     }));
+      productUnit.value = res["unit"].map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
   });
 };
 const getList = async (req) => {

+ 10 - 0
src/views/purchaseSales/outAndInWarehouse/warehouseAdjustment/index.vue

@@ -67,6 +67,7 @@ import SelectGoods from "@/components/product/SelectGoods";
 
 const { proxy } = getCurrentInstance();
 const warehouseList = ref([]);
+const productUnit = ref([]);
 const sourceList = ref({
   data: [],
   pagination: {
@@ -150,6 +151,9 @@ const config = computed(() => {
         prop: "productUnit",
         width: 120,
       },
+        render(unit) {
+        return proxy.dictValueLabel(unit, productUnit.value);
+      },
     },
     {
       attrs: {
@@ -185,6 +189,12 @@ const getDict = () => {
       });
     }
   });
+      proxy.getDictOne(['unit']).then((res) => {
+    productUnit.value = res["unit"].map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
+  });
 };
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };