|
@@ -1,30 +1,31 @@
|
|
|
<template>
|
|
|
<div class="mainContentBox">
|
|
|
<avue-crud
|
|
|
- ref="crudRef"
|
|
|
- v-model="form"
|
|
|
- v-model:page="page"
|
|
|
- v-model:search="search"
|
|
|
- :data="pageData"
|
|
|
- :option="option"
|
|
|
- :permission="permission"
|
|
|
- :table-loading="loading"
|
|
|
- :row-style="tableRowClassName"
|
|
|
- @search-change="handleQuery"
|
|
|
- @search-reset="resetChange"
|
|
|
- @size-change="handleQuery"
|
|
|
- @current-change="handleQuery"
|
|
|
- @row-save="rowSave"
|
|
|
- @row-update="rowUpdate"
|
|
|
- @row-del="rowDel"
|
|
|
+ ref="crudRef"
|
|
|
+ v-model="form"
|
|
|
+ v-model:page="page"
|
|
|
+ v-model:search="search"
|
|
|
+ :data="pageData"
|
|
|
+ :option="option"
|
|
|
+ :permission="permission"
|
|
|
+ :table-loading="loading"
|
|
|
+ :row-style="tableRowClassName"
|
|
|
+ @search-change="handleQuery"
|
|
|
+ @search-reset="resetChange"
|
|
|
+ @size-change="handleQuery"
|
|
|
+ @current-change="handleQuery"
|
|
|
+ @row-save="rowSave"
|
|
|
+ @row-update="rowUpdate"
|
|
|
+ @row-del="rowDel"
|
|
|
>
|
|
|
-<!-- <template #menu-left="{ size }">
|
|
|
- <el-button type="primary" @click="scan">扫码导入</el-button>
|
|
|
- <el-button type="primary" @click="test">测试数据</el-button>
|
|
|
- </template>-->
|
|
|
+ <template #menu-left="{ size }">
|
|
|
+ <el-button type="primary" icon="el-icon-plus" @click="handleAdd">新增</el-button>
|
|
|
+<!-- <el-button type="primary" @click="scan">扫码导入</el-button>
|
|
|
+ <el-button type="primary" @click="test">测试数据</el-button>-->
|
|
|
+ </template>
|
|
|
<template #menu-right="{}">
|
|
|
<el-dropdown v-hasPerm="['plan:order:import']" split-button
|
|
|
- >导入
|
|
|
+ >导入
|
|
|
<template #dropdown>
|
|
|
<el-dropdown-menu>
|
|
|
<el-dropdown-item @click="downloadTemplateExcel">
|
|
@@ -39,9 +40,9 @@
|
|
|
</template>
|
|
|
</el-dropdown>
|
|
|
<el-button
|
|
|
- v-hasPerm="['plan:order:export']"
|
|
|
- class="ml-3"
|
|
|
- @click="handleExport"
|
|
|
+ v-hasPerm="['plan:order:export']"
|
|
|
+ class="ml-3"
|
|
|
+ @click="handleExport"
|
|
|
>
|
|
|
<template #icon>
|
|
|
<i-ep-download />
|
|
@@ -51,94 +52,94 @@
|
|
|
</template>
|
|
|
<template #menu="{ size, row, index }">
|
|
|
<el-button
|
|
|
- v-if="
|
|
|
+ v-if="
|
|
|
row.orderState === '0' ||
|
|
|
row.orderState === '1' ||
|
|
|
row.orderState === '2' ||
|
|
|
row.orderState === '3'
|
|
|
"
|
|
|
- v-hasPerm="[buttonPermission.PLAN.BTNS.order_edit]"
|
|
|
- link
|
|
|
- size="small"
|
|
|
- type="primary"
|
|
|
- @click="handleEdit(row, 0)">
|
|
|
+ v-hasPerm="[buttonPermission.PLAN.BTNS.order_edit]"
|
|
|
+ link
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ @click="handleEdit(row, 0)">
|
|
|
<i-ep-edit />
|
|
|
编辑
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
- v-if="
|
|
|
+ v-if="
|
|
|
row.orderState === '0' ||
|
|
|
row.orderState === '1' ||
|
|
|
row.orderState === '2'
|
|
|
"
|
|
|
- v-hasPerm="[buttonPermission.PLAN.BTNS.order_del]"
|
|
|
- link
|
|
|
- size="small"
|
|
|
- type="danger"
|
|
|
- @click="rowDel(row, 0)"
|
|
|
+ v-hasPerm="[buttonPermission.PLAN.BTNS.order_del]"
|
|
|
+ link
|
|
|
+ size="small"
|
|
|
+ type="danger"
|
|
|
+ @click="rowDel(row, 0)"
|
|
|
>
|
|
|
<i-ep-delete />
|
|
|
删除
|
|
|
</el-button>
|
|
|
<!-- <el-button
|
|
|
- v-if="row.orderState == '5'"
|
|
|
- size="small"
|
|
|
- type="primary"
|
|
|
- @click="handleScanCode(row.id)"
|
|
|
- >二维码生成
|
|
|
+ v-if="row.orderState == '5'"
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ @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
|
|
|
+ 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
|
|
|
+ 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
|
|
|
- v-model="dialog1.visible"
|
|
|
- :title="dialog1.title"
|
|
|
- width="950px"
|
|
|
- @close="dialog1.visible = false"
|
|
|
+ v-model="dialog1.visible"
|
|
|
+ :title="dialog1.title"
|
|
|
+ width="950px"
|
|
|
+ @close="dialog1.visible = false"
|
|
|
>
|
|
|
<choice-item-page @material-info="materialInfo" />
|
|
|
</el-dialog>
|
|
|
<el-dialog
|
|
|
- v-model="dialog.visible"
|
|
|
- :title="dialog.title"
|
|
|
- width="500px"
|
|
|
- @close="closeDialog"
|
|
|
+ v-model="dialog.visible"
|
|
|
+ :title="dialog.title"
|
|
|
+ width="500px"
|
|
|
+ @close="closeDialog"
|
|
|
>
|
|
|
<el-form
|
|
|
- v-if="dialog.type === 'obj-import'"
|
|
|
- :model="importData"
|
|
|
- label-width="100px"
|
|
|
+ v-if="dialog.type === 'obj-import'"
|
|
|
+ :model="importData"
|
|
|
+ label-width="100px"
|
|
|
>
|
|
|
<el-form-item label="Excel文件">
|
|
|
<el-upload
|
|
|
- ref="uploadRef"
|
|
|
- :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
|
|
|
+ ref="uploadRef"
|
|
|
+ :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 />
|
|
@@ -162,20 +163,20 @@
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
<el-dialog
|
|
|
- v-model="dialog2.visible"
|
|
|
- :title="dialog2.title"
|
|
|
- width="950px"
|
|
|
- @close="
|
|
|
+ v-model="dialog2.visible"
|
|
|
+ :title="dialog2.title"
|
|
|
+ width="950px"
|
|
|
+ @close="
|
|
|
dialog2.visible = false;
|
|
|
scanArray = [];
|
|
|
scanCpArray = [];
|
|
|
"
|
|
|
>
|
|
|
<el-input
|
|
|
- v-model="scanCode"
|
|
|
- placeholder="请扫码"
|
|
|
- style="padding: 20px"
|
|
|
- @keyup.enter="scanFnc"
|
|
|
+ v-model="scanCode"
|
|
|
+ placeholder="请扫码"
|
|
|
+ style="padding: 20px"
|
|
|
+ @keyup.enter="scanFnc"
|
|
|
/>
|
|
|
|
|
|
<div class="scanInfo">
|
|
@@ -192,10 +193,10 @@
|
|
|
</el-scrollbar>
|
|
|
<div class="bottombtn">
|
|
|
<el-button
|
|
|
- :disabled="scanArray.length < 1"
|
|
|
- type="primary"
|
|
|
- @click="scanSubmit"
|
|
|
- >生 成
|
|
|
+ :disabled="scanArray.length < 1"
|
|
|
+ type="primary"
|
|
|
+ @click="scanSubmit"
|
|
|
+ >生 成
|
|
|
</el-button>
|
|
|
</div>
|
|
|
|
|
@@ -203,10 +204,10 @@
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
<el-dialog
|
|
|
- v-model="dialog3.visible"
|
|
|
- :title="dialog3.title"
|
|
|
- width="950px"
|
|
|
- @close="
|
|
|
+ v-model="dialog3.visible"
|
|
|
+ :title="dialog3.title"
|
|
|
+ width="950px"
|
|
|
+ @close="
|
|
|
dialog3.visible = false;
|
|
|
scanCodeArray = [];
|
|
|
"
|
|
@@ -217,15 +218,15 @@
|
|
|
</div>
|
|
|
<el-scrollbar class="scrollbarA">
|
|
|
<div
|
|
|
- :style="
|
|
|
+ :style="
|
|
|
scanCodeArray.length == 1 ? ' justify-content: center;' : ''
|
|
|
"
|
|
|
- class="box"
|
|
|
+ class="box"
|
|
|
>
|
|
|
<div
|
|
|
- v-for="(item, index) in scanCodeArray"
|
|
|
- :key="index"
|
|
|
- class="scancodeitem"
|
|
|
+ v-for="(item, index) in scanCodeArray"
|
|
|
+ :key="index"
|
|
|
+ class="scancodeitem"
|
|
|
>
|
|
|
<div class="qrcodeItem">
|
|
|
<vue-qrcode :value="item" error-level="low" size="70" />
|
|
@@ -238,10 +239,10 @@
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
<CommonTable
|
|
|
- ref="ctableRef"
|
|
|
- tableTitle="报故单"
|
|
|
- tableType="FAULT"
|
|
|
- @selected-sure="onSelectedFinish"
|
|
|
+ ref="ctableRef"
|
|
|
+ tableTitle="报故单"
|
|
|
+ tableType="FAULT"
|
|
|
+ @selected-sure="onSelectedFinish"
|
|
|
/>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -350,6 +351,7 @@ option.value = {
|
|
|
searchIndex: 3,
|
|
|
searchIcon: true,
|
|
|
editBtn: false,
|
|
|
+ addBtn: false,
|
|
|
delBtn: false,
|
|
|
searchMenuSpan: 8,
|
|
|
labelWidth: 100,
|
|
@@ -555,7 +557,7 @@ option.value = {
|
|
|
overHidden: true,
|
|
|
type: "select", //类型为下拉选择框
|
|
|
dicUrl:
|
|
|
- dictDataUtil.request_url + dictDataUtil.TYPE_CODE.plan_order_priority,
|
|
|
+ dictDataUtil.request_url + dictDataUtil.TYPE_CODE.plan_order_priority,
|
|
|
props: {
|
|
|
label: "dictLabel",
|
|
|
value: "dictValue",
|
|
@@ -725,18 +727,18 @@ const {
|
|
|
} = useScan();
|
|
|
const queryExpandAlias = () => {
|
|
|
getExpandAlias(dictDataUtil.EXPAND_FIELD_TABLE.plan_order_info).then(
|
|
|
- (data: any) => {
|
|
|
- if (data.data) {
|
|
|
- data.data.forEach((item: any) => {
|
|
|
- option.value.column.push({
|
|
|
- label: item.label,
|
|
|
- prop: item.field,
|
|
|
- width: 100,
|
|
|
- overHidden: true,
|
|
|
+ (data: any) => {
|
|
|
+ if (data.data) {
|
|
|
+ data.data.forEach((item: any) => {
|
|
|
+ option.value.column.push({
|
|
|
+ label: item.label,
|
|
|
+ prop: item.field,
|
|
|
+ width: 100,
|
|
|
+ overHidden: true,
|
|
|
+ });
|
|
|
});
|
|
|
- });
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
);
|
|
|
};
|
|
|
|
|
@@ -749,18 +751,18 @@ const handleQuery = (params, done) => {
|
|
|
...params,
|
|
|
};
|
|
|
getOrderPage(querySearch)
|
|
|
- .then(({ data }) => {
|
|
|
- pageData.value = data.records;
|
|
|
- page.value.total = data.totalCount;
|
|
|
- page.value.currentPage = data.pageNo;
|
|
|
- page.value.pageSize = data.pageSize;
|
|
|
- })
|
|
|
- .finally(() => {
|
|
|
- loading.value = false;
|
|
|
- if (done) {
|
|
|
- done();
|
|
|
- }
|
|
|
- });
|
|
|
+ .then(({ data }) => {
|
|
|
+ pageData.value = data.records;
|
|
|
+ page.value.total = data.totalCount;
|
|
|
+ page.value.currentPage = data.pageNo;
|
|
|
+ page.value.pageSize = data.pageSize;
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ loading.value = false;
|
|
|
+ if (done) {
|
|
|
+ done();
|
|
|
+ }
|
|
|
+ });
|
|
|
};
|
|
|
const resetQuery = () => {};
|
|
|
const rowSave = (form, done, loading) => {
|
|
@@ -788,20 +790,20 @@ const rowUpdate = (form: any, index: any, done: any, loading: any) => {
|
|
|
|
|
|
const rowDel = (form: any, index) => {
|
|
|
ElMessageBox.confirm("当前操作会删除数据,你确认要继续吗?")
|
|
|
- .then(() => {
|
|
|
- deleteOrders([form.id])
|
|
|
- .then((data: any) => {
|
|
|
- ElMessage({
|
|
|
- message: data.msg,
|
|
|
- type: "success",
|
|
|
- });
|
|
|
- handleQuery(null, null);
|
|
|
- })
|
|
|
- .finally(() => {});
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- // catch error
|
|
|
- });
|
|
|
+ .then(() => {
|
|
|
+ deleteOrders([form.id])
|
|
|
+ .then((data: any) => {
|
|
|
+ ElMessage({
|
|
|
+ message: data.msg,
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ handleQuery(null, null);
|
|
|
+ })
|
|
|
+ .finally(() => {});
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ // catch error
|
|
|
+ });
|
|
|
};
|
|
|
const openDialog = (type: any) => {
|
|
|
dialog.visible = true;
|
|
@@ -823,12 +825,12 @@ const downloadTemplateExcel = () => {
|
|
|
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" },
|
|
|
- })
|
|
|
+ JSON.stringify({
|
|
|
+ path: "/api/v1/plan/order/template",
|
|
|
+ token: localStorage.getItem("token"),
|
|
|
+ method: "get",
|
|
|
+ data: { code: 1234, erp: "kkkk" },
|
|
|
+ })
|
|
|
);
|
|
|
} else {
|
|
|
downloadTemplateApi().then((response) => {
|
|
@@ -877,10 +879,10 @@ const handleFileChange = (file: any) => {
|
|
|
const downFile = (response: any) => {
|
|
|
const fileData = response.data;
|
|
|
const fileName = decodeURI(
|
|
|
- response.headers["content-disposition"].split(";")[1].split("=")[1]
|
|
|
+ response.headers["content-disposition"].split(";")[1].split("=")[1]
|
|
|
);
|
|
|
const fileType =
|
|
|
- "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8";
|
|
|
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8";
|
|
|
const blob = new Blob([fileData], { type: fileType });
|
|
|
const downloadUrl = window.URL.createObjectURL(blob);
|
|
|
const downloadLink = document.createElement("a");
|