From f1b4ff31d9cb91fcda228a9781ddb8b3c792f8ba Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期六, 16 八月 2025 00:57:43 +0800
Subject: [PATCH] 审批按钮调整
---
src/views/basesetting/produceplan.vue | 249 +++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 209 insertions(+), 40 deletions(-)
diff --git a/src/views/basesetting/produceplan.vue b/src/views/basesetting/produceplan.vue
index e6dd4b9..f610200 100644
--- a/src/views/basesetting/produceplan.vue
+++ b/src/views/basesetting/produceplan.vue
@@ -1,37 +1,93 @@
<!--
* @Date: 2025-06-17 11:44:52
* @LastEditors: gaoshp
- * @LastEditTime: 2025-07-08 20:06:11
+ * @LastEditTime: 2025-08-13 22:30:53
* @FilePath: /mdmweb/src/views/basesetting/produceplan.vue
-->
<template>
<basic-container>
- <avue-crud :option="option" :table-loading="loading" :data="data" v-model:page="page" v-model="form" ref="crud"
- @search-change="searchChange" @search-reset="searchReset" @current-change="currentChange"
- @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad" @row-del="rowDel"
- @row-save="save"
- @row-update="rowUpdate">
- <template #menu-left>
- <el-button type="primary" plain @click="importAction">瀵煎叆
- </el-button>
- </template>
- <!-- <template #menu="scope">
- <el-button type="primary" text size="default" v-if="permission.flow_model_update"
- @click.stop="handleAction(scope.row, scope.index)">瀹℃壒
- </el-button>
- </template> -->
- </avue-crud>
+ <el-tabs v-model="activeName" type="card" class="demo-tabs" @tab-click="tabsClick">
+ <el-tab-pane label="涓诲埗鍒嗗伐琛�" name="zhuzhi">
+ <avue-crud :option="option" :table-loading="loading" :data="data" v-model:page="page" v-model="form" ref="crud"
+ @search-change="searchChange" @search-reset="searchReset" @current-change="currentChange"
+ @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad" @row-del="rowDel"
+ @row-save="save"
+ @row-update="rowUpdate">
+
+ <template #menu-left>
+ <el-button type="primary" plain @click="importAction">瀵煎叆
+ </el-button>
+ <el-button type="primary" plain @click="downTemplateAction">涓嬭浇瀵煎叆妯℃澘
+ </el-button>
+ </template>
+ <!-- <template #menu="scope">
+ <el-button type="primary" text size="default" v-if="permission.flow_model_update"
+ @click.stop="handleAction(scope.row, scope.index)">瀹℃壒
+ </el-button>
+ </template> -->
+ </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">
+ </avue-crud>
+ </el-tab-pane>
+ </el-tabs>
+ <el-dialog title="" append-to-body v-model="excelBox" width="555px">
+ <avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter">
+ <!--
+ <template #excelTemplate>
+ <el-button type="primary" @click="handleTemplate">
+ 纭畾
+ </el-button>
+ </template>
+ -->
+ </avue-form>
+ </el-dialog>
</basic-container>
</template>
<script>
import { getList, remove,save,update } from '@/api/basesetting/produceplan';
+import { getListQz } from '@/api/basesetting/qinzhefgb';
import { mapGetters } from 'vuex';
+import { exportBlob } from '@/api/common';
+import { getToken } from '@/utils/auth';
+import NProgress from 'nprogress';
+import { downloadXls } from '@/utils/util';
export default {
name: 'ProducePlan',
data() {
return {
+ activeName: "zhuzhi",
// Define your data properties here
+ excelOption: {
+ 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-division',
+ },
+ ],
+ },
+ excelForm: {
+ fileType: 'program',
+ excelFile: [],
+ },
+ excelBox: false,
option: {
// Define your Avue CRUD options here
addBtn: true,
@@ -72,25 +128,13 @@
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',
@@ -104,6 +148,7 @@
prop: 'programmerId',
type: 'select',
display: true,
+ filterable:true,
span: 24,
dicUrl: `/blade-mdm/flow/flow-user-list?deptId=0`,
props: {
@@ -118,6 +163,7 @@
prop: 'checkerId',
type: 'select',
display: true,
+ filterable:true,
span: 24,
dicUrl: `/blade-mdm/flow/flow-user-list?deptId=0`,
props: {
@@ -131,6 +177,7 @@
label: '瀹℃牳',
prop: 'seniorId',
type: 'select',
+ filterable:true,
display: true,
span: 24,
dicUrl: `/blade-mdm/flow/flow-user-list?deptId=0`,
@@ -154,10 +201,67 @@
},
form: {}, // This will hold the form data
query: {}, // This will hold the search query
+
+ //鍕ゅ摬椤甸潰鏁版嵁
+ dataQz:[],
+ loadingQz:false,
+ pageQz: {
+ pageSize: 10,
+ currentPage: 1,
+ total: 0,
+ },
+ queryQz: {},
+ optionQz: {
+ // Define your Avue CRUD options here
+ addBtn: false,
+ editBtn: false,
+ delBtn: false,
+ columnBtn: false,
+ tip: false,
+ // simplePage: true,
+ searchShow: true,
+ searchMenuSpan: 6,
+ // tree: true,
+ border: true,
+ index: true,
+ menu: false,
+ menuWidth: 320,
+ dialogWidth: 500,
+ dialogClickModal: false,
+ column: [
+ {
+ label: '浜у搧鍙�',
+ prop: 'cph',
+ type: 'input',
+ display: true,
+ span: 24,
+ },
+ {
+ label: '闆剁粍浠跺彿',
+ prop: 'ljh',
+ type: 'input',
+ search: true,
+ display: true,
+ span: 24,
+ },
+
+ {
+ label: '涓荤宸ヨ壓',
+ prop: 'zggy',
+ type: 'input',
+ display: true,
+ span: 24
+ }
+ ],
+ },
};
},
methods: {
// Define your methods here
+ tabsClick(tab,event) {
+ //console.log('tab',tab)
+ this.onLoad(this.page, this.query);
+ },
searchChange(params, done) {
this.query = params;
this.page.currentPage = 1;
@@ -195,7 +299,32 @@
},
importAction() {
// Logic for importing data
- this.$message.success('瀵煎叆鍔熻兘灏氭湭瀹炵幇');
+ // this.$message.success('瀵煎叆鍔熻兘灏氭湭瀹炵幇');
+ this.excelBox = true;
+ },
+ uploadAfter(res, done, loading, column) {
+ //window.console.log(column);
+ //console.log('res',res)
+ if(res.success>0){
+ //鏈夋垚鍔熺殑锛屽叧闂璇濇
+ this.excelBox = false;
+ this.$message.success(res.message);
+ this.onLoad(this.page);
+ //done();
+ }else{
+ //0鎴愬姛鐨勶紝浠呮彁绀�
+ this.$message.success(res.message);
+ }
+
+ },
+ downTemplateAction() {
+ NProgress.start();
+ exportBlob(
+ `/blade-mdm/producedivision/download-template`
+ ).then(res => {
+ downloadXls(res.data, `涓诲埗鍒嗗伐琛ㄥ鍏ユā鐗�.xlsx`);
+ NProgress.done();
+ });
},
rowDel(row) {
this.$confirm('纭畾灏嗛�夋嫨鏁版嵁鍒犻櫎?', {
@@ -235,20 +364,60 @@
save (row, done, loading) {
console.log('save', row);
save(row).then(
- () => {
- this.onLoad(this.page);
- this.$message({
- type: 'success',
- message: '鎿嶄綔鎴愬姛!',
- });
- done();
+ (res) => {
+ if(res.data.code !== 200) {
+ this.$message.error(res.data.msg);
+ loading()
+ //done();//鍏抽棴绐楀彛
+ return;
+ }
+ this.onLoad(this.page);
+ this.$message({
+ type: 'success',
+ message: '鎿嶄綔鎴愬姛!',
+ });
+ done();
},
error => {
- loading();
- window.console.log(error);
+
+ loading();
+ window.console.log(error);
}
);
- }
+ },
+ sizeChangeQz() {
+ this.pageQz.pageSize = pageSize;
+ },
+ searchChangeQz(params, done) {
+ this.queryQz = params;
+ this.pageQz.currentPage = 1;
+ this.onLoadQz(this.pageQz, params);
+ done();
+ },
+ searchResetQz() {
+ this.queryQz = {};
+ this.onLoadQz(this.pageQz);
+ },
+ currentChangeQz() {
+ this.pageQz.currentPage = currentPage;
+ },
+ onLoadQz(page, params = {}) {
+ const query = {
+ ...this.queryQz,
+ // category: params.category ? flowCategory(params.category) : null,
+ mode: this.mode,
+ };
+ this.loadingQz = true;
+ getListQz(page.currentPage, page.pageSize, Object.assign(params, query)).then(res => {
+ const data = res.data.data;
+ this.pageQz.total = data.total;
+ this.dataQz = data.records;
+ this.loadingQz = false;
+ });
+ },
+ refreshChangeQz() {
+ this.onLoadQz(this.pageQz, this.queryQz);
+ },
},
mounted() {
// Code to run when the component is mounted
--
Gitblit v1.9.3