cz пре 1 година
родитељ
комит
e306b88087

+ 36 - 76
src/components/process/SendPurchase.vue

@@ -468,62 +468,7 @@ const emit = defineEmits(["auxiliaryChange"]);
 let auxiliaryData = ref([
   {
     label: "供应商最近采购",
-    data: [
-      [
-        {
-          label: "合同编号",
-          value: "",
-          fn: () => {},
-          num: 1,
-        },
-        {
-          label: "下单日期",
-          value: "",
-          num: 1,
-        },
-        {
-          label: "合同金额",
-          value: "",
-          num: 1,
-        },
-      ],
-      [
-        {
-          label: "合同编号",
-          value: "",
-          fn: () => {},
-          num: 1,
-        },
-        {
-          label: "下单日期",
-          value: "",
-          num: 1,
-        },
-        {
-          label: "合同金额",
-          value: "",
-          num: 1,
-        },
-      ],
-      [
-        {
-          label: "合同编号",
-          value: "",
-          fn: () => {},
-          num: 1,
-        },
-        {
-          label: "下单日期",
-          value: "",
-          num: 1,
-        },
-        {
-          label: "合同金额",
-          value: "",
-          num: 1,
-        },
-      ],
-    ],
+    data: [],
   },
   {
     label: "产品价格",
@@ -545,26 +490,41 @@ const getAuxiliaryData = (supplyId, productIdList) => {
         // 获取数组长度
         let dataLength = auxiliaryData.value.length;
         // 供应商最近采购
-        auxiliaryData.value[dataLength - 2].data = auxiliaryData.value[
-          dataLength - 2
-        ].data.map((x, index) => {
-          return x.map((y, sonIndex) => {
-            let obj = { ...y };
-            let value = "";
-            if (sonIndex === 0) {
-              value = res.purchaseList[index].code;
-            } else if (sonIndex === 1) {
-              value = res.purchaseList[index].createTime;
-            } else {
-              value =
-                res.purchaseList[index].currency +
-                " " +
-                proxy.moneyFormat(res.purchaseList[index].amount, 2);
-            }
-            obj.value = value;
-            return obj;
-          });
-        });
+        const recentlyArr = [
+          {
+            label: "合同编号",
+            value: "",
+            fn: () => {},
+            num: 1,
+          },
+          {
+            label: "下单日期",
+            value: "",
+            num: 1,
+          },
+          {
+            label: "合同金额",
+            value: "",
+            num: 1,
+          },
+        ];
+        auxiliaryData.value[dataLength - 2].data = res.purchaseList.map(
+          (x, index) => {
+            return recentlyArr.map((y, sonIndex) => {
+              let obj = { ...y };
+              let value = "";
+              if (sonIndex === 0) {
+                value = x.code;
+              } else if (sonIndex === 1) {
+                value = x.createTime;
+              } else {
+                value = x.currency + " " + proxy.moneyFormat(x.amount, 2);
+              }
+              obj.value = value;
+              return obj;
+            });
+          }
+        );
         // 产品价格
         const arrConfig = [
           {

+ 27 - 15
src/views/purchaseManage/purchaseManage/alreadyPurchase/index.vue

@@ -86,7 +86,11 @@
             <el-table-column prop="productCode" label="货品编码" />
             <el-table-column prop="productName" label="货品名称" />
             <el-table-column prop="productSpec" label="规格型号" />
-            <el-table-column prop="productUnit" label="单位" />
+            <el-table-column
+              prop="productUnit"
+              label="单位"
+              :formatter="(row) => dictValueLabel(row.productUnit, productUnit)"
+            />
             <el-table-column prop="purchaseCount" label="采购数量" />
             <el-table-column prop="sumArrivalCount" label="已到货" />
             <el-table-column prop="count" label="本次到货" min-width="150">
@@ -287,17 +291,19 @@ const config = computed(() => {
       },
       renderHTML(row) {
         return [
-          {
-            attrs: {
-              label: "到货通知",
-              type: "primary",
-              text: true,
-            },
-            el: "button",
-            click() {
-              handleArrival(row);
-            },
-          },
+          row.purchaseStatus == 30
+            ? {
+                attrs: {
+                  label: "到货通知",
+                  type: "primary",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  handleArrival(row);
+                },
+              }
+            : {},
           {
             attrs: {
               label: "作废",
@@ -462,14 +468,20 @@ const handleEdit = (row, status) => {
   });
 };
 
-// 获取供应商数据
 const supplierData = ref([]);
-const getSupplierList = async (req) => {
+const productUnit = ref([]);
+const getDict = async (req) => {
   proxy
     .post("/supplierInfo/page", { pageNum: 1, pageSize: 9999 })
     .then((res) => {
       supplierData.value = res.rows;
     });
+  proxy.getDictOne(["unit"]).then((res) => {
+    productUnit.value = res["unit"].map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
+  });
 };
 const handleArrival = (row) => {
   proxy.post("/purchase/detail", { id: row.id }).then((res) => {
@@ -490,7 +502,7 @@ const handleArrival = (row) => {
 };
 
 getList();
-getSupplierList();
+getDict();
 const start = () => {
   proxy.$router.replace({
     path: "/platform_manage/process/processApproval",