|
@@ -2,12 +2,13 @@
|
|
|
<div class="mainContentBox">
|
|
|
<avue-crud
|
|
|
ref="crudRef"
|
|
|
- :option="option"
|
|
|
+ v-model="form"
|
|
|
v-model:page="page"
|
|
|
v-model:search="search"
|
|
|
- v-model="form"
|
|
|
- :table-loading="loading"
|
|
|
+ :data="pageData"
|
|
|
+ :option="option"
|
|
|
:permission="permission"
|
|
|
+ :table-loading="loading"
|
|
|
@search-change="handleQuery"
|
|
|
@search-reset="resetChange"
|
|
|
@size-change="handleQuery"
|
|
@@ -15,47 +16,53 @@
|
|
|
@row-save="rowSave"
|
|
|
@row-update="rowUpdate"
|
|
|
@row-del="rowDel"
|
|
|
- :data="pageData"
|
|
|
>
|
|
|
<template #menu-left="{ size }">
|
|
|
<el-button type="primary" @click="scan">扫码导入</el-button>
|
|
|
<el-button type="primary" @click="test">测试数据</el-button>
|
|
|
</template>
|
|
|
<template #menu-right="{}">
|
|
|
- <el-dropdown split-button v-hasPerm="['plan:order:import']"
|
|
|
+ <el-dropdown v-hasPerm="['plan:order:import']" split-button
|
|
|
>导入
|
|
|
<template #dropdown>
|
|
|
<el-dropdown-menu>
|
|
|
<el-dropdown-item @click="downloadTemplate">
|
|
|
- <i-ep-download />下载模板
|
|
|
+ <i-ep-download />
|
|
|
+ 下载模板
|
|
|
</el-dropdown-item>
|
|
|
<el-dropdown-item @click="openDialog('obj-import')">
|
|
|
- <i-ep-top />导入数据
|
|
|
+ <i-ep-top />
|
|
|
+ 导入数据
|
|
|
</el-dropdown-item>
|
|
|
</el-dropdown-menu>
|
|
|
</template>
|
|
|
</el-dropdown>
|
|
|
<el-button
|
|
|
- class="ml-3"
|
|
|
v-hasPerm="['plan:order:export']"
|
|
|
+ class="ml-3"
|
|
|
@click="handleExport"
|
|
|
>
|
|
|
- <template #icon> <i-ep-download /> </template>导出
|
|
|
+ <template #icon>
|
|
|
+ <i-ep-download />
|
|
|
+ </template>
|
|
|
+ 导出
|
|
|
</el-button>
|
|
|
</template>
|
|
|
<template #menu="{ size, row, index }">
|
|
|
<el-button
|
|
|
- v-hasPerm="[buttonPermission.PLAN.BTNS.order_edit]"
|
|
|
v-if="
|
|
|
row.orderState === '0' ||
|
|
|
row.orderState === '1' ||
|
|
|
row.orderState === '2'
|
|
|
"
|
|
|
- type="primary"
|
|
|
+ v-hasPerm="[buttonPermission.PLAN.BTNS.order_edit]"
|
|
|
link
|
|
|
size="small"
|
|
|
+ type="primary"
|
|
|
@click="handleEdit(row, 0)"
|
|
|
- ><i-ep-edit />编辑
|
|
|
+ >
|
|
|
+ <i-ep-edit />
|
|
|
+ 编辑
|
|
|
</el-button>
|
|
|
<!-- <el-button
|
|
|
v-if="row.nameplated === 1"
|
|
@@ -66,22 +73,24 @@
|
|
|
><i-ep-edit />铭牌
|
|
|
</el-button>-->
|
|
|
<el-button
|
|
|
- v-hasPerm="[buttonPermission.PLAN.BTNS.order_del]"
|
|
|
v-if="
|
|
|
row.orderState === '0' ||
|
|
|
row.orderState === '1' ||
|
|
|
row.orderState === '2'
|
|
|
"
|
|
|
- type="danger"
|
|
|
+ v-hasPerm="[buttonPermission.PLAN.BTNS.order_del]"
|
|
|
link
|
|
|
size="small"
|
|
|
+ type="danger"
|
|
|
@click="rowDel(row, 0)"
|
|
|
- ><i-ep-delete />删除
|
|
|
+ >
|
|
|
+ <i-ep-delete />
|
|
|
+ 删除
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
- type="primary"
|
|
|
- size="small"
|
|
|
v-if="row.orderState == '5'"
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
@click="handleScanCode(row.id)"
|
|
|
>二维码生成
|
|
|
</el-button>
|
|
@@ -109,14 +118,14 @@
|
|
|
<el-form-item label="Excel文件">
|
|
|
<el-upload
|
|
|
ref="uploadRef"
|
|
|
- action=""
|
|
|
- drag
|
|
|
- accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
|
|
|
- :limit="1"
|
|
|
:auto-upload="false"
|
|
|
:file-list="importData.fileList"
|
|
|
+ :limit="1"
|
|
|
:on-change="handleFileChange"
|
|
|
:on-exceed="handleFileExceed"
|
|
|
+ accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
|
|
|
+ action=""
|
|
|
+ drag
|
|
|
>
|
|
|
<el-icon class="el-icon--upload">
|
|
|
<i-ep-upload-filled />
|
|
@@ -150,29 +159,31 @@
|
|
|
"
|
|
|
>
|
|
|
<el-input
|
|
|
- @keyup.enter="scanFnc"
|
|
|
v-model="scanCode"
|
|
|
- style="padding: 20px"
|
|
|
placeholder="请扫码"
|
|
|
+ style="padding: 20px"
|
|
|
+ @keyup.enter="scanFnc"
|
|
|
/>
|
|
|
|
|
|
<div class="scanInfo">
|
|
|
<el-scrollbar class="scrollbar">
|
|
|
- <div class="item" v-for="(item, index) in scanArray" :key="index">
|
|
|
+ <div v-for="(item, index) in scanArray" :key="index" class="item">
|
|
|
<div class="text">扫码Cp: {{ item.cp }}</div>
|
|
|
- <div @click="deleteItem(index)" class="text">
|
|
|
- <el-icon><Delete /></el-icon>
|
|
|
+ <div class="text" @click="deleteItem(index)">
|
|
|
+ <el-icon>
|
|
|
+ <Delete />
|
|
|
+ </el-icon>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div v-if="scanArray.length < 1">暂无数据</div>
|
|
|
</el-scrollbar>
|
|
|
<div class="bottombtn">
|
|
|
<el-button
|
|
|
- type="primary"
|
|
|
:disabled="scanArray.length < 1"
|
|
|
+ type="primary"
|
|
|
@click="scanSubmit"
|
|
|
- >生 成</el-button
|
|
|
- >
|
|
|
+ >生 成
|
|
|
+ </el-button>
|
|
|
</div>
|
|
|
|
|
|
<!-- <vue-qrcode value="1241421gaga" size="45" error-level="H" /> -->
|
|
@@ -193,18 +204,18 @@
|
|
|
</div>
|
|
|
<el-scrollbar class="scrollbarA">
|
|
|
<div
|
|
|
- class="box"
|
|
|
:style="
|
|
|
scanCodeArray.length == 1 ? ' justify-content: center;' : ''
|
|
|
"
|
|
|
+ class="box"
|
|
|
>
|
|
|
<div
|
|
|
- class="scancodeitem"
|
|
|
v-for="(item, index) in scanCodeArray"
|
|
|
:key="index"
|
|
|
+ class="scancodeitem"
|
|
|
>
|
|
|
<div class="qrcodeItem">
|
|
|
- <vue-qrcode :value="item" size="70" error-level="low" />
|
|
|
+ <vue-qrcode :value="item" error-level="low" size="70" />
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -221,7 +232,7 @@
|
|
|
/>
|
|
|
</div>
|
|
|
</template>
|
|
|
-<script setup lang="ts">
|
|
|
+<script lang="ts" setup>
|
|
|
import { checkPerm } from "@/directive/permission";
|
|
|
import type { UploadInstance } from "element-plus";
|
|
|
import { genFileId } from "element-plus";
|
|
@@ -593,6 +604,7 @@ option.value = {
|
|
|
},
|
|
|
],
|
|
|
};
|
|
|
+
|
|
|
function useScanCode() {
|
|
|
const scanCodeArray = ref([]);
|
|
|
const test = async () => {
|
|
@@ -609,7 +621,9 @@ function useScanCode() {
|
|
|
};
|
|
|
return { scanCodeArray, handleScanCode, test };
|
|
|
}
|
|
|
+
|
|
|
const { scanCodeArray, handleScanCode, test } = useScanCode();
|
|
|
+
|
|
|
//扫码板块
|
|
|
|
|
|
function useScan() {
|
|
@@ -665,6 +679,7 @@ function useScan() {
|
|
|
scanSubmit,
|
|
|
};
|
|
|
}
|
|
|
+
|
|
|
const {
|
|
|
scanCode,
|
|
|
scanArray,
|
|
@@ -774,9 +789,21 @@ const closeDialog = () => {
|
|
|
}
|
|
|
};
|
|
|
const downloadTemplate = () => {
|
|
|
- downloadTemplateApi().then((response) => {
|
|
|
- downFile(response);
|
|
|
- });
|
|
|
+ if (window.openHarmonyBridge) {
|
|
|
+ //适配鸿蒙下载
|
|
|
+ window.openHarmonyBridge.download(
|
|
|
+ JSON.stringify({
|
|
|
+ path: "/api/v1/plan/order/template",
|
|
|
+ token: localStorage.getItem("token"),
|
|
|
+ method: "get",
|
|
|
+ data: { code: 1234, erp: "kkkk" },
|
|
|
+ })
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ downloadTemplateApi().then((response) => {
|
|
|
+ downFile(response);
|
|
|
+ });
|
|
|
+ }
|
|
|
};
|
|
|
const handleEdit = (row: any, index: any) => {
|
|
|
crudRef.value && crudRef.value.rowEdit(row, index);
|
|
@@ -851,6 +878,7 @@ const onSelectedFinish = (selectedValue) => {
|
|
|
.scrollbar {
|
|
|
padding: 20px;
|
|
|
height: 350px;
|
|
|
+
|
|
|
.item {
|
|
|
margin: 20px 0;
|
|
|
width: 100%;
|
|
@@ -861,6 +889,7 @@ const onSelectedFinish = (selectedValue) => {
|
|
|
justify-content: space-between;
|
|
|
align-items: center;
|
|
|
padding: 0 20px;
|
|
|
+
|
|
|
.el-icon {
|
|
|
width: 50px;
|
|
|
height: 50px;
|
|
@@ -868,6 +897,7 @@ const onSelectedFinish = (selectedValue) => {
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.scancodeitem {
|
|
|
width: 300px;
|
|
|
height: 300px;
|
|
@@ -876,6 +906,7 @@ const onSelectedFinish = (selectedValue) => {
|
|
|
border-radius: 16px;
|
|
|
border: 1px solid black;
|
|
|
padding-top: 10px;
|
|
|
+
|
|
|
.qrcodeItem {
|
|
|
display: flex;
|
|
|
justify-content: center;
|
|
@@ -883,14 +914,17 @@ const onSelectedFinish = (selectedValue) => {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.bottombtn {
|
|
|
display: flex;
|
|
|
justify-content: center;
|
|
|
align-items: center;
|
|
|
}
|
|
|
+
|
|
|
.scrollbarA {
|
|
|
padding: 20px;
|
|
|
height: 350px;
|
|
|
+
|
|
|
.box {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
@@ -905,6 +939,7 @@ const onSelectedFinish = (selectedValue) => {
|
|
|
justify-content: space-between;
|
|
|
align-items: center;
|
|
|
padding: 0 20px;
|
|
|
+
|
|
|
.el-icon {
|
|
|
width: 50px;
|
|
|
height: 50px;
|
|
@@ -912,6 +947,7 @@ const onSelectedFinish = (selectedValue) => {
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.scancodeitem {
|
|
|
width: 300px;
|
|
|
height: 300px;
|
|
@@ -920,6 +956,7 @@ const onSelectedFinish = (selectedValue) => {
|
|
|
border-radius: 16px;
|
|
|
border: 1px solid black;
|
|
|
padding-top: 10px;
|
|
|
+
|
|
|
.qrcodeItem {
|
|
|
display: flex;
|
|
|
justify-content: center;
|