diff --git a/public/importTemplates/materialImport.xlsx b/public/importTemplates/materialImport.xlsx
new file mode 100644
index 0000000..35ffa00
Binary files /dev/null and b/public/importTemplates/materialImport.xlsx differ
diff --git a/public/index.html b/public/index.html
index 8cd3f34..11c8690 100644
--- a/public/index.html
+++ b/public/index.html
@@ -38,8 +38,8 @@
<% if (process.env.VUE_APP_NODE_ENV === 'dev') { %>
diff --git a/src/components/DialogUpload.vue b/src/components/DialogUpload.vue
index 961eced..c7efb42 100644
--- a/src/components/DialogUpload.vue
+++ b/src/components/DialogUpload.vue
@@ -10,7 +10,7 @@
- 下载模板
+
+ 下载模板
+
取消
@@ -40,19 +50,20 @@ export default {
props: {
title: {
type: String,
- default: '导入'
+ default: "导入",
},
hint: {
hint: String,
- default: '只能上传 Excel 文件'
+ default: "只能上传 Excel 文件",
},
filename: {
hint: String,
- default: 'default_file.xlsx'
+ default: "default_file.xlsx",
},
- url: { // 下载地址
+ url: {
+ // 下载地址
hint: String,
- default: '/importTemplates/orderImport.xlsx'
+ default: "/importTemplates/orderImport.xlsx",
},
configs: {
type: Object,
@@ -75,6 +86,15 @@ export default {
token: Cookies.get("token") || "",
};
},
+ actionUrl() {
+ return window.SITE_CONFIG["apiURL"] + this.urls.importUrl;
+ },
+ savedFilename() {
+ return "templateUrl" in this.urls ? this.urls.templateUrl.split("/").pop() : this.filename;
+ },
+ templateUrl() {
+ return "templateUrl" in this.urls ? this.urls.templateUrl : this.url ?? "#";
+ },
},
methods: {
init(data) {
@@ -91,6 +111,16 @@ export default {
handleSuccess(response, file, fileList) {
// console.log("success response", response);
+
+ if ("code" in response && response.code === 500) {
+ this.$message({
+ message: response.msg,
+ type: "error",
+ duration: 1500,
+ });
+ return;
+ }
+
let message = "";
let isError = false;
@@ -100,7 +130,7 @@ export default {
message = response;
isError = true;
}
-
+
this.handleClose();
this.$message({
@@ -130,7 +160,7 @@ export default {
handleDownloadTemplate(filename, href) {
this.$notify({
title: "提示",
- message: "开始下载",
+ message: "开始下载,请稍后检查浏览器的下载选项或者下载目录",
type: "success",
});
diff --git a/src/views/atomViews/ListViewWithHead.vue b/src/views/atomViews/ListViewWithHead.vue
index c3922c2..790beaa 100644
--- a/src/views/atomViews/ListViewWithHead.vue
+++ b/src/views/atomViews/ListViewWithHead.vue
@@ -49,7 +49,6 @@
ref="upload-dialog"
v-if="uploadDialogVisible"
title="导入配方"
- url="/importTemplates/bomImport.xlsx"
filename="bomTemplate.xlsx"
@refresh-list="getList" />
diff --git a/src/views/modules/pms/order/components/DialogUpload.vue b/src/views/modules/pms/order/components/DialogUpload.vue
index 36ca3cc..1d48abe 100644
--- a/src/views/modules/pms/order/components/DialogUpload.vue
+++ b/src/views/modules/pms/order/components/DialogUpload.vue
@@ -114,7 +114,7 @@ export default {
handleDownloadTemplate(filename) {
this.$notify({
title: "提示",
- message: "开始下载",
+ message: "开始下载,请稍后检查浏览器的下载选项或者下载目录",
type: "success",
});
diff --git a/src/views/modules/pms/order/config.js b/src/views/modules/pms/order/config.js
index 10d4066..b5597e3 100644
--- a/src/views/modules/pms/order/config.js
+++ b/src/views/modules/pms/order/config.js
@@ -527,81 +527,9 @@ export default function () {
finishedOrder: "/pms/order/pageEnd",
unConfirmedOrder: "/pms/order/pageUnCom",
base: "/pms/order",
- importOrderUrl: "/pms-am/pms/order/importExcelOrder",
- payload: '/pms/carHandle'
- // base: "/pms/material",
- // page: "/pms/material/page",
- // tree: "/pms/material/tree",
- // subase: "/pms/materialArrt",
- // subpage: "/pms/materialArrt/page",
- // more...
+ importUrl: "/pms-am/pms/order/importExcelOrder",
+ templateUrl: '/importTemplates/orderImport.xlsx',
+ payload: '/pms/carHandle',
},
};
-}
-
-// const headFormFields = [
-// {
-// label: '订单号',
-// prop: 'code',
-// input: true,
-// bind: { placeholder: '请输入订单号' }
-// },
-// // {
-// // label: '子订单号',
-// // prop: 'cate',
-// // input: true,
-// // bind: { placeholder: '请输入子订单号', rules: [{ type: 'number', message: '请输入整数', trigger: 'blur', transform: val => Number(val) }] }
-// // },
-// // {
-// // label: "配方",
-// // prop: "bomId",
-// // select: [],
-// // fn: () => this.$http.get('/pms/bom/page', { params: { key: '', limit: 999, page: 1 } }),
-// // bind: { placeholder: "请选择配方" },
-// // },
-// // {
-// // label: '砖型',
-// // prop: 'shapeId',
-// // select: [],
-// // fn: () => this.$http.get('/pms/shape/page', { params: { key: '', limit: 999, page: 1 } }),
-// // bind: { placeholder: "请选择砖型" },
-// // },
-// // {
-// // label: '工艺',
-// // prop: 'techId',
-// // select: [],
-// // fn: () => this.$http.post('/pms/equipmentTech/pageView', { key: '', shape: '', wsId: 0, limit: 999, page: 1 }),
-// // bind: { placeholder: "请选择砖型" },
-// // },
-// // {
-// // label: '订单状态',
-// // prop: 'types', // 0等待, 1确认, 2生产,3暂停, 4结束, 5接受, 6拒绝
-// // select: [
-// // {label: '等待', value: 0},
-// // {label: '确认', value: 1},
-// // {label: '生产', value: 2},
-// // {label: '暂停', value: 3},
-// // {label: '结束', value: 4},
-// // {label: '接受', value: 5},
-// // {label: '拒绝', value: 6},
-// // ],
-// // // fn: () => this.$http.post('/pms/equipmentTech/pageView', { key: '', shape: '', wsId: 0, limit: 999, page: 1 }),
-// // bind: { placeholder: "请选择订单状态" },
-// // },
-// {
-// button: {
-// type: "primary",
-// name: "查询",
-// },
-// },
-// {
-// button: {
-// type: "primary",
-// name: "新增",
-// permission: "",
-// },
-// bind: {
-// plain: true,
-// },
-// },
-// ];
+}
\ No newline at end of file
diff --git a/src/views/modules/pms/product/config.js b/src/views/modules/pms/product/config.js
index 9fd211b..1aea499 100644
--- a/src/views/modules/pms/product/config.js
+++ b/src/views/modules/pms/product/config.js
@@ -14,7 +14,13 @@ export default function () {
{ prop: "weight", label: "重量", filter: (val) => (val ? val + " kg" : "-") },
{ prop: "processTime", label: "产线完成单位产品用时", width: 200, filter: (val) => val + " s" },
{ prop: "remark", label: "备注" },
- { prop: "description", label: "附件信息", subcomponent: TableTextComponent, buttonContent: "查看附件", actionName: 'view-attachment' },
+ {
+ prop: "description",
+ label: "附件信息",
+ subcomponent: TableTextComponent,
+ buttonContent: "查看附件",
+ actionName: "view-attachment",
+ },
{ prop: "createTime", label: "添加时间", filter: timeFilter },
{
prop: "operations",
@@ -22,7 +28,16 @@ export default function () {
fixed: "right",
width: 90,
subcomponent: TableOperaionComponent,
- options: [{ name: "edit", label: "编辑", icon: "edit-outline" }, { name: "delete", icon: "delete", label: "删除", emitFull: true, icon: 'delete', label: '删除', emitFull: true, permission: "pms:product:delete" }],
+ options: [
+ { name: "edit", label: "编辑", icon: "edit-outline" },
+ {
+ name: "delete",
+ icon: "delete",
+ label: "删除",
+ emitFull: true,
+ permission: "pms:product:delete",
+ },
+ ],
},
];
@@ -90,7 +105,10 @@ export default function () {
select: true,
label: "物料类型",
prop: "typeDictValue",
- options: "product_type" in dictList ? dictList["product_type"].map((item) => ({ value: item.dictValue, label: item.dictLabel })) : [],
+ options:
+ "product_type" in dictList
+ ? dictList["product_type"].map((item) => ({ value: item.dictValue, label: item.dictLabel }))
+ : [],
elparams: { placeholder: "选择一个物料类型" },
},
],
@@ -100,7 +118,10 @@ export default function () {
select: true,
label: "单位",
prop: "unitDictValue",
- options: "unit" in dictList ? dictList["unit"].map((item) => ({ value: item.dictValue, label: item.dictLabel })) : [],
+ options:
+ "unit" in dictList
+ ? dictList["unit"].map((item) => ({ value: item.dictValue, label: item.dictLabel }))
+ : [],
elparams: { placeholder: "选择单位" },
},
{
@@ -198,6 +219,8 @@ export default function () {
page: "/pms/product/page",
subase: "/pms/productArrt",
subpage: "/pms/productArrt/page",
+ importUrl: "/pms/product/import",
+ templateUrl: '/importTemplates/materialImport.xlsx'
},
};
}
diff --git a/vue.config.js b/vue.config.js
index 152bbc8..ed3798d 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -30,9 +30,9 @@ module.exports = {
'/pms-am/ureport/preview': {
target: 'http://192.168.1.62:8080/' // TODO: 线上发布时需修改此处
},
- '/pms/order/importExcelOrder': {
- target: 'http://192.168.1.21:8080/' // TODO: 线上发布时需修改此处
- }
+ // '/pms/order/importExcelOrder': {
+ // target: 'http://192.168.1.21:8080/' // TODO: 线上发布时需修改此处
+ // }
}
}
}