lxf 1 year ago
parent
commit
190ec0b493

+ 1 - 6
src/views/group/BOM/management/index.vue

@@ -67,7 +67,7 @@
                     {{ `${spec.length}  *  ${spec.width}  *  ${spec.height}(cm³)` }}
                   </div>
                   <div style="width: 60px; text-align: center" v-if="props.selectStatus && !props.priceSystemId">
-                    <el-button type="primary" text @click="selectBOM(spec)" :disabled="selectBtnStatus">选择</el-button>
+                    <el-button type="primary" text @click="selectBOM(spec)" v-preReClick>选择</el-button>
                   </div>
                   <div style="width: 140px; padding: 0 12px" v-if="props.priceSystemId">
                     <el-input-number
@@ -538,13 +538,8 @@ const getLogsList = async (req) => {
   });
 };
 const emit = defineEmits(["selectBOM"]);
-const selectBtnStatus = ref(false);
 const selectBOM = (item) => {
-  selectBtnStatus.value = true;
   emit("selectBOM", item);
-  setTimeout(() => {
-    selectBtnStatus.value = false;
-  }, 200);
 };
 const priceBillingStandardList = ref([]);
 const getPriceBillingStandard = () => {

+ 46 - 17
src/views/group/order/management/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <el-card class="box-card">
+    <el-card :class="props.selectStatus ? 'select-card' : 'box-card'">
       <byTable
         :source="sourceList.data"
         :pagination="sourceList.pagination"
@@ -9,10 +9,12 @@
         :searchConfig="searchConfig"
         highlight-current-row
         :action-list="[
-          {
-            text: '操作日志',
-            action: () => viewLogs(),
-          },
+          props.selectStatus
+            ? {}
+            : {
+                text: '操作日志',
+                action: () => viewLogs(),
+              },
         ]"
         @get-list="getList"
         @clickReset="clickReset">
@@ -71,6 +73,9 @@ import byTable from "@/components/byTable/index";
 import { ElMessage, ElMessageBox } from "element-plus";
 
 const { proxy } = getCurrentInstance();
+const props = defineProps({
+  selectStatus: Boolean,
+});
 const departmentList = ref([{ dictKey: "0", dictValue: "胜德体育" }]);
 const sourceList = ref({
   data: [],
@@ -298,18 +303,30 @@ const config = computed(() => {
       },
       renderHTML(row) {
         return [
-          {
-            attrs: {
-              label: "税率",
-              type: "primary",
-              text: true,
-            },
-            el: "button",
-            click() {
-              clickChangeTaxRate(row);
-            },
-          },
-          row.status == 0 || row.status == 10 || row.status == 20
+          props.selectStatus
+            ? {
+                attrs: {
+                  label: "选择",
+                  type: "primary",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  clickSelect(row);
+                },
+              }
+            : {
+                attrs: {
+                  label: "税率",
+                  type: "primary",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  clickChangeTaxRate(row);
+                },
+              },
+          (row.status == 0 || row.status == 10 || row.status == 20) && !props.selectStatus
             ? {
                 attrs: {
                   label: "删除",
@@ -351,6 +368,9 @@ const getList = async (req, status) => {
   } else {
     sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   }
+  if (props.selectStatus) {
+    sourceList.value.pagination.linkedStatementOfAccount = 0;
+  }
   loading.value = true;
   proxy.post("/orderInfo/page", sourceList.value.pagination).then((res) => {
     sourceList.value.data = res.rows;
@@ -480,6 +500,10 @@ const submitChangeTaxRate = () => {
     }
   });
 };
+const emit = defineEmits(["selectOrder"]);
+const clickSelect = (item) => {
+  emit("selectOrder", item);
+};
 </script>
 
 <style lang="scss" scoped>
@@ -490,4 +514,9 @@ const submitChangeTaxRate = () => {
   margin-top: 10px !important;
   margin-bottom: 10px !important;
 }
+.select-card {
+  height: calc(100vh - 184px);
+  overflow-y: auto;
+  overflow-x: hidden;
+}
 </style>

+ 1 - 6
src/views/group/product/management/index.vue

@@ -51,7 +51,7 @@
                 {{ `${spec.length}  *  ${spec.width}  *  ${spec.height}(cm³)` }}
               </div>
               <div style="width: 60px; text-align: center" v-if="props.selectStatus">
-                <el-button type="primary" text @click="selectProduct(spec, item)" :disabled="selectBtnStatus">选择</el-button>
+                <el-button type="primary" text @click="selectProduct(spec, item)" v-preReClick>选择</el-button>
               </div>
             </div>
           </div>
@@ -335,13 +335,8 @@ const getLogsList = async (req) => {
   });
 };
 const emit = defineEmits(["selectProduct"]);
-const selectBtnStatus = ref(false);
 const selectProduct = (spec, item) => {
-  selectBtnStatus.value = true;
   emit("selectProduct", spec, item);
-  setTimeout(() => {
-    selectBtnStatus.value = false;
-  }, 200);
 };
 </script>