From 001ad94951493fa4ae875ce294c818040c23ecf9 Mon Sep 17 00:00:00 2001
From: gaoshp <291585735@qq.com>
Date: 星期一, 16 六月 2025 23:15:25 +0800
Subject: [PATCH] Merge branch 'master' of http://www.beijingsoft.cn:9090/r/mdmweb
---
src/views/flowmgr/backImport.vue | 147 ++++++++++++++++++++++++
src/views/basesetting/machine.vue | 172 ++++++++++++++++++++++++----
2 files changed, 292 insertions(+), 27 deletions(-)
diff --git a/src/views/basesetting/machine.vue b/src/views/basesetting/machine.vue
index 756b75a..72c6dcd 100644
--- a/src/views/basesetting/machine.vue
+++ b/src/views/basesetting/machine.vue
@@ -16,13 +16,14 @@
@on-load="onLoad"
>
<template #menu-left>
- <el-button type="primary" size="default" icon="el-icon-circle-plus" plain @click="handleView">瀵煎嚭</el-button>
+ <el-button type="primary" size="default" icon="el-icon-circle-plus" plain @click="handleExport">瀵煎嚭</el-button>
<el-button type="primary" size="default" icon="el-icon-circle-plus" plain @click="handleView">瀵煎叆</el-button>
+ <!-- <el-button type="primary" size="default" icon="el-icon-circle-plus" plain @click="handleAdd">鏂板</el-button> -->
</template>
<template #menu="scope">
<el-button type="primary" text size="default" icon="el-icon-upload" @click.stop="handleEdit(scope.row, scope.index)">缂栬緫</el-button>
- <el-button type="primary" text size="default" icon="el-icon-upload" @click.stop="handleView(scope.row, scope.index)">鍒犻櫎</el-button>
- <el-button type="primary" text size="default" icon="el-icon-upload" @click.stop="handleView(scope.row, scope.index)">浜х敓鏈哄簥鍥炰紶鏈烘瀯鏍�</el-button>
+ <el-button type="primary" text size="default" icon="el-icon-upload" @click.stop="handleDel(scope.row, scope.index)">鍒犻櫎</el-button>
+ <el-button type="primary" text size="default" icon="el-icon-upload" @click.stop="handleUp(scope.row, scope.index)">浜х敓鏈哄簥鍥炰紶鏈烘瀯鏍�</el-button>
</template>
<template #status="{ row }">
@@ -30,17 +31,24 @@
</template>
</avue-crud>
- <el-dialog title="缂栬緫" append-to-body v-model="editBox" width="60%">
- <avue-form ref="editFormModal" :option="editFormModal" v-model="form" @submit="formSubmit" />
+ <el-dialog :title="machineTitle" append-to-body v-model="editBox" width="60%">
+ <avue-form ref="editFormModal1" :option="editFormModal" v-model="editForm" @submit="formSubmit" @resetForm="resetForm"/>
</el-dialog>
</basic-container>
</template>
<script>
+import { exportBlob } from '@/api/common';
+import { getToken } from '@/utils/auth';
+import NProgress from 'nprogress';
+import { downloadXls } from '@/utils/util';
+import 'nprogress/nprogress.css';
export default {
data() {
var that = this;
return {
+ machineTitle: "鏂板",
+ isAdd: true,
editBox: false,
search: {
keyword: "",
@@ -52,6 +60,7 @@
current: 1,
total: 0,
},
+ editForm: {},
option: {
index: true,
addBtn: false,
@@ -122,17 +131,17 @@
},
{
label: '鏈哄簥鍨嬪彿',
- prop: '',
+ prop: 'name',
type: 'input',
span: 12,
dataType: 'string',
},
{
label: '鏈哄簥绫诲瀷',
- prop: '',
+ prop: 'machineSpec',
type: 'select',
span: 12,
- dicUrl: '/blade-system/dict-biz/dictionary?code=machine_group',
+ dicUrl: '/blade-system/dict-biz/dictionary?code=machine_spec',
props: {
label: 'dictValue',
value: 'dictKey',
@@ -140,7 +149,7 @@
},
{
label: '鎵�灞炴満搴婄粍',
- prop: '',
+ prop: 'machineGroupCode',
type: 'select',
span: 12,
dicUrl: '/blade-system/dict-biz/dictionary?code=machine_group',
@@ -151,39 +160,39 @@
},
{
label: '鎿嶄綔鍛�',
- prop: '',
+ prop: 'operator',
type: 'input',
span: 12,
dataType: 'string',
},
{
label: '鎵�灞炵粍缁�',
- prop: '',
- type: 'select',
+ prop: 'ownerDept',
+ type: 'tree',
span: 12,
- dicUrl: '/blade-system/dict-biz/dictionary?code=machine_group',
props: {
- label: 'dictValue',
- value: 'dictKey',
- }
+ label: 'deptName',
+ value: 'id'
+ },
+ dicUrl: `/blade-system/dept/lazy-list`
},
{
label: '鐢熶骇鍟�',
- prop: '',
+ prop: 'manufacturer',
type: 'input',
span: 12,
dataType: 'string',
},
{
label: '杞鏃堕棿锛堝皬鏃讹級',
- prop: '',
+ prop: 'pollingHours',
type: 'input',
span: 12,
dataType: 'string',
},
{
label: '绯荤粺鎺у埗',
- prop: '',
+ prop: 'controlSystem',
type: 'select',
span: 12,
dicUrl: '/blade-system/dict-biz/dictionary?code=machine_control_system',
@@ -194,7 +203,7 @@
},
{
label: '鐘舵��',
- prop: 'checkbox',
+ prop: 'status',
type: 'checkbox',
span: 12,
dicData: [{
@@ -204,21 +213,21 @@
},
{
label: '绋嬪簭涓嬪彂鐩綍',
- prop: '',
+ prop: 'progSendDir',
type: 'input',
span: 12,
dataType: 'string',
},
{
label: '绋嬪簭鍥炰紶鐩綍',
- prop: '',
+ prop: 'progReceiveDir',
type: 'input',
span: 12,
dataType: 'string',
},
{
label: '澶囨敞',
- prop: '',
+ prop: 'remark',
type: 'textarea',
span: 24,
dataType: 'string',
@@ -229,11 +238,119 @@
};
},
methods: {
- handleEdit() {
+ handleAdd() {
+ this.machineTitle = "鏂板";
+ this.isAdd = true;
this.editBox = true;
+ this.$refs.editFormModal1.resetForm();
},
- formSubmit() {
-
+ handleEdit(row,index) {
+ this.machineTitle = "缂栬緫";
+ this.isAdd = false;
+ axios({
+ url: '/blade-mdm/machine/detail',
+ method: 'get',
+ params: {id: row.id},
+ }).then(
+ res => {
+ res.data.data.status = [res.data.data.status];
+ this.editForm = res.data.data;
+ this.editBox = true;
+ },
+ error => {
+ this.loading = false;
+ }
+ );
+ },
+ handleDel(row,index) {
+ this.loading = true;
+ axios({
+ url: '/blade-mdm/machine/remove',
+ method: 'post',
+ params: {ids: row.id},
+ }).then(
+ res => {
+ this.loading = false;
+ this.$message({
+ type: 'success',
+ message: '鎿嶄綔鎴愬姛!',
+ });
+ this.onLoad();
+ done();
+ },
+ error => {
+ this.loading = false;
+ }
+ );
+ },
+ handleUp(row,index) {
+ this.loading = true;
+ axios({
+ url: '/blade-mdm/machine/gen-fileback-dirs',
+ method: 'post',
+ params: {id: row.id},
+ }).then(
+ res => {
+ this.loading = false;
+ this.$message({
+ type: 'success',
+ message: '鎿嶄綔鎴愬姛!',
+ });
+ this.onLoad();
+ done();
+ },
+ error => {
+ this.loading = false;
+ }
+ );
+ },
+ handleExport() {
+ this.$confirm('鏄惁瀵煎嚭?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning',
+ }).then(() => {
+ NProgress.start();
+ exportBlob(
+ `/blade-mdm/machine/export?${this.website.tokenHeader}=${getToken()}`
+ ).then(res => {
+ downloadXls(res.data, `瀵煎嚭鏈哄簥${this.$dayjs().format('YYYY-MM-DD HH:mm:ss')}.xlsx`);
+ NProgress.done();
+ });
+ });
+ },
+ formSubmit(params, done) {
+ var obj = {...params};
+ if(params.status.length == 0) {
+ obj.status = "0";
+ }else {
+ obj.status = "1";
+ }
+ if(this.isAdd) { //鏂板
+ var url = '/blade-mdm/machine/save';
+ }else {
+ var url = '/blade-mdm/machine/update';
+ }
+ this.loading = true;
+ axios({
+ url: url,
+ method: 'post',
+ data: obj,
+ }).then(
+ res => {
+ this.loading = false;
+ this.$message({
+ type: 'success',
+ message: '鎿嶄綔鎴愬姛!',
+ });
+ this.editBox = false;
+ this.onLoad();
+ done();
+ },
+ error => {
+
+ }
+ );
},
handleView() {
@@ -255,7 +372,7 @@
refreshChange() {
},
- onLoad(page, params = {}) {
+ onLoad() {
this.loading = true;
var obj = {
keyword: this.search.keyword,
@@ -278,6 +395,7 @@
}
);
+
}
},
};
diff --git a/src/views/flowmgr/backImport.vue b/src/views/flowmgr/backImport.vue
new file mode 100644
index 0000000..827fcc4
--- /dev/null
+++ b/src/views/flowmgr/backImport.vue
@@ -0,0 +1,147 @@
+<template>
+ <basic-container>
+ <avue-crud
+ :addBtn="false"
+ :option="option"
+ :table-loading="loading"
+ :data="data"
+ ref="crud"
+ v-model:search="search"
+ v-model:page="mypage"
+ @search-change="searchChange"
+ @search-reset="searchReset"
+ @current-change="currentChange"
+ @size-change="sizeChange"
+ @refresh-change="refreshChange"
+ @on-load="onLoad"
+ >
+ <template #menu-left>
+ <el-button type="primary" size="default" icon="el-icon-circle-plus" plain @click="handleEdit">瀵煎叆</el-button>
+ <el-button type="primary" size="default" icon="el-icon-circle-plus" plain @click="handleEdit">鍏ュ簱</el-button>
+ </template>
+ </avue-crud>
+ </basic-container>
+</template>
+
+<script>
+export default {
+ data() {
+ return {
+ search: {},
+ loading: true,
+ mypage: {
+ size: 10,
+ current: 1,
+ total: 0,
+ },
+ option: {
+ addBtn: false,
+ editBtn: false,
+ delBtn: false,
+ labelWidth: 120,
+ emptyBtn: false,
+ searchSpan: 8,
+ selection: true,
+ menu: false,
+ column: [
+ {
+ label: '鏂囦欢璺緞',
+ type: 'input',
+ prop: 'keyword',
+ search: true,
+ hide: true
+ },
+ {
+ label: '浠诲姟缂栧彿',
+ prop: ''
+ },
+ {
+ label: '绋嬪簭鍚嶇О',
+ prop: '',
+ },
+ {
+ label: '鏂囦欢鍒拌揪鏃堕棿',
+ prop: '',
+ },
+ {
+ label: '鏂囦欢鏁版嵁搴撶紪鍙�',
+ prop: '',
+ },
+ {
+ label: '澶勭悊鐘舵��',
+ prop: '',
+ },
+ {
+ label: '澶勭悊鏂瑰紡',
+ prop: ''
+ },
+ {
+ label: '澶勭悊鏃堕棿',
+ prop: ''
+ },
+ {
+ label: '澶勭悊浜�',
+ prop: ''
+ },
+ {
+ label: 'MD5鍊�',
+ prop: ''
+ }
+ ],
+ },
+ data: [],
+ };
+ },
+ methods: {
+ handleEdit(row,index) {
+
+ },
+ searchReset() {
+ //this.onLoad(this.mypage);
+ },
+ searchChange(params, done) {
+ this.mypage.current = 1;
+ this.onLoad();
+ done();
+ },
+ currentChange(current) {
+ this.mypage.current = current;
+ },
+ sizeChange(size) {
+ this.mypage.size = size;
+ },
+ refreshChange() {
+
+ },
+ onLoad() {
+ this.loading = true;
+ var obj = {
+ keyword: this.search.keyword,
+ machineSpec: "",
+ current: this.mypage.current,
+ size: this.mypage.size,
+ }
+ axios({
+ url: '/blade-mdm/machineback/file/page',
+ method: 'get',
+ params: obj,
+ }).then(
+ res => {
+ const data = res.data.data;
+ this.mypage.total = data.total;
+ this.data = data.records;
+ this.loading = false;
+ },
+ error => {
+
+ }
+ );
+
+ }
+ },
+};
+</script>
+
+<style lang="scss">
+
+</style>
\ No newline at end of file
--
Gitblit v1.9.3