|
@@ -26,7 +26,7 @@
|
|
|
>导入
|
|
|
<template #dropdown>
|
|
|
<el-dropdown-menu>
|
|
|
- <el-dropdown-item @click="downloadTemplate">
|
|
|
+ <el-dropdown-item @click="downloadTemplateExcel">
|
|
|
<i-ep-download />
|
|
|
下载模板
|
|
|
</el-dropdown-item>
|
|
@@ -94,6 +94,26 @@
|
|
|
@click="handleScanCode(row.id)"
|
|
|
>二维码生成
|
|
|
</el-button>
|
|
|
+ <el-button
|
|
|
+ icon="el-icon-notebook"
|
|
|
+ text
|
|
|
+ v-if="row.orderState === '5' && row.packageUrl === '0'"
|
|
|
+ @click="zipData(row.orderCode)"
|
|
|
+ type="primary"
|
|
|
+ v-hasPerm="[buttonPermission.PLAN.BTNS.order_data]"
|
|
|
+ :size="size"
|
|
|
+ >生成数据包</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ icon="el-icon-download"
|
|
|
+ text
|
|
|
+ v-if="row.orderState === '5' && row.packageUrl !== '0'"
|
|
|
+ @click="downloadTemplate('/api/v1/plan/order/zip/' + row.id)"
|
|
|
+ type="primary"
|
|
|
+ v-hasPerm="[buttonPermission.PLAN.BTNS.order_downLoad]"
|
|
|
+ :size="size"
|
|
|
+ >下载数据包</el-button
|
|
|
+ >
|
|
|
</template>
|
|
|
</avue-crud>
|
|
|
<el-dialog
|
|
@@ -254,7 +274,14 @@ import {
|
|
|
import { ref } from "vue";
|
|
|
import _ from "lodash-es";
|
|
|
import ChoiceItemPage from "@/views/base/materials/components/choice-item-page.vue";
|
|
|
+import { zipOrder } from "../../../api/order";
|
|
|
+import { useCrud } from "../../../hooks/userCrud";
|
|
|
|
|
|
+const {Utils } =
|
|
|
+ useCrud({
|
|
|
+ src: "/api/v1/plan/order",
|
|
|
+ });
|
|
|
+const {downloadTemplate} = Utils; //按钮权限等工具
|
|
|
// 弹窗对象
|
|
|
const dialog = reactive({
|
|
|
visible: false,
|
|
@@ -266,9 +293,9 @@ const ctableRef = ref(null);
|
|
|
const search = ref({});
|
|
|
const option = ref({});
|
|
|
const pageData = ref([]);
|
|
|
+const loading = ref(false);
|
|
|
const form = ref({});
|
|
|
const page = ref({ total: 0, currentPage: 1, pageSize: 10 });
|
|
|
-const loading = ref(false);
|
|
|
const uploadRef = ref<UploadInstance>(); // 上传组件
|
|
|
const resetChange = () => {
|
|
|
handleQuery(null, null);
|
|
@@ -302,6 +329,21 @@ const permission = reactive({
|
|
|
editBtn: checkPerm(buttonPermission.PLAN.BTNS.order_edit),
|
|
|
menu: true,
|
|
|
});
|
|
|
+const zipOder = ref({});
|
|
|
+const zipData = (orderCode) => {
|
|
|
+ loading.value = true;
|
|
|
+ zipOder.value.orderCode = orderCode;
|
|
|
+ zipOrder(zipOder.value).then((data) => {
|
|
|
+ if (data.code === "200") {
|
|
|
+ loading.value = false;
|
|
|
+ ElMessage.success(data.msg);
|
|
|
+ handleQuery(null, null);
|
|
|
+ } else {
|
|
|
+ loading.value = false;
|
|
|
+ ElMessage.error(data.msg);
|
|
|
+ }
|
|
|
+ });
|
|
|
+};
|
|
|
const crudRef = ref(null); //crudRef.value 获取avue-crud对象
|
|
|
option.value = {
|
|
|
border: true,
|
|
@@ -814,7 +856,7 @@ const closeDialog = () => {
|
|
|
importData.fileList = [];
|
|
|
}
|
|
|
};
|
|
|
-const downloadTemplate = () => {
|
|
|
+const downloadTemplateExcel = () => {
|
|
|
if (window.openHarmonyBridge) {
|
|
|
//适配鸿蒙下载
|
|
|
window.openHarmonyBridge.download(
|
|
@@ -831,6 +873,7 @@ const downloadTemplate = () => {
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
+
|
|
|
const handleEdit = (row: any, index: any) => {
|
|
|
crudRef.value && crudRef.value.rowEdit(row, index);
|
|
|
};
|