|
@@ -1,76 +1,107 @@
|
|
|
<template>
|
|
|
<div class="requisition" v-loading="failLoad">
|
|
|
<div class="applyList" v-if="isList">
|
|
|
-
|
|
|
- <el-card>
|
|
|
-
|
|
|
- <el-super-search
|
|
|
- v-model="params"
|
|
|
- :size="size"
|
|
|
- :dict="dict"
|
|
|
- :columns="SearchColumns"
|
|
|
- @reset="reset"
|
|
|
- @submit="getList"
|
|
|
- ></el-super-search>
|
|
|
-
|
|
|
- <el-row :gutter="10" class="mb10" type="flex" justify="end" style="margin-top: 15px;">
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-button type="primary" :size="size" plain @click="newAdd">新增</el-button>
|
|
|
- </el-col>
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-button :size="size" :disabled="checkedList.length != 1" @click="handleCopy">复制</el-button>
|
|
|
- </el-col>
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-button type="primary" :size="size" plain
|
|
|
- @click="download('/system/apply/material/download',{},'申请单模板.xlsx')">模板下载
|
|
|
- </el-button>
|
|
|
- </el-col>
|
|
|
- <el-col :span="1.5">
|
|
|
-
|
|
|
- <el-button-group >
|
|
|
- <el-button :size="size" @click="handleImport">批量导入</el-button>
|
|
|
- <!-- <el-button
|
|
|
+ <el-card
|
|
|
+ :body-style="{
|
|
|
+ height: '100%',
|
|
|
+ padding: 0,
|
|
|
+ display: 'flex',
|
|
|
+ 'flex-direction': 'column',
|
|
|
+ }"
|
|
|
+ >
|
|
|
+ <el-super-search
|
|
|
+ v-model="params"
|
|
|
+ :size="size"
|
|
|
+ :dict="dict"
|
|
|
+ :columns="SearchColumns"
|
|
|
+ @reset="reset"
|
|
|
+ @submit="getList"
|
|
|
+ ></el-super-search>
|
|
|
+
|
|
|
+ <el-row
|
|
|
+ :gutter="10"
|
|
|
+ class="mb10"
|
|
|
+ type="flex"
|
|
|
+ justify="end"
|
|
|
+ style="margin-top: 15px"
|
|
|
+ >
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button type="primary" :size="size" plain @click="newAdd"
|
|
|
+ >新增</el-button
|
|
|
+ >
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ :size="size"
|
|
|
+ :disabled="checkedList.length != 1"
|
|
|
+ @click="handleCopy"
|
|
|
+ >复制</el-button
|
|
|
+ >
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ :size="size"
|
|
|
+ plain
|
|
|
+ @click="
|
|
|
+ download(
|
|
|
+ '/system/apply/material/download',
|
|
|
+ {},
|
|
|
+ '申请单模板.xlsx'
|
|
|
+ )
|
|
|
+ "
|
|
|
+ >模板下载
|
|
|
+ </el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button-group>
|
|
|
+ <el-button :size="size" @click="handleImport">批量导入</el-button>
|
|
|
+ <!-- <el-button
|
|
|
:size="size"
|
|
|
@click="handleDownload"
|
|
|
v-hasPermi="['system:apply:export']"
|
|
|
>批量导出</el-button> -->
|
|
|
- <el-button :size="size" @click="handleBatchSubmit">批量提交</el-button>
|
|
|
- </el-button-group>
|
|
|
- </el-col>
|
|
|
- <!-- 导入弹窗 -->
|
|
|
- <el-dialog
|
|
|
- title="批量导入"
|
|
|
- :visible.sync="importData.show"
|
|
|
- width="35%"
|
|
|
- center
|
|
|
- :before-close="handlefileDialogColse"
|
|
|
- >
|
|
|
- <div class="mb-import">
|
|
|
- <el-upload
|
|
|
- accept=".xls, .xlsx"
|
|
|
- ref="upload"
|
|
|
- action="#"
|
|
|
- :on-remove="handleFileRemove"
|
|
|
- :file-list="importData.list"
|
|
|
- :auto-upload="false"
|
|
|
- :on-change="handleChangeFile"
|
|
|
- :limit="1"
|
|
|
- style="text-align: center;"
|
|
|
- >
|
|
|
- <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
|
|
|
- <div slot="tip" class="el-upload__tip">只能上传Excel文件</div>
|
|
|
- </el-upload>
|
|
|
-
|
|
|
- </div>
|
|
|
- <span slot="footer">
|
|
|
- <el-button @click="handleImportData('cancal')">取 消</el-button>
|
|
|
- <el-button type="primary" @click="handleImportData('confirm')">确 定</el-button>
|
|
|
- </span>
|
|
|
- </el-dialog>
|
|
|
- </el-row>
|
|
|
-
|
|
|
- <div style="height: 600px;display: flex;">
|
|
|
- <el-super-table
|
|
|
+ <el-button :size="size" @click="handleBatchSubmit"
|
|
|
+ >批量提交</el-button
|
|
|
+ >
|
|
|
+ </el-button-group>
|
|
|
+ </el-col>
|
|
|
+ <!-- 导入弹窗 -->
|
|
|
+ <el-dialog
|
|
|
+ title="批量导入"
|
|
|
+ :visible.sync="importData.show"
|
|
|
+ width="35%"
|
|
|
+ center
|
|
|
+ :before-close="handlefileDialogColse"
|
|
|
+ >
|
|
|
+ <div class="mb-import">
|
|
|
+ <el-upload
|
|
|
+ accept=".xls, .xlsx"
|
|
|
+ ref="upload"
|
|
|
+ action="#"
|
|
|
+ :on-remove="handleFileRemove"
|
|
|
+ :file-list="importData.list"
|
|
|
+ :auto-upload="false"
|
|
|
+ :on-change="handleChangeFile"
|
|
|
+ :limit="1"
|
|
|
+ style="text-align: center"
|
|
|
+ >
|
|
|
+ <el-button slot="trigger" size="small" type="primary"
|
|
|
+ >选取文件</el-button
|
|
|
+ >
|
|
|
+ <div slot="tip" class="el-upload__tip">只能上传Excel文件</div>
|
|
|
+ </el-upload>
|
|
|
+ </div>
|
|
|
+ <span slot="footer">
|
|
|
+ <el-button @click="handleImportData('cancal')">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="handleImportData('confirm')"
|
|
|
+ >确 定</el-button
|
|
|
+ >
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-super-ux-table
|
|
|
v-model="tableList"
|
|
|
:dict="dict"
|
|
|
:columns="TableColumns"
|
|
@@ -80,431 +111,442 @@
|
|
|
checkbox
|
|
|
convenitentOperation
|
|
|
:page="pageStatus"
|
|
|
+ storage-key="MaterialRequisitionSuperTable"
|
|
|
@pagination="getList"
|
|
|
@row-dblclick="check"
|
|
|
@selection-change="handleSelectionChange"
|
|
|
@select="handleSelect"
|
|
|
>
|
|
|
- <el-table-column
|
|
|
+ <ux-table-column
|
|
|
fixed="right"
|
|
|
- label="操作"
|
|
|
+ title="操作"
|
|
|
align="center"
|
|
|
width="180"
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- :size="size"
|
|
|
- @click.stop="check(scope.row)"
|
|
|
- >查看</el-button>
|
|
|
- <el-button
|
|
|
- @click.stop="edit(scope.row)"
|
|
|
- v-if="scope.row.status == 0 || scope.row.status == 3"
|
|
|
+ <el-button type="text" :size="size" @click.stop="check(scope.row)"
|
|
|
+ >查看</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ @click.stop="edit(scope.row)"
|
|
|
+ v-if="scope.row.status == 0 || scope.row.status == 3"
|
|
|
type="text"
|
|
|
:size="size"
|
|
|
- >编辑</el-button>
|
|
|
- <el-button
|
|
|
- @click.stop="jumpFlow(scope.row)"
|
|
|
- v-if="scope.row.oaId && scope.row.oaId !=''"
|
|
|
+ >编辑</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ @click.stop="jumpFlow(scope.row)"
|
|
|
+ v-if="scope.row.oaId && scope.row.oaId != ''"
|
|
|
type="text"
|
|
|
:size="size"
|
|
|
- >流程跳转</el-button>
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
+ >流程跳转</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
:size="size"
|
|
|
@click.stop="deleteRow(scope.row)"
|
|
|
v-if="scope.row.status == 0 || scope.row.status == 3"
|
|
|
- >删除</el-button>
|
|
|
- <el-button
|
|
|
- v-if="scope.row.status == '1'"
|
|
|
- type="text"
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ v-if="scope.row.status == '1'"
|
|
|
+ type="text"
|
|
|
size="mini"
|
|
|
@click.stop="handleBack(scope.row)"
|
|
|
- >流程收回</el-button>
|
|
|
+ >流程收回</el-button
|
|
|
+ >
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
- </el-super-table>
|
|
|
- </div>
|
|
|
-
|
|
|
-
|
|
|
+ </ux-table-column>
|
|
|
+ </el-super-ux-table>
|
|
|
</el-card>
|
|
|
</div>
|
|
|
|
|
|
- <component
|
|
|
- :is="isComponent"
|
|
|
- v-model="isList"
|
|
|
- :pageStu="page"
|
|
|
- :disable="disable"
|
|
|
- :row="rowDetail"
|
|
|
+ <component
|
|
|
+ :is="isComponent"
|
|
|
+ v-model="isList"
|
|
|
+ :pageStu="page"
|
|
|
+ :disable="disable"
|
|
|
+ :row="rowDetail"
|
|
|
@refresh="getList"
|
|
|
- v-if="!isList
|
|
|
- "/>
|
|
|
+ v-if="!isList"
|
|
|
+ />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import addReq from './add.vue';
|
|
|
- import {getReqList, delReq, importData, fileImport,betchSubmit,toOA,oaBack} from '@/api/requisition/basic';
|
|
|
- import {saveAs} from "file-saver";
|
|
|
- import { blobValidate } from "@/utils/ruoyi";
|
|
|
- import { SearchColumns, TableColumns } from './columns';
|
|
|
- import { initDicts } from "@/utils/init.js";
|
|
|
-
|
|
|
-
|
|
|
- export default {
|
|
|
- name: 'requisition',
|
|
|
- dicts:[...initDicts([...SearchColumns,...TableColumns]),'oa_templete_id'],
|
|
|
- components: {
|
|
|
+import addReq from "./add.vue";
|
|
|
+import {
|
|
|
+ getReqList,
|
|
|
+ delReq,
|
|
|
+ importData,
|
|
|
+ fileImport,
|
|
|
+ betchSubmit,
|
|
|
+ toOA,
|
|
|
+ oaBack,
|
|
|
+} from "@/api/requisition/basic";
|
|
|
+import { saveAs } from "file-saver";
|
|
|
+import { blobValidate } from "@/utils/ruoyi";
|
|
|
+import { SearchColumns, TableColumns } from "./columns";
|
|
|
+import { initDicts } from "@/utils/init.js";
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: "requisition",
|
|
|
+ dicts: [...initDicts([...SearchColumns, ...TableColumns]), "oa_templete_id"],
|
|
|
+ components: {
|
|
|
addReq,
|
|
|
ElSuperTable: () => import("@/components/super-table/index.vue"),
|
|
|
+ ElSuperUxTable: () => import("@/components/super-ux-table/index.vue"),
|
|
|
ElSuperSearch: () => import("@/components/super-search/index.vue"),
|
|
|
-},
|
|
|
- data() {
|
|
|
- const params = this.$init.params(SearchColumns);
|
|
|
- return {
|
|
|
- failLoad: false,
|
|
|
- tableList: [],
|
|
|
- size:'mini',
|
|
|
- params:params,
|
|
|
- SearchColumns:SearchColumns,
|
|
|
- TableColumns:TableColumns,
|
|
|
- pageStatus: { pageNum: 1, pageSize: 50, total: 0 },
|
|
|
- queryParams: {
|
|
|
- billCode: '',
|
|
|
- name: '',
|
|
|
- status: '',
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 10
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ const params = this.$init.params(SearchColumns);
|
|
|
+ return {
|
|
|
+ failLoad: false,
|
|
|
+ tableList: [],
|
|
|
+ size: "mini",
|
|
|
+ params: params,
|
|
|
+ SearchColumns: SearchColumns,
|
|
|
+ TableColumns: TableColumns,
|
|
|
+ pageStatus: { pageNum: 1, pageSize: 50, total: 0 },
|
|
|
+ queryParams: {
|
|
|
+ billCode: "",
|
|
|
+ name: "",
|
|
|
+ status: "",
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ },
|
|
|
+ options: [
|
|
|
+ {
|
|
|
+ value: 0,
|
|
|
+ label: "未提交",
|
|
|
},
|
|
|
- options: [{
|
|
|
- value: 0, label: '未提交'
|
|
|
- }, {
|
|
|
- value: 1, label: '审批中'
|
|
|
- }, {
|
|
|
- value: 2, label: '已完成'
|
|
|
- }, {
|
|
|
- value: 3, label: '已驳回'
|
|
|
- },],
|
|
|
- total: 0,
|
|
|
- // isComponent
|
|
|
- isComponent: 'addReq',
|
|
|
- isList: true,
|
|
|
- // 页面状态
|
|
|
- page: '',
|
|
|
- rowDetail: {},
|
|
|
- disable: false,
|
|
|
- checkedList: [],
|
|
|
- importData: {
|
|
|
- show: false,
|
|
|
- list: []
|
|
|
+ {
|
|
|
+ value: 1,
|
|
|
+ label: "审批中",
|
|
|
},
|
|
|
- }
|
|
|
- },
|
|
|
- created() {
|
|
|
-
|
|
|
- },
|
|
|
- mounted() {
|
|
|
- this.params.billCode = this.$route.query.billCode
|
|
|
- this.getList(this.queryParams)
|
|
|
- },
|
|
|
- methods: {
|
|
|
- // 操作提示弹窗
|
|
|
- handleConfirmTips(success){
|
|
|
-
|
|
|
- this.$confirm('是否继续此操作?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
-
|
|
|
+ {
|
|
|
+ value: 2,
|
|
|
+ label: "已完成",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 3,
|
|
|
+ label: "已驳回",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ total: 0,
|
|
|
+ // isComponent
|
|
|
+ isComponent: "addReq",
|
|
|
+ isList: true,
|
|
|
+ // 页面状态
|
|
|
+ page: "",
|
|
|
+ rowDetail: {},
|
|
|
+ disable: false,
|
|
|
+ checkedList: [],
|
|
|
+ importData: {
|
|
|
+ show: false,
|
|
|
+ list: [],
|
|
|
+ },
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {},
|
|
|
+ mounted() {
|
|
|
+ this.params.billCode = this.$route.query.billCode;
|
|
|
+ this.getList(this.queryParams);
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 操作提示弹窗
|
|
|
+ handleConfirmTips(success) {
|
|
|
+ this.$confirm("是否继续此操作?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
success();
|
|
|
-
|
|
|
- }).catch(() => {
|
|
|
- });
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
},
|
|
|
- // 批量提交
|
|
|
- async handleBatchSubmit(){
|
|
|
- let filterList = this.checkedList.filter(item => !(item.status === '0' || item.status === '3') )
|
|
|
-
|
|
|
- console.log(filterList,'filterList',this.checkedList.length);
|
|
|
-
|
|
|
- if(!filterList.length && this.checkedList.length){
|
|
|
-
|
|
|
- this.handleConfirmTips(async() =>{
|
|
|
-
|
|
|
- try {
|
|
|
-
|
|
|
- this.failLoad = true;
|
|
|
+ // 批量提交
|
|
|
+ async handleBatchSubmit() {
|
|
|
+ let filterList = this.checkedList.filter(
|
|
|
+ (item) => !(item.status === "0" || item.status === "3")
|
|
|
+ );
|
|
|
|
|
|
- let ids = this.checkedList.map( item => Number(item.id));
|
|
|
+ console.log(filterList, "filterList", this.checkedList.length);
|
|
|
|
|
|
- let {code,msg} = await betchSubmit({ids});
|
|
|
+ if (!filterList.length && this.checkedList.length) {
|
|
|
+ this.handleConfirmTips(async () => {
|
|
|
+ try {
|
|
|
+ this.failLoad = true;
|
|
|
|
|
|
- if(code == 200){
|
|
|
- this.reset();
|
|
|
- }
|
|
|
-
|
|
|
- this.$notify({
|
|
|
- title: code == 200 ? msg : 'error',
|
|
|
- type: code == 200 ? 'success' :'error',
|
|
|
- message: code == 200 ?'' :msg,
|
|
|
- });
|
|
|
+ let ids = this.checkedList.map((item) => Number(item.id));
|
|
|
|
|
|
- } catch (error) {
|
|
|
+ let { code, msg } = await betchSubmit({ ids });
|
|
|
|
|
|
- }finally{
|
|
|
- this.failLoad = false;
|
|
|
- }
|
|
|
-
|
|
|
- })
|
|
|
+ if (code == 200) {
|
|
|
+ this.reset();
|
|
|
+ }
|
|
|
|
|
|
- }else{
|
|
|
- this.$notify.warning({
|
|
|
- title: '警告',
|
|
|
- message: '存在不符合提交条件数据或未选择数据!',
|
|
|
+ this.$notify({
|
|
|
+ title: code == 200 ? msg : "error",
|
|
|
+ type: code == 200 ? "success" : "error",
|
|
|
+ message: code == 200 ? "" : msg,
|
|
|
});
|
|
|
+ } catch (error) {
|
|
|
+ } finally {
|
|
|
+ this.failLoad = false;
|
|
|
}
|
|
|
- },
|
|
|
-
|
|
|
- async jumpFlow (row){
|
|
|
-
|
|
|
- const {name} = this.$store.state.user;
|
|
|
-
|
|
|
- try {
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$notify.warning({
|
|
|
+ title: "警告",
|
|
|
+ message: "存在不符合提交条件数据或未选择数据!",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
- let {code,msg,oaUrl} = await toOA(name,row.oaId);
|
|
|
+ async jumpFlow(row) {
|
|
|
+ const { name } = this.$store.state.user;
|
|
|
|
|
|
- if(code == 200){
|
|
|
- window.open(oaUrl)
|
|
|
- }
|
|
|
-
|
|
|
- } catch (error) {
|
|
|
-
|
|
|
- }finally{
|
|
|
+ try {
|
|
|
+ let { code, msg, oaUrl } = await toOA(name, row.oaId);
|
|
|
|
|
|
+ if (code == 200) {
|
|
|
+ window.open(oaUrl);
|
|
|
}
|
|
|
- },
|
|
|
-
|
|
|
- reset() {
|
|
|
- // this.queryParams.billCode = ''
|
|
|
- // this.queryParams.name = ''
|
|
|
- // this.queryParams.status = ''
|
|
|
- // this.queryParams.pageNum = 1
|
|
|
- this.pageStatus.pageNum = 1;
|
|
|
- this.pageStatus.pageSize = 10;
|
|
|
- this.params = this.$init.params(SearchColumns);
|
|
|
- this.getList(this.queryParams)
|
|
|
- },
|
|
|
- newAdd() {
|
|
|
- this.isList = false
|
|
|
- this.isComponent = 'addReq'
|
|
|
- this.page = 'add'
|
|
|
- this.disable = false
|
|
|
- },
|
|
|
- // 复制
|
|
|
- handleCopy() {
|
|
|
- this.isList = false;
|
|
|
- this.isComponent = 'addReq';
|
|
|
- this.page = 'copy';
|
|
|
- this.rowDetail = this.checkedList[0];
|
|
|
- this.disable = false;
|
|
|
- },
|
|
|
- // 导入
|
|
|
- handleImport() {
|
|
|
- this.importData.show = true
|
|
|
- },
|
|
|
- // 导出
|
|
|
- handleDownload(){
|
|
|
- let params = {
|
|
|
- ...this.params
|
|
|
- };
|
|
|
- this.download('/system/apply/material/export', {...params}, `物料申请单${new Date().getTime()}.xlsx`);
|
|
|
- },
|
|
|
- // 删除文件
|
|
|
- handleFileRemove(file, fileList) {
|
|
|
- // console.log('删除文件', file, 'file', fileList, 'fileList');
|
|
|
- this.importData.list = fileList;
|
|
|
- },
|
|
|
- // 文件发生改变
|
|
|
- handleChangeFile(file, fileList) {
|
|
|
- this.importData.list = fileList;
|
|
|
- },
|
|
|
- // 导入弹窗操作
|
|
|
- handleImportData(type) {
|
|
|
- switch (type) {
|
|
|
- // 取消
|
|
|
- case 'cancal':
|
|
|
- this.importData.list = [];
|
|
|
- this.importData.show = false;
|
|
|
- break;
|
|
|
- // 确认
|
|
|
- case 'confirm':
|
|
|
- if (this.importData.list.length) {
|
|
|
-
|
|
|
- let formData = new FormData();
|
|
|
-
|
|
|
- formData.append('file', this.importData.list[0].raw);
|
|
|
- importData(formData).then(res => {
|
|
|
- if (res.code == 200) {
|
|
|
- this.importData.show = false;
|
|
|
- this.importData.list = [];
|
|
|
- if (res.data.flag) {
|
|
|
- this.failLoad = true;
|
|
|
- // console.log(res.data.datas)
|
|
|
- let param = {failDatas: res.data.datas}
|
|
|
- if (null != param) {
|
|
|
+ } catch (error) {
|
|
|
+ } finally {
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
- fileImport(param).then(res => {
|
|
|
- console.log('res',res)
|
|
|
- const isBlob = blobValidate(res);
|
|
|
- if (isBlob) {
|
|
|
- const blob = new Blob([res]);
|
|
|
- saveAs(blob, '导入失败的物料申请单数据.xlsx');
|
|
|
- }
|
|
|
- this.failLoad = false;
|
|
|
- this.reset();
|
|
|
- })
|
|
|
- }
|
|
|
+ reset() {
|
|
|
+ // this.queryParams.billCode = ''
|
|
|
+ // this.queryParams.name = ''
|
|
|
+ // this.queryParams.status = ''
|
|
|
+ // this.queryParams.pageNum = 1
|
|
|
+ this.pageStatus.pageNum = 1;
|
|
|
+ this.pageStatus.pageSize = 10;
|
|
|
+ this.params = this.$init.params(SearchColumns);
|
|
|
+ this.getList(this.queryParams);
|
|
|
+ },
|
|
|
+ newAdd() {
|
|
|
+ this.isList = false;
|
|
|
+ this.isComponent = "addReq";
|
|
|
+ this.page = "add";
|
|
|
+ this.disable = false;
|
|
|
+ },
|
|
|
+ // 复制
|
|
|
+ handleCopy() {
|
|
|
+ this.isList = false;
|
|
|
+ this.isComponent = "addReq";
|
|
|
+ this.page = "copy";
|
|
|
+ this.rowDetail = this.checkedList[0];
|
|
|
+ this.disable = false;
|
|
|
+ },
|
|
|
+ // 导入
|
|
|
+ handleImport() {
|
|
|
+ this.importData.show = true;
|
|
|
+ },
|
|
|
+ // 导出
|
|
|
+ handleDownload() {
|
|
|
+ let params = {
|
|
|
+ ...this.params,
|
|
|
+ };
|
|
|
+ this.download(
|
|
|
+ "/system/apply/material/export",
|
|
|
+ { ...params },
|
|
|
+ `物料申请单${new Date().getTime()}.xlsx`
|
|
|
+ );
|
|
|
+ },
|
|
|
+ // 删除文件
|
|
|
+ handleFileRemove(file, fileList) {
|
|
|
+ // console.log('删除文件', file, 'file', fileList, 'fileList');
|
|
|
+ this.importData.list = fileList;
|
|
|
+ },
|
|
|
+ // 文件发生改变
|
|
|
+ handleChangeFile(file, fileList) {
|
|
|
+ this.importData.list = fileList;
|
|
|
+ },
|
|
|
+ // 导入弹窗操作
|
|
|
+ handleImportData(type) {
|
|
|
+ switch (type) {
|
|
|
+ // 取消
|
|
|
+ case "cancal":
|
|
|
+ this.importData.list = [];
|
|
|
+ this.importData.show = false;
|
|
|
+ break;
|
|
|
+ // 确认
|
|
|
+ case "confirm":
|
|
|
+ if (this.importData.list.length) {
|
|
|
+ let formData = new FormData();
|
|
|
+
|
|
|
+ formData.append("file", this.importData.list[0].raw);
|
|
|
+ importData(formData).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.importData.show = false;
|
|
|
+ this.importData.list = [];
|
|
|
+ if (res.data.flag) {
|
|
|
+ this.failLoad = true;
|
|
|
+ // console.log(res.data.datas)
|
|
|
+ let param = { failDatas: res.data.datas };
|
|
|
+ if (null != param) {
|
|
|
+ fileImport(param).then((res) => {
|
|
|
+ console.log("res", res);
|
|
|
+ const isBlob = blobValidate(res);
|
|
|
+ if (isBlob) {
|
|
|
+ const blob = new Blob([res]);
|
|
|
+ saveAs(blob, "导入失败的物料申请单数据.xlsx");
|
|
|
+ }
|
|
|
+ this.failLoad = false;
|
|
|
+ this.reset();
|
|
|
+ });
|
|
|
}
|
|
|
- this.$message({
|
|
|
- message: res.data.msg,
|
|
|
- type: res.data.flag ? 'warning' : 'success'
|
|
|
- });
|
|
|
- } else {
|
|
|
- this.$message({
|
|
|
- message: res.msg,
|
|
|
- type: res.code == 200 ? 'success' : 'warning'
|
|
|
- });
|
|
|
}
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.$message({
|
|
|
- message: '请上传文件之后在确认!',
|
|
|
- type: 'warning'
|
|
|
- });
|
|
|
- }
|
|
|
- break;
|
|
|
- }
|
|
|
- },
|
|
|
- handlefileDialogColse(done){
|
|
|
- this.importData.list = [];
|
|
|
- done();
|
|
|
- },
|
|
|
- // Select框
|
|
|
- handleSelect(selection, row) {
|
|
|
-
|
|
|
- this.checkedList = selection;
|
|
|
-
|
|
|
- // console.log(this.checkedList, 'this.checkedList');
|
|
|
-
|
|
|
- },
|
|
|
- getList(val) {
|
|
|
- // console.log('val', val)
|
|
|
- this.failLoad = true;
|
|
|
-
|
|
|
- getReqList({...this.params,...this.pageStatus}).then(res => {
|
|
|
- this.failLoad = false;
|
|
|
- if (res.code === 200) {
|
|
|
- this.tableList = res.rows;
|
|
|
- // this.total = res.total;
|
|
|
- this.pageStatus.total = res.total;
|
|
|
+ this.$message({
|
|
|
+ message: res.data.msg,
|
|
|
+ type: res.data.flag ? "warning" : "success",
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: res.code == 200 ? "success" : "warning",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: "请上传文件之后在确认!",
|
|
|
+ type: "warning",
|
|
|
+ });
|
|
|
}
|
|
|
- })
|
|
|
- // this.checkedList = [];
|
|
|
- },
|
|
|
- // 表格内状态栏判断值
|
|
|
- statusJug(row) {
|
|
|
- if (row.status == 0) {
|
|
|
- return '未提交'
|
|
|
- } else if (row.status == 1) {
|
|
|
- return '审批中'
|
|
|
- } else if (row.status == 2) {
|
|
|
- return '已完成'
|
|
|
- } else if (row.status == 3) {
|
|
|
- return '已驳回'
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handlefileDialogColse(done) {
|
|
|
+ this.importData.list = [];
|
|
|
+ done();
|
|
|
+ },
|
|
|
+ // Select框
|
|
|
+ handleSelect(selection, row) {
|
|
|
+ this.checkedList = selection;
|
|
|
+
|
|
|
+ // console.log(this.checkedList, 'this.checkedList');
|
|
|
+ },
|
|
|
+ getList(val) {
|
|
|
+ // console.log('val', val)
|
|
|
+ this.failLoad = true;
|
|
|
+
|
|
|
+ getReqList({ ...this.params, ...this.pageStatus }).then((res) => {
|
|
|
+ this.failLoad = false;
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.tableList = res.rows;
|
|
|
+ // this.total = res.total;
|
|
|
+ this.pageStatus.total = res.total;
|
|
|
}
|
|
|
- },
|
|
|
- //
|
|
|
- handleSelectionChange(selection) {
|
|
|
- this.checkedList = selection;
|
|
|
- },
|
|
|
- check(row) {
|
|
|
- console.log('xxxx',this.dict.type)
|
|
|
- // console.log('查看详情', row)
|
|
|
- this.isList = false
|
|
|
- this.isComponent = 'addReq'
|
|
|
- this.page = 'check'
|
|
|
- this.rowDetail = row
|
|
|
- this.disable = true
|
|
|
- },
|
|
|
- edit(row) {
|
|
|
- // console.log('修改先加载详情', row)
|
|
|
- this.isList = false
|
|
|
- this.isComponent = 'addReq'
|
|
|
- this.page = 'edit'
|
|
|
- this.rowDetail = row
|
|
|
- this.disable = false
|
|
|
- },
|
|
|
- commit(row) {
|
|
|
- // console.log('row', row)
|
|
|
- },
|
|
|
- deleteRow(row) {
|
|
|
- this.$confirm('是否删除此条数据?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- delReq(row.id).then(res => {
|
|
|
+ });
|
|
|
+ // this.checkedList = [];
|
|
|
+ },
|
|
|
+ // 表格内状态栏判断值
|
|
|
+ statusJug(row) {
|
|
|
+ if (row.status == 0) {
|
|
|
+ return "未提交";
|
|
|
+ } else if (row.status == 1) {
|
|
|
+ return "审批中";
|
|
|
+ } else if (row.status == 2) {
|
|
|
+ return "已完成";
|
|
|
+ } else if (row.status == 3) {
|
|
|
+ return "已驳回";
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //
|
|
|
+ handleSelectionChange(selection) {
|
|
|
+ this.checkedList = selection;
|
|
|
+ },
|
|
|
+ check(row) {
|
|
|
+ console.log("xxxx", this.dict.type);
|
|
|
+ // console.log('查看详情', row)
|
|
|
+ this.isList = false;
|
|
|
+ this.isComponent = "addReq";
|
|
|
+ this.page = "check";
|
|
|
+ this.rowDetail = row;
|
|
|
+ this.disable = true;
|
|
|
+ },
|
|
|
+ edit(row) {
|
|
|
+ // console.log('修改先加载详情', row)
|
|
|
+ this.isList = false;
|
|
|
+ this.isComponent = "addReq";
|
|
|
+ this.page = "edit";
|
|
|
+ this.rowDetail = row;
|
|
|
+ this.disable = false;
|
|
|
+ },
|
|
|
+ commit(row) {
|
|
|
+ // console.log('row', row)
|
|
|
+ },
|
|
|
+ deleteRow(row) {
|
|
|
+ this.$confirm("是否删除此条数据?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ delReq(row.id).then((res) => {
|
|
|
if (res.code === 200) {
|
|
|
this.$message({
|
|
|
message: res.msg,
|
|
|
- type: 'success'
|
|
|
+ type: "success",
|
|
|
});
|
|
|
- this.getList(this.queryParams)
|
|
|
+ this.getList(this.queryParams);
|
|
|
}
|
|
|
- })
|
|
|
- }).catch(() => {
|
|
|
- })
|
|
|
- },
|
|
|
- // handleSizeChange(val) {
|
|
|
- // console.log(`每页 ${val} 条`);
|
|
|
- // this.queryParams.pageSize = val
|
|
|
- // this.getList(this.queryParams)
|
|
|
- // },
|
|
|
- // handleCurrentChange(val) {
|
|
|
- // console.log(`当前页: ${val}`);
|
|
|
- // this.queryParams.pageNum = val
|
|
|
- // this.getList(this.queryParams)
|
|
|
- // }
|
|
|
- //流程收回
|
|
|
- async handleBack(row){
|
|
|
- try {
|
|
|
- const { msg, code } = await oaBack({
|
|
|
- fdTemplateId: this.dict.type.oa_templete_id.find(item => {
|
|
|
- return item.label == "物料申请单"
|
|
|
- }).value,
|
|
|
- fdId: row.oaId,
|
|
|
- billCode: row.billCode,
|
|
|
- billMaker: row.createBy
|
|
|
});
|
|
|
- if (code === 200) {
|
|
|
- this.$emit("success");
|
|
|
- this.$notify.success(msg);
|
|
|
- }
|
|
|
- } catch (err) {
|
|
|
- console.error(err);
|
|
|
- } finally {
|
|
|
- this.getList(this.queryParams);
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ },
|
|
|
+ // handleSizeChange(val) {
|
|
|
+ // console.log(`每页 ${val} 条`);
|
|
|
+ // this.queryParams.pageSize = val
|
|
|
+ // this.getList(this.queryParams)
|
|
|
+ // },
|
|
|
+ // handleCurrentChange(val) {
|
|
|
+ // console.log(`当前页: ${val}`);
|
|
|
+ // this.queryParams.pageNum = val
|
|
|
+ // this.getList(this.queryParams)
|
|
|
+ // }
|
|
|
+ //流程收回
|
|
|
+ async handleBack(row) {
|
|
|
+ try {
|
|
|
+ const { msg, code } = await oaBack({
|
|
|
+ fdTemplateId: this.dict.type.oa_templete_id.find((item) => {
|
|
|
+ return item.label == "物料申请单";
|
|
|
+ }).value,
|
|
|
+ fdId: row.oaId,
|
|
|
+ billCode: row.billCode,
|
|
|
+ billMaker: row.createBy,
|
|
|
+ });
|
|
|
+ if (code === 200) {
|
|
|
+ this.$emit("success");
|
|
|
+ this.$notify.success(msg);
|
|
|
}
|
|
|
- },
|
|
|
- }
|
|
|
- }
|
|
|
+ } catch (err) {
|
|
|
+ console.error(err);
|
|
|
+ } finally {
|
|
|
+ this.getList(this.queryParams);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
- .requisition {
|
|
|
- // height: calc(100vh - 84px);
|
|
|
- padding: 12px;
|
|
|
- box-sizing: border-box;
|
|
|
- }
|
|
|
+.requisition {
|
|
|
+ // height: calc(100vh - 84px);
|
|
|
+ // padding: 12px;
|
|
|
+ // box-sizing: border-box;
|
|
|
+}
|
|
|
+.el-card {
|
|
|
+ width: calc(100% - 32px);
|
|
|
+ height: calc(100vh - 32px);
|
|
|
+ margin: 16px;
|
|
|
+ padding: 16px;
|
|
|
+ border-radius: 8px;
|
|
|
+}
|
|
|
</style>
|