From 740c606022e8370d4576452e73ffbae36c8b303d Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期日, 24 八月 2025 13:49:47 +0800
Subject: [PATCH] 导出工控网不勾选禁用按钮
---
src/views/basesetting/produceplan.vue | 203 +++++++++++++++++++++++++++++++++++---------------
1 files changed, 143 insertions(+), 60 deletions(-)
diff --git a/src/views/basesetting/produceplan.vue b/src/views/basesetting/produceplan.vue
index 9562c22..940dedd 100644
--- a/src/views/basesetting/produceplan.vue
+++ b/src/views/basesetting/produceplan.vue
@@ -28,9 +28,17 @@
</avue-crud>
</el-tab-pane>
<el-tab-pane label="鍕ゅ摬鍒嗗伐琛�" name="qinzhe">
+
<avue-crud :option="optionQz" :table-loading="loadingQz" :data="dataQz" v-model:page="pageQz"
@search-change="searchChangeQz" @search-reset="searchResetQz" @current-change="currentChangeQz"
- @size-change="sizeChangeQz" @refresh-change="refreshChangeQz" @on-load="onLoadQz">
+ @size-change="sizeChangeQz" @refresh-change="refreshChangeQz" @on-load="onLoadQz" @row-del="rowDelQz" @row-update="rowUpdateQz">
+
+ <template #menu-left>
+ <el-button type="primary" plain @click="importActionQz">瀵煎叆
+ </el-button>
+ <el-button type="primary" plain @click="downTemplateActionQz">涓嬭浇瀵煎叆妯℃澘
+ </el-button>
+ </template>
</avue-crud>
</el-tab-pane>
</el-tabs>
@@ -45,12 +53,17 @@
-->
</avue-form>
</el-dialog>
+ <el-dialog title="" append-to-body v-model="excelBoxQz" width="555px">
+ <avue-form :option="excelOptionQz" v-model="excelForm" :upload-after="uploadAfterQz">
+
+ </avue-form>
+ </el-dialog>
</basic-container>
</template>
<script>
import { getList, remove,save,update } from '@/api/basesetting/produceplan';
-import { getListQz } from '@/api/basesetting/qinzhefgb';
+import { getListQz, removeQz,saveQz,updateQz } from '@/api/basesetting/qinzhefgb';
import { mapGetters } from 'vuex';
import { exportBlob } from '@/api/common';
import { getToken } from '@/utils/auth';
@@ -83,11 +96,33 @@
},
],
},
+ excelOptionQz: {
+ submitBtn: false,
+ emptyBtn: false,
+ column: [
+ {
+ label: '鏂囦欢瀵煎叆',
+ prop: 'file',
+ type: 'upload',
+ drag: true,
+ loadText: '瀵煎叆涓紝璇风◢鍚�',
+ span: 24,
+ propsHttp: {
+ res: 'data',
+ },
+ data: {
+ },
+ tip: '',
+ action: '/blade-mdm/producedivision/import-qinzhe',
+ },
+ ],
+ },
excelForm: {
fileType: 'program',
excelFile: [],
},
excelBox: false,
+ excelBoxQz: false,
option: {
// Define your Avue CRUD options here
addBtn: true,
@@ -95,29 +130,15 @@
delBtn: true,
columnBtn: false,
tip: false,
- // simplePage: true,
searchShow: true,
searchMenuSpan: 6,
- // tree: true,
+ searchEnter:true,
border: true,
index: true,
- // selection: true,
- // viewBtn: true,
menuWidth: 320,
dialogWidth: 500,
dialogClickModal: false,
column: [
- // {
- // label: '绋嬪簭鍚嶇О',
- // prop: 'programName',
- // type: 'input',
- // search: false,
- // searchRange: true,
- // searchSpan: 8,
- // hide: true,
- // span: 24,
- // rules: [{ required: true, message: '璇疯緭鍏ョ▼搴忓悕绉�', trigger: 'blur' }],
- // },
{
label: '浜哄憳鍚嶇О',
prop: 'name',
@@ -128,33 +149,7 @@
hide: true,
display: false,
},
- // {
- // label: '搴忓彿',
- // prop: 'index',
- // type: 'index',
- // },
- {
- label: '鍥惧彿',
- prop: 'drawingNo',
- type: 'input',
- display: true,
- span: 24,
- rules: [{ required: true, message: '璇疯緭鍏ュ浘鍙�', trigger: 'blur' }],
- },
- {
- label: '涓撲笟缁勯暱',
- prop: 'teamLeaderId',
- type: 'select',
- span: 24,
- display: true,
- filterable:true,
- dicUrl: `/blade-mdm/flow/flow-user-list?deptId=0`,
- props: {
- label: 'name',
- value: 'id',
- },
- rules: [{ required: true, message: '璇疯緭鍏ヤ笓涓氱粍闀�', trigger: 'blur' }],
- },
+
{
label: '缂栧埗锛堝伐鑹哄憳)',
label: '缂栧埗',
@@ -184,6 +179,20 @@
value: 'id',
},
rules: [{ required: true, message: '璇疯緭鍏ユ牎瀵癸紙宸ヨ壓鍛�)', trigger: 'blur' }],
+ },
+ {
+ label: '涓撲笟缁勯暱',
+ prop: 'teamLeaderId',
+ type: 'select',
+ span: 24,
+ display: true,
+ filterable:true,
+ dicUrl: `/blade-mdm/flow/flow-user-list?deptId=0`,
+ props: {
+ label: 'name',
+ value: 'id',
+ },
+ rules: [{ required: true, message: '璇疯緭鍏ヤ笓涓氱粍闀�', trigger: 'blur' }],
},
{
label: '瀹℃牳(楂樺笀)',
@@ -225,23 +234,29 @@
},
queryQz: {},
optionQz: {
- // Define your Avue CRUD options here
addBtn: false,
- editBtn: false,
- delBtn: false,
+ editBtn: true,
+ delBtn: true,
columnBtn: false,
tip: false,
- // simplePage: true,
searchShow: true,
searchMenuSpan: 6,
- // tree: true,
+ searchEnter:true,
border: true,
index: true,
- menu: false,
menuWidth: 320,
dialogWidth: 500,
dialogClickModal: false,
column: [
+ {
+ label: '闆剁粍浠跺彿',
+ prop: 'ljh',
+ type: 'input',
+ search: true,
+ display: true,
+ disabled:true,
+ span: 24,
+ },
{
label: '浜у搧鍙�',
prop: 'cph',
@@ -249,21 +264,30 @@
display: true,
span: 24,
},
- {
- label: '闆剁粍浠跺彿',
- prop: 'ljh',
- type: 'input',
- search: true,
- display: true,
- span: 24,
- },
-
+
{
label: '涓荤宸ヨ壓',
prop: 'zggy',
type: 'input',
+ search: true,
display: true,
span: 24
+ },
+ {
+ label: '鏁版嵁鏉ユ簮',
+ prop: 'source',
+ type: 'input',
+ search: false,
+ display: false,
+ span: 24,
+ render: ({ row}) => {
+ console.log('val',row)
+ if(row.source == 'MDM'){
+ return "MDM"
+ }else{
+ return "鍕ゅ摬"
+ }
+ }
}
],
},
@@ -315,6 +339,11 @@
// this.$message.success('瀵煎叆鍔熻兘灏氭湭瀹炵幇');
this.excelBox = true;
},
+ importActionQz() {
+ // Logic for importing data
+ // this.$message.success('瀵煎叆鍔熻兘灏氭湭瀹炵幇');
+ this.excelBoxQz = true;
+ },
uploadAfter(res, done, loading, column) {
//window.console.log(column);
//console.log('res',res)
@@ -330,12 +359,29 @@
}
},
+ uploadAfterQz(res, done, loading, column) {
+ //window.console.log(column);
+ this.$message.success('瀵煎叆瀹屾垚');
+ this.excelBoxQz = false;
+
+ this.onLoadQz(this.pageQz);
+
+ },
downTemplateAction() {
NProgress.start();
exportBlob(
`/blade-mdm/producedivision/download-template`
).then(res => {
downloadXls(res.data, `涓诲埗鍒嗗伐琛ㄥ鍏ユā鐗�.xlsx`);
+ NProgress.done();
+ });
+ },
+ downTemplateActionQz() {
+ NProgress.start();
+ exportBlob(
+ `/blade-mdm/producedivision/download-template-qz`
+ ).then(res => {
+ downloadXls(res.data, `鍕ゅ摬鍒嗗伐琛ㄥ鍏ユā鐗�.xlsx`);
NProgress.done();
});
},
@@ -356,6 +402,23 @@
});
});
},
+ rowDelQz(row) {
+ this.$confirm('纭畾灏嗛�夋嫨鏁版嵁鍒犻櫎?', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning',
+ })
+ .then(() => {
+ return removeQz({ljhs: [row.ljh].toString()});
+ })
+ .then(() => {
+ this.onLoadQz(this.pageQz);
+ this.$message({
+ type: 'success',
+ message: '鎿嶄綔鎴愬姛!',
+ });
+ });
+ },
rowUpdate (row, index, done, loading) {
console.log('rowUpdate', row);
@@ -370,7 +433,27 @@
},
error => {
window.console.log(error);
- loading();
+ //loading();
+ loadingZq();
+ }
+ );
+ },
+ rowUpdateQz (row, index, done, loading) {
+ console.log('rowUpdateQz', row);
+
+ updateQz(row).then(
+ () => {
+ this.onLoadQz(this.pageQz);
+ this.$message({
+ type: 'success',
+ message: '鎿嶄綔鎴愬姛!',
+ });
+ done();
+ },
+ error => {
+ window.console.log(error);
+ //loading();
+ loadingZq();
}
);
},
--
Gitblit v1.9.3