Эх сурвалжийг харах

已采购按钮权限更改

cz 2 жил өмнө
parent
commit
b3264a3f66

+ 46 - 19
src/views/WDLY/purchaseManage/alreadyPurchase/index.vue

@@ -39,7 +39,7 @@
             <el-button type="primary" link @click="handleReturnGoods(item)"
               >退货</el-button
             >
-            <el-button
+            <!-- <el-button
               type="primary"
               link
               v-if="
@@ -72,6 +72,35 @@
               v-if="item.purchaseStatus == 30 && item.arrivalStatus == 0"
               @click="handleEdit(item, 99)"
               >终止</el-button
+            > -->
+
+            <el-button
+              type="primary"
+              link
+              v-if="item.purchaseStatus != 99"
+              @click="handleArrival(item, 'add')"
+              >发货登记</el-button
+            >
+            <el-button
+              type="primary"
+              link
+              v-if="item.purchaseStatus != 99"
+              @click="handleArrival(item, 'edit')"
+              >到货通知</el-button
+            >
+            <el-button
+              type="primary"
+              link
+              v-if="item.purchaseStatus == 30 && item.arrivalStatus == 10"
+              @click="handleEdit(item, 88)"
+              >作废</el-button
+            >
+            <el-button
+              type="primary"
+              link
+              v-if="item.purchaseStatus != 99"
+              @click="handleEdit(item, 99)"
+              >终止</el-button
             >
           </div>
         </template>
@@ -81,7 +110,6 @@
       :title="modalType === 'add' ? '发货登记' : '到货通知'"
       v-model="dialogVisible"
       width="80%"
-      v-loading="loading"
       destroy-on-close
     >
       <byForm
@@ -90,6 +118,7 @@
         v-model="formData.data"
         :rules="rules"
         ref="byform"
+        v-loading="submitLoading"
       >
         <template #detailSlot>
           <div style="width: 100%">
@@ -1012,8 +1041,18 @@ let formConfigTwo = computed(() => [
     prop: "detailedAddress",
   },
 ]);
+const logisticsData = ref([]);
+const getLogisticsData = (row) => {
+  proxy.post("/companyInfo/list", { pageNum: 1, pageSize: 999 }).then((res) => {
+    logisticsData.value = res.reverse();
+    logisticsData.value = logisticsData.value.map((x) => ({
+      label: x.name,
+      value: x.code,
+    }));
+  });
+};
 
-const configData = [
+const configData = computed(() => [
   [
     {
       type: "title",
@@ -1038,7 +1077,7 @@ const configData = [
       label: "物流信息",
       prop: "logisticsCompanyCode",
       filterable: true,
-      data: [],
+      data: logisticsData.value,
       itemWidth: 50,
       style: {
         width: "100%",
@@ -1099,7 +1138,7 @@ const configData = [
       label: "",
     },
   ],
-];
+]);
 
 const deliverData = ref([]);
 const getList = async (req) => {
@@ -1249,22 +1288,10 @@ const handleEdit = (row, status) => {
   });
 };
 
-const logisticsData = ref([]);
-const getLogisticsData = (row) => {
-  proxy.post("/companyInfo/list", { pageNum: 1, pageSize: 999 }).then((res) => {
-    // logisticsData.value = res.reverse().slice(0, 100); //截取前100
-    logisticsData.value = res.reverse();
-  });
-};
-
 const handleArrival = (row, type) => {
   modalType.value = type;
   if (type === "add") {
-    formConfig = configData[0];
-    formConfig[3].data = logisticsData.value.map((x) => ({
-      label: x.name,
-      value: x.code,
-    }));
+    formConfig = configData.value[0];
     proxy.post("/deliverGoodsDetails/detail", { id: row.id }).then((res) => {
       formData.data = {
         purchaseId: row.id,
@@ -1284,7 +1311,7 @@ const handleArrival = (row, type) => {
       dialogVisible.value = true;
     });
   } else if (type === "edit") {
-    formConfig = configData[1];
+    formConfig = configData.value[1];
     proxy.post("/deliverGoods/list", { id: row.id }).then((res) => {
       deliverData.value = res;
       formConfig[3].data = res.map((x) => ({