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

复制所有万里牛单号

lxf 1 жил өмнө
parent
commit
4af150eb95

+ 1 - 0
package.json

@@ -56,6 +56,7 @@
     "vue-lazyload": "^3.0.0",
     "vue-router": "4.1.4",
     "vue-super-flow": "^1.3.8",
+    "vue3-clipboard": "^1.0.0",
     "vue3-print-nb": "^0.1.4"
   },
   "devDependencies": {

+ 24 - 0
src/views/group/finance/check-bill/index.vue

@@ -141,6 +141,7 @@ import SelectOrder from "/src/views/group/order/management/index";
 import PrintSKU from "/src/views/group/finance/check-bill/printSKU.vue";
 import PrintBOM from "/src/views/group/finance/check-bill/printBOM.vue";
 import PrintOrder from "/src/views/group/finance/check-bill/printOrder.vue";
+import { copyText } from "vue3-clipboard";
 
 const { proxy } = getCurrentInstance();
 const departmentList = ref([{ dictKey: "0", dictValue: "胜德体育" }]);
@@ -248,6 +249,17 @@ const config = computed(() => {
         return [
           {
             attrs: {
+              label: "复制单号",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              clickCopyWLNCode(row);
+            },
+          },
+          {
+            attrs: {
               label: "打印",
               type: "primary",
               text: true,
@@ -584,6 +596,18 @@ const clickPrint = (row) => {
   rowData.value = row;
   openPrint.value = true;
 };
+const clickCopyWLNCode = (row) => {
+  ElMessage("复制数据中,请稍后");
+  proxy.post("/statementOfAccount/getOrderWlnCodeStr", [row.id]).then((res) => {
+    copyText(res, undefined, (error) => {
+      if (error) {
+        ElMessage.error(`复制失败: ${error} !`);
+      } else {
+        ElMessage.success(`复制成功!`);
+      }
+    });
+  });
+};
 </script>
 
 <style lang="scss" scoped>

+ 28 - 1
src/views/group/finance/summary/index.vue

@@ -35,6 +35,8 @@ import byTable from "/src/components/byTable/index";
 import PrintSKU from "/src/views/group/finance/summary/printSKU.vue";
 import PrintBOM from "/src/views/group/finance/summary/printBOM.vue";
 import PrintOrder from "/src/views/group/finance/summary/printOrder.vue";
+import { copyText } from "vue3-clipboard";
+import { ElMessage } from "element-plus";
 
 const { proxy } = getCurrentInstance();
 const departmentList = ref([{ dictKey: "0", dictValue: "胜德体育" }]);
@@ -124,7 +126,7 @@ const config = computed(() => {
     {
       attrs: {
         label: "操作",
-        width: 80,
+        width: 140,
         align: "center",
         fixed: "right",
       },
@@ -132,6 +134,17 @@ const config = computed(() => {
         return [
           {
             attrs: {
+              label: "复制单号",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              clickCopyWLNCode(row);
+            },
+          },
+          {
+            attrs: {
               label: "打印",
               type: "primary",
               text: true,
@@ -204,6 +217,20 @@ const clickPrint = (row) => {
   rowData.value = row;
   openPrint.value = true;
 };
+const clickCopyWLNCode = (row) => {
+  if (row.idGroupConcat) {
+    ElMessage("复制数据中,请稍后");
+    proxy.post("/statementOfAccount/getOrderWlnCodeStr", row.idGroupConcat.split(",")).then((res) => {
+      copyText(res, undefined, (error) => {
+        if (error) {
+          ElMessage.error(`复制失败: ${error} !`);
+        } else {
+          ElMessage.success(`复制成功!`);
+        }
+      });
+    });
+  }
+};
 </script>
 
 <style lang="scss" scoped>

+ 19 - 0
src/views/group/order/management/index.vue

@@ -15,6 +15,12 @@
                 text: '操作日志',
                 action: () => viewLogs(),
               },
+          props.selectStatus
+            ? {}
+            : {
+                text: '复制万里牛单号',
+                action: () => clickCopyWLNCode(),
+              },
         ]"
         @get-list="getList"
         @clickReset="clickReset">
@@ -71,6 +77,7 @@
 <script setup>
 import byTable from "/src/components/byTable/index";
 import { ElMessage, ElMessageBox } from "element-plus";
+import { copyText } from "vue3-clipboard";
 
 const { proxy } = getCurrentInstance();
 const props = defineProps({
@@ -600,6 +607,18 @@ const emit = defineEmits(["selectOrder"]);
 const clickSelect = (item) => {
   emit("selectOrder", item);
 };
+const clickCopyWLNCode = () => {
+  ElMessage("复制数据中,请稍后");
+  proxy.post("/orderInfo/getOrderWlnCodeStr", sourceList.value.pagination).then((res) => {
+    copyText(res, undefined, (error) => {
+      if (error) {
+        ElMessage.error(`复制失败: ${error} !`);
+      } else {
+        ElMessage.success(`复制成功!`);
+      }
+    });
+  });
+};
 </script>
 
 <style lang="scss" scoped>

+ 20 - 0
src/views/group/order/product-management/index.vue

@@ -8,6 +8,12 @@
         :loading="loading"
         :searchConfig="searchConfig"
         highlight-current-row
+        :action-list="[
+          {
+            text: '复制万里牛单号',
+            action: () => clickCopyWLNCode(),
+          },
+        ]"
         @get-list="getList"
         @clickReset="clickReset">
         <template #orderCode="{ item }">
@@ -31,6 +37,8 @@
 
 <script setup>
 import byTable from "/src/components/byTable/index";
+import { ElMessage } from "element-plus";
+import { copyText } from "vue3-clipboard";
 
 const { proxy } = getCurrentInstance();
 const departmentList = ref([{ dictKey: "0", dictValue: "胜德体育" }]);
@@ -355,6 +363,18 @@ const subtotal = (row) => {
   }
   return money;
 };
+const clickCopyWLNCode = () => {
+  ElMessage("复制数据中,请稍后");
+  proxy.post("/orderSku/getOrderWlnCodeStr", sourceList.value.pagination).then((res) => {
+    copyText(res, undefined, (error) => {
+      if (error) {
+        ElMessage.error(`复制失败: ${error} !`);
+      } else {
+        ElMessage.success(`复制成功!`);
+      }
+    });
+  });
+};
 </script>
 
 <style lang="scss" scoped>