From 2b0e4166f7cf5c75669070d65ad89b6138da50f4 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期四, 26 十二月 2024 14:33:04 +0800
Subject: [PATCH] 完成7.2标准查新搬迁
---
src/components/view/a7-standard-novelty-retrieval.vue | 638 +++++++++++++++++++++++++++++++++++++++
src/components/do/a7-standard-novelty-retrieval/EditFormDia.vue | 148 +++++++++
src/components/do/a7-standard-novelty-retrieval/FormDialog.vue | 135 ++++++++
src/assets/api/controller.js | 10
4 files changed, 931 insertions(+), 0 deletions(-)
diff --git a/src/assets/api/controller.js b/src/assets/api/controller.js
index 738fef3..7929dfe 100644
--- a/src/assets/api/controller.js
+++ b/src/assets/api/controller.js
@@ -54,6 +54,7 @@
internalCorrect,
qualitySupervise,
processOrder,
+ processMethodSearchNew,
}
}
@@ -700,3 +701,12 @@
getProcessOrder:'/processOrder/getProcessOrder', // 鏌ョ湅
exportInspectionOrder:'/processOrder/exportInspectionOrder', // 涓嬭浇
}
+
+// 7.2鏍囧噯鏌ユ柊
+const processMethodSearchNew = {
+ pageMethodSearchNew:'/processMethodSearchNew/pageMethodSearchNew', // 鏍囧噯鏌ユ柊鍒楄〃
+ addMethodSearchNew:'/processMethodSearchNew/addMethodSearchNew', // 鏂板鏍囧噯鏌ユ柊
+ updateMethodSearchNew:'/processMethodSearchNew/updateMethodSearchNew', // 淇敼鏍囧噯鏌ユ柊
+ exportMethodSearchNew:'/processMethodSearchNew/exportMethodSearchNew', // 瀵煎嚭鏍囧噯鏌ユ柊
+ importMethodSearchNew:'/processMethodSearchNew/importMethodSearchNew', // 瀵煎叆鏍囧噯鏌ユ柊
+}
diff --git a/src/components/do/a7-standard-novelty-retrieval/EditFormDia.vue b/src/components/do/a7-standard-novelty-retrieval/EditFormDia.vue
new file mode 100644
index 0000000..99faab9
--- /dev/null
+++ b/src/components/do/a7-standard-novelty-retrieval/EditFormDia.vue
@@ -0,0 +1,148 @@
+<template>
+ <div>
+ <el-dialog :visible.sync="formDia" title="缂栬緫" width="80%" @close="closeDia">
+ <el-form ref="form" :model="form" :rules="formRules" label-width="auto">
+ <el-col :span="8">
+ <el-form-item label="鏍囧噯鍚嶇О锛�" prop="methodName">
+ <el-input v-model="form.methodName" size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鏍囧噯鍙凤細" prop="standardNo">
+ <el-input v-model="form.standardNo" size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鏂囦欢缂栧彿锛�" prop="fileNo">
+ <el-input v-model="form.fileNo" size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鏄惁鏄柊鏍囧噯锛�" prop="isNewStandard">
+ <el-radio-group v-model="form.isNewStandard">
+ <el-radio :label="0">鍚�</el-radio>
+ <el-radio :label="1">鏄�</el-radio>
+ </el-radio-group>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鏌ユ柊璁板綍鏉ユ簮锛�" prop="searchNewSource">
+ <el-radio-group v-model="form.searchNewSource">
+ <el-radio :label="0">鏍囧噯缃�</el-radio>
+ <el-radio :label="1">濮旀墭鎯呮姤</el-radio>
+ <el-radio :label="2">鏍囧噯鏁�</el-radio>
+ <el-radio :label="3">鍏朵粬</el-radio>
+ </el-radio-group>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="澶囨敞锛�" prop="remark">
+ <el-select v-model="form.remark"
+ clearable size="small">
+ <el-option :value="0" label="浣滃簾"></el-option>
+ <el-option :value="1" label="鏇挎崲"></el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col v-if="form.isNewStandard == 1" :span="8">
+ <el-form-item label="鏂版爣鍑嗗悕绉帮細" prop="newMethodName">
+ <el-input v-model="form.newMethodName" size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col v-if="form.isNewStandard == 1" :span="8">
+ <el-form-item label="鏂版爣鍑嗗彿锛�" prop="newStandardNo">
+ <el-input v-model="form.newStandardNo" size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-form>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="closeDia">鍙� 娑�</el-button>
+ <el-button :loading="editLoad" type="primary" @click="handleEdit">鎻� 浜�</el-button>
+ </span>
+ </el-dialog>
+ </div>
+</template>
+
+<script>
+export default {
+ name: 'FormDialog',
+ // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
+ components: {},
+ data() {
+ // 杩欓噷瀛樻斁鏁版嵁
+ return {
+ formDia: false,
+ form: {
+ methodName: '',
+ standardNo: '',
+ isNewStandard: '',
+ newMethodName: '',
+ newStandardNo: '',
+ searchNewSource: '',
+ remark: '',
+ fileNo: '',
+ },
+ formRules: {
+ methodName: [{required: true, message: '璇峰~鍐欐爣鍑嗗悕绉�',trigger: 'blur'}],
+ standardNo: [{required: true, message: '璇峰~鍐欐爣鍑嗗彿',trigger: 'blur'}],
+ isNewStandard: [{required: true, message: '璇烽�夋嫨鏄惁鏄柊鏍囧噯',trigger: 'change'}],
+ newMethodName: [{required: true, message: '璇峰~鍐欐柊鏍囧噯鍚嶇О',trigger: 'blur'}],
+ newStandardNo: [{required: true, message: '璇峰~鍐欐柊鏍囧噯鍙�',trigger: 'blur'}],
+ searchNewSource: [{required: true, message: '璇烽�夋嫨鏌ユ柊璁板綍鏉ユ簮',trigger: 'change'}],
+ fileNo: [{required: true, message: '璇峰~鍐欐枃浠跺彿',trigger: 'blur'}],
+ },
+ editLoad: false,
+ info: {},
+ };
+ },
+ // 鏂规硶闆嗗悎
+ methods: {
+ openDia(row) {
+ this.formDia = true
+ this.form = {...row}
+ },
+ handleEdit() {
+ this.$refs['form'].validate((valid) => {
+ if (valid) {
+ this.editLoad = true
+ const processMethodSearchNews = this.HaveJson(this.form)
+ delete processMethodSearchNews.createTime
+ this.$axios.post(this.$api.processMethodSearchNew.updateMethodSearchNew, processMethodSearchNews, {
+ headers: {
+ "Content-Type": "application/json"
+ },
+ noQs: true
+ }).then(res => {
+ this.editLoad = false
+ if (res.code === 201) return
+ this.$message.success('鎿嶄綔鎴愬姛')
+ this.closeDia()
+ }).catch(err => {
+ console.log('err---', err);
+ this.editLoad = false
+ })
+ } else {
+ console.log('error submit!!');
+ return false;
+ }
+ });
+ },
+ closeDia() {
+ this.$refs.form.resetFields();
+ this.formDia = false
+ this.$emit('closeEditDia');
+ },
+ }
+};
+</script>
+
+<style scoped>
+.form-info {
+ display: inline-block;
+ max-height: 600px;
+ overflow-y: auto;
+}
+>>>.el-dialog {
+ margin: 6vh auto 50px !important;
+}
+</style>
diff --git a/src/components/do/a7-standard-novelty-retrieval/FormDialog.vue b/src/components/do/a7-standard-novelty-retrieval/FormDialog.vue
new file mode 100644
index 0000000..a4e3389
--- /dev/null
+++ b/src/components/do/a7-standard-novelty-retrieval/FormDialog.vue
@@ -0,0 +1,135 @@
+<template>
+ <div>
+ <el-dialog :visible.sync="formDia" title="鏂板" width="80%" @close="closeDia">
+ <el-form ref="form" :model="form" :rules="formRules" label-width="auto">
+ <el-button size="small" type="primary" @click="addBtn">娣诲姞涓�鏉�</el-button>
+ <div class="form-info">
+ <div v-for="(items,index) in form.taskRel" :key="index">
+ <el-col :span="12">
+ <el-form-item :prop="`taskRel.${index}.newMethodName`" :rules="{required: true, message: '璇峰~鍐欐爣鍑嗗悕绉�',trigger: 'blur',}" label="鏂版爣鍑嗗悕绉帮細">
+ <el-input v-model="items.newMethodName" size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item :prop="`taskRel.${index}.newStandardNo`" :rules="{required: true,message: '璇峰~鍐欐爣鍑嗗彿',trigger: 'blur',}" label="鏂版爣鍑嗗彿锛�">
+ <el-input v-model="items.newStandardNo" size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item :prop="`taskRel.${index}.searchNewSource`" :rules="{required: true,message: '璇烽�夋嫨鏌ユ柊璁板綍鏉ユ簮',trigger: 'change',}" label="鏌ユ柊璁板綍鏉ユ簮锛�">
+ <el-radio-group v-model="items.searchNewSource">
+ <el-radio :label="0">鏍囧噯缃�</el-radio>
+ <el-radio :label="1">濮旀墭鎯呮姤</el-radio>
+ <el-radio :label="2">鏍囧噯鏁�</el-radio>
+ <el-radio :label="3">鍏朵粬</el-radio>
+ </el-radio-group>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item :prop="`taskRel.${index}.remark`" :rules="{required: false,message: '璇烽�夋嫨澶囨敞',trigger: 'change',}" label="澶囨敞锛�">
+ <el-select v-model="items.remark" :prop="`taskRel.${index}.remark`"
+ :rules="{required: false,message: '璇烽�夋嫨澶囨敞',trigger: 'change',}"
+ clearable size="small">
+ <el-option :value="0" label="浣滃簾"></el-option>
+ <el-option :value="1" label="鏇挎崲"></el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="4">
+ <el-button v-if="index !== 0" circle icon="el-icon-delete" size="small" type="danger" @click="deleteHeaderRow(index)"></el-button>
+ </el-col>
+ <el-col :span="24">
+ <el-divider></el-divider>
+ </el-col>
+ </div>
+ </div>
+ </el-form>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="closeDia">鍙� 娑�</el-button>
+ <el-button :loading="editLoad" type="primary" @click="handleEdit">鎻� 浜�</el-button>
+ </span>
+ </el-dialog>
+ </div>
+</template>
+
+<script>
+export default {
+ name: 'FormDialog',
+ // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
+ components: {},
+ data() {
+ // 杩欓噷瀛樻斁鏁版嵁
+ return {
+ formDia: false,
+ form: {
+ taskRel: [
+ {
+ newMethodName: '',
+ newStandardNo: '',
+ searchNewSource: '',
+ remark: '',
+ }
+ ]
+ },
+ formRules: {},
+ editLoad: false,
+ info: {},
+ };
+ },
+ // 鏂规硶闆嗗悎
+ methods: {
+ openDia (row) {
+ this.formDia = true
+ },
+ // 娣诲姞涓�鏉�
+ addBtn() {
+ this.form.taskRel.push({ newMethodName: '', newStandardNo:'', searchNewSource: '', remark: ''});
+ },
+ // 鍒犻櫎涓�鏉�
+ deleteHeaderRow (index) {
+ this.form.taskRel.splice(index, 1);
+ },
+ handleEdit () {
+ this.$refs['form'].validate((valid) => {
+ if (valid) {
+ this.editLoad = true
+ const processMethodSearchNews = this.HaveJson(this.form.taskRel)
+ this.$axios.post(this.$api.processMethodSearchNew.addMethodSearchNew, processMethodSearchNews, {
+ headers: {
+ "Content-Type": "application/json"
+ },
+ noQs: true
+ }).then(res => {
+ this.editLoad = false
+ if (res.code === 201) return
+ this.$message.success('鎿嶄綔鎴愬姛')
+ this.closeDia()
+ }).catch(err => {
+ console.log('err---', err);
+ this.editLoad = false
+ })
+ } else {
+ console.log('error submit!!');
+ return false;
+ }
+ });
+ },
+ closeDia () {
+ this.$refs.form.resetFields();
+ this.formDia = false
+ this.$emit('closeDia');
+ },
+ }
+};
+</script>
+
+<style scoped>
+.form-info {
+ display: inline-block;
+ max-height: 42em;
+ overflow-y: auto;
+}
+>>>.el-dialog {
+ margin: 6vh auto 50px !important;
+}
+</style>
diff --git a/src/components/view/a7-standard-novelty-retrieval.vue b/src/components/view/a7-standard-novelty-retrieval.vue
new file mode 100644
index 0000000..09667a1
--- /dev/null
+++ b/src/components/view/a7-standard-novelty-retrieval.vue
@@ -0,0 +1,638 @@
+<template>
+ <div>
+ <div>
+ <div class="view-title">
+ <span>鏍囧噯鏌ユ柊</span>
+ <span style="display: flex; align-items: center;">
+ <el-button size="medium" type="primary" @click="openHandleOut">瀵� 鍑�</el-button>
+ <el-upload ref='upload' :action="action"
+ :before-upload="beforeUpload" :headers="headers" :on-error="onError"
+ :on-success="handleSuccessUp" :show-file-list="false" accept='.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar'
+ style="display: inline-block; margin-left: 10px;">
+ <el-button :loading="upLoading" size="medium" type="primary">瀵煎叆</el-button>
+ </el-upload>
+ <el-button size="medium" style="margin-left: 10px;" type="primary" @click="openFormDia">鏂� 澧�</el-button>
+ </span>
+ </div>
+ <div class="search-background">
+ <span v-if="tabIndex == 1" class="search-group">
+ <span>骞翠唤锛�</span>
+ <el-date-picker
+ v-model="searchForm.year"
+ format="yyyy"
+ placeholder="閫夋嫨骞�"
+ type="year"
+ value-format="yyyy">
+ </el-date-picker>
+ </span>
+ <span class="search-group">
+ <span>鏃堕棿锛�</span>
+ <el-select v-model="searchForm.date" clearable placeholder="璇烽�夋嫨">
+ <el-option
+ v-for="item in options"
+ :key="item.value"
+ :label="item.label"
+ :value="item.value">
+ </el-option>
+ </el-select>
+ </span>
+ <span class="search-group">
+ <el-button size="medium" @click="resetSearchForm">閲� 缃�</el-button>
+ <el-button size="medium" type="primary" @click="searchList">鏌� 璇�</el-button>
+ </span>
+ </div>
+ <div class="table">
+ <div class="table-tab">
+ <el-radio-group v-model="tabIndex" @change="searchList">
+ <el-radio-button label="0">浠婂勾鏍囧噯璁板綍</el-radio-button>
+ <el-radio-button label="1">鍘嗗彶鏍囧噯璁板綍</el-radio-button>
+ </el-radio-group>
+ </div>
+ <div v-if="tabIndex === '0'">
+ <TableCard :showForm="false" :showTitle="false">
+ <template v-slot:table>
+ <ZTTable
+ :column="tableColumn"
+ :height="'calc(100vh - 26em)'"
+ :table-data="tableData"
+ :table-loading="tableLoading"
+ style="padding: 0 15px;margin-bottom: 16px">
+ </ZTTable>
+ </template>
+ </TableCard>
+ <el-pagination :current-page="1" :page-size="page.size" :page-sizes="[10, 20, 30, 50, 100]"
+ :total="total" layout="->,total, sizes, prev, pager, next, jumper"
+ @size-change="handleSizeChange"
+ @current-change="handleCurrentChange">
+ </el-pagination>
+ </div>
+ <div v-if="tabIndex === '1'">
+ <TableCard :showForm="false" :showTitle="false">
+ <template v-slot:table>
+ <ZTTable
+ :column="oldTableColumn"
+ :height="'calc(100vh - 27em)'"
+ :table-data="oldTableData"
+ :table-loading="oldTableLoading"
+ style="padding: 0 15px;margin-bottom: 16px">
+ </ZTTable>
+ </template>
+ </TableCard>
+ <el-pagination :current-page="1" :page-size="oldPage.size" :page-sizes="[10, 20, 30, 50, 100]"
+ :total="oldTotal" layout="->,total, sizes, prev, pager, next, jumper"
+ @size-change="handleOldSizeChange"
+ @current-change="handleOldCurrentChange">
+ </el-pagination>
+ </div>
+ </div>
+ <el-dialog :visible.sync="ratifyDialog" title="瀵煎嚭" width="30%" @close="ratifyDialog = false">
+ <span>缂栧埗浜猴細
+ <el-select v-model="ratifyInfo.writeUserId" placeholder="璇烽�夋嫨" size="small" style="width: 100%">
+ <el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id"></el-option>
+ </el-select>
+ </span>
+ <span>鎵瑰噯浜猴細
+ <el-select v-model="ratifyInfo.ratifyUserId" placeholder="璇烽�夋嫨" size="small" style="width: 100%">
+ <el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id"></el-option>
+ </el-select>
+ </span>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="ratifyDialog = false">鍙� 娑�</el-button>
+ <el-button :loading="outLoading" type="primary" @click="handleOut">纭� 璁�</el-button>
+ </span>
+ </el-dialog>
+ <FormDialog v-if="formDialog" ref="formDialog" @closeDia="closeDia"></FormDialog>
+ <EditFormDia v-if="editFormDialog" ref="editFormDialog" @closeEditDia="closeEditDia"></EditFormDia>
+ </div>
+ </div>
+</template>
+
+<script>
+import ZTTable from '../caorui/ZTTable/index.vue';
+import TableCard from '../caorui/TableCard/index.vue';
+import FormDialog from '../do/a7-standard-novelty-retrieval/FormDialog.vue';
+import EditFormDia from '../do/a7-standard-novelty-retrieval/EditFormDia.vue';
+
+export default {
+ name: 'a7-standard-novelty-retrieval',
+ // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
+ components: { FormDialog, TableCard, ZTTable, EditFormDia },
+ data() {
+ // 杩欓噷瀛樻斁鏁版嵁
+ return {
+ searchForm: {
+ year: '',
+ date: '',
+ },
+ options: [
+ {label: '涓婂崐骞�', value: '1'},
+ {label: '涓嬪崐骞�', value: '2'},
+ ],
+ tableColumn: [
+ {
+ label: '鏍囧噯鍚嶇О',
+ prop: 'methodName',
+ minWidth: '100'
+ },
+ {
+ label: '鏍囧噯鍙�',
+ prop: 'standardNo',
+ minWidth: '100'
+ },
+ {
+ label: '鏂囦欢缂栧彿',
+ prop: 'fileNo',
+ minWidth: '100'
+ },
+ {
+ dataType: 'tag',
+ label: '鏄惁鏄柊鏍囧噯',
+ prop: 'isNewStandard',
+ minWidth: '100',
+ formatData: (params) => {
+ if (params == 0) {
+ return '鍚�';
+ } else if (params == 1) {
+ return '鏄�';
+ } else {
+ return null
+ }
+ },
+ formatType: (params) => {
+ if (params == 0) {
+ return 'danger';
+ } else if (params == 1) {
+ return 'success';
+ } else {
+ return null
+ }
+ }
+ },
+ {
+ label: '鏂版爣鍑嗗悕绉�',
+ prop: 'newMethodName',
+ minWidth: '100'
+ },
+ {
+ label: '鏂版爣鍑嗗彿',
+ prop: 'newStandardNo',
+ minWidth: '100'
+ },
+ {
+ dataType: 'tag',
+ label: '鏌ヨ璁板綍鏉ユ簮',
+ prop: 'searchNewSource',
+ minWidth: '100',
+ formatData: (params) => {
+ if (params == 0) {
+ return '鏍囧噯缃�';
+ } else if (params == 1) {
+ return '濮旀墭鎯呮姤';
+ } else if (params == 2) {
+ return '鏍囧噯鏁�';
+ } else if (params == 3) {
+ return '鍏朵粬';
+ } else {
+ return null
+ }
+ },
+ formatType: (params) => {
+ if (params == 0) {
+ return 'success';
+ } else if (params == 1) {
+ return 'danger';
+ } else if (params == 2) {
+ return 'warning';
+ } else if (params == 3) {
+ return 'info';
+ } else {
+ return null
+ }
+ }
+ },
+ {
+ dataType: 'tag',
+ label: '澶囨敞',
+ prop: 'remark',
+ minWidth: '100',
+ formatData: (params) => {
+ if (params == 0) {
+ return '浣滃簾';
+ } else if (params == 1) {
+ return '鏇挎崲';
+ } else {
+ return null
+ }
+ },
+ formatType: (params) => {
+ if (params == 0) {
+ return 'danger';
+ } else if (params == 1) {
+ return 'success';
+ } else {
+ return null
+ }
+ }
+ },
+ {
+ dataType: 'action',
+ minWidth: '50',
+ label: '鎿嶄綔',
+ operation: [
+ {
+ name: '缂栬緫',
+ type: 'text',
+ clickFun: (row) => {
+ this.openEditFormDia(row);
+ },
+ }
+ ]
+ }
+ ],
+ tableData: [],
+ tableLoading: false,
+ page: {
+ size: 20,
+ current: 1,
+ },
+ total: 0,
+ oldTotal: 0,
+ oldPage: {
+ size: 20,
+ current: 1,
+ },
+ oldTableColumn: [
+ {
+ label: '鏍囧噯鍚嶇О',
+ prop: 'methodName',
+ minWidth: '100'
+ },
+ {
+ label: '鏍囧噯鍙�',
+ prop: 'standardNo',
+ minWidth: '100'
+ },
+ {
+ label: '鏂囦欢缂栧彿',
+ prop: 'fileNo',
+ minWidth: '100'
+ },
+ {
+ dataType: 'tag',
+ label: '鏄惁鏄柊鏍囧噯',
+ prop: 'isNewStandard',
+ minWidth: '100',
+ formatData: (params) => {
+ if (params == 0) {
+ return '鍚�';
+ } else if (params == 1) {
+ return '鏄�';
+ } else {
+ return null
+ }
+ },
+ formatType: (params) => {
+ if (params == 0) {
+ return 'danger';
+ } else if (params == 1) {
+ return 'success';
+ } else {
+ return null
+ }
+ }
+ },
+ {
+ label: '鏂版爣鍑嗗悕绉�',
+ prop: 'newMethodName',
+ minWidth: '100'
+ },
+ {
+ label: '鏂版爣鍑嗗彿',
+ prop: 'newStandardNo',
+ minWidth: '100'
+ },
+ {
+ dataType: 'tag',
+ label: '鏌ヨ璁板綍鏉ユ簮',
+ prop: 'searchNewSource',
+ minWidth: '100',
+ formatData: (params) => {
+ if (params == 0) {
+ return '鏍囧噯缃�';
+ } else if (params == 1) {
+ return '濮旀墭鎯呮姤';
+ } else if (params == 2) {
+ return '鏍囧噯鏁�';
+ } else if (params == 3) {
+ return '鍏朵粬';
+ } else {
+ return null
+ }
+ },
+ formatType: (params) => {
+ if (params == 0) {
+ return 'success';
+ } else if (params == 1) {
+ return 'danger';
+ } else if (params == 2) {
+ return 'warning';
+ } else if (params == 3) {
+ return 'info';
+ } else {
+ return null
+ }
+ }
+ },
+ {
+ dataType: 'tag',
+ label: '澶囨敞',
+ prop: 'remark',
+ minWidth: '100',
+ formatData: (params) => {
+ if (params == 0) {
+ return '浣滃簾';
+ } else if (params == 1) {
+ return '鏇挎崲';
+ } else {
+ return null
+ }
+ },
+ formatType: (params) => {
+ if (params == 0) {
+ return 'danger';
+ } else if (params == 1) {
+ return 'success';
+ } else {
+ return null
+ }
+ }
+ },
+ {
+ label: '鍒涘缓鏃堕棿',
+ prop: 'createTime',
+ minWidth: '100'
+ },
+ ],
+ oldTableData: [],
+ oldTableLoading: false,
+ tabIndex: '0',
+ formDialog: false,
+ editFormDialog: false,
+ upLoading:false,
+ outLoading:false,
+ ratifyDialog:false,
+ ratifyInfo: {
+ writeUserId: '',
+ ratifyUserId: '',
+ },
+ userList: []
+ };
+ },
+ mounted() {
+ this.searchList()
+ },
+ // 鏂规硶闆嗗悎
+ methods: {
+ // 鏌ヨ鍒楄〃
+ searchList () {
+ let beginDate = ''
+ let endDate = ''
+ const currentYear = new Date().getFullYear()
+ if (this.searchForm.year && this.searchForm.date) {
+ if (this.searchForm.date === '1') {
+ beginDate = this.searchForm.year + '-' + '01-01' + ' ' + '00:00:00'
+ endDate = this.searchForm.year + '-' + '06-30' + ' ' + '23:59:59'
+ } else {
+ beginDate = this.searchForm.year + '-' + '07-01' + ' ' + '00:00:00'
+ endDate = this.searchForm.year + '-' + '12-31' + ' ' + '23:59:59'
+ }
+ } else if (!this.searchForm.year && this.searchForm.date) {
+ if (this.searchForm.date === '1') {
+ beginDate = currentYear + '-' + '01-01' + ' ' + '00:00:00'
+ endDate = currentYear + '-' + '06-30' + ' ' + '23:59:59'
+ } else {
+ beginDate = currentYear + '-' + '07-01' + ' ' + '00:00:00'
+ endDate = currentYear + '-' + '12-31' + ' ' + '23:59:59'
+ }
+ } else if (this.searchForm.year && !this.searchForm.date) {
+ beginDate = this.searchForm.year + '-' + '01-01' + ' ' + '00:00:00'
+ endDate = this.searchForm.year + '-' + '12-31' + ' ' + '23:59:59'
+ }
+ const entity = {
+ beginDate: beginDate,
+ endDate: endDate,
+ }
+ this.tableLoading = true
+ this.oldTableLoading = true
+ const page = this.tabIndex === '0' ? this.page : this.oldPage
+ this.$axios.post(this.$api.processMethodSearchNew.pageMethodSearchNew, {entity, page}, {
+ headers: {
+ "Content-Type": "application/json"
+ },
+ noQs: true
+ }).then(res => {
+ this.tableLoading = false
+ this.oldTableLoading = false
+ if (res.code === 201) return
+ if (this.tabIndex === '0') {
+ this.tableData = res.data.records
+ this.total = res.data.total
+ } else {
+ this.oldTableData = res.data.records
+ this.oldTotal = res.data.total
+ }
+ }).catch(err => {
+ console.log('err---', err);
+ this.tableLoading = false
+ this.oldTableLoading = false
+ })
+ },
+ // 閲嶇疆鏌ヨ鏉′欢
+ resetSearchForm () {
+ this.searchForm.year = '';
+ this.searchForm.date = '';
+ this.searchList()
+ },
+ // 鎿嶄綔鏂板妗�
+ openFormDia (row) {
+ this.formDialog = true
+ this.$nextTick(() => {
+ this.$refs.formDialog.openDia(row)
+ })
+ },
+ // 鍏抽棴鏂板寮规
+ closeDia () {
+ this.formDialog = false
+ this.searchList()
+ },
+ // 鎵撳紑淇敼寮规
+ openEditFormDia (row) {
+ this.editFormDialog = true
+ this.$nextTick(() => {
+ this.$refs.editFormDialog.openDia(row)
+ })
+ },
+ //
+ closeEditDia () {
+ this.editFormDialog = false
+ this.searchList()
+ },
+ // 鎵撳紑瀵煎嚭寮规閫夋嫨缂栧埗浜恒�佹壒鍑嗕汉
+ openHandleOut () {
+ this.ratifyDialog = true
+ this.getUserList()
+ },
+ // 瀵煎嚭
+ handleOut () {
+ let beginDate = ''
+ let endDate = ''
+ const currentYear = new Date().getFullYear()
+ if (this.searchForm.year && this.searchForm.date) {
+ if (this.searchForm.date === '1') {
+ beginDate = this.searchForm.year + '-' + '01-01' + ' ' + '00:00:00'
+ endDate = this.searchForm.year + '-' + '06-30' + ' ' + '23:59:59'
+ } else {
+ beginDate = this.searchForm.year + '-' + '07-01' + ' ' + '00:00:00'
+ endDate = this.searchForm.year + '-' + '12-31' + ' ' + '23:59:59'
+ }
+ } else if (!this.searchForm.year && this.searchForm.date) {
+ if (this.searchForm.date === '1') {
+ beginDate = currentYear + '-' + '01-01' + ' ' + '00:00:00'
+ endDate = currentYear + '-' + '06-30' + ' ' + '23:59:59'
+ } else {
+ beginDate = currentYear + '-' + '07-01' + ' ' + '00:00:00'
+ endDate = currentYear + '-' + '12-31' + ' ' + '23:59:59'
+ }
+ } else if (this.searchForm.year && !this.searchForm.date) {
+ beginDate = this.searchForm.year + '-' + '01-01' + ' ' + '00:00:00'
+ endDate = this.searchForm.year + '-' + '12-31' + ' ' + '23:59:59'
+ }
+ const entity = {
+ beginDate: beginDate,
+ endDate: endDate,
+ writeUserId: this.ratifyInfo.writeUserId,
+ ratifyUserId: this.ratifyInfo.ratifyUserId,
+ }
+ this.outLoading = true
+ this.$axios.post(this.$api.processMethodSearchNew.exportMethodSearchNew,{
+ entity:entity
+ },{
+ headers: {
+ 'Content-Type': 'application/json'
+ },
+ noQs: true,responseType: "blob"}).then(res => {
+ this.outLoading = false
+ this.$message.success('瀵煎嚭鎴愬姛')
+ const blob = new Blob([res],{ type: 'application/octet-stream' });
+ const url = URL.createObjectURL(blob);
+ const link = document.createElement('a');
+ link.href = url;
+ link.download = '鏍囧噯鏌ユ柊瀵煎嚭.xlsx';
+ link.click();
+ })
+ },
+ // 瀵煎叆
+ beforeUpload(file) {
+ if (file.size > 1024 * 1024 * 10) {
+ this.$message.error('涓婁紶鏂囦欢涓嶈秴杩�10M');
+ this.$refs.upload.clearFiles()
+ return false;
+ } else {
+ this.upLoading = true;
+ return true;
+ }
+ },
+ onError(err, file, fileList) {
+ this.$message.error('涓婁紶澶辫触')
+ this.$refs.upload.clearFiles()
+ },
+ handleSuccessUp(response) {
+ this.upLoading = false;
+ if (response.code == 200) {
+ this.$message.success('涓婁紶鎴愬姛');
+ this.searchList()
+ }
+ },
+ // 鍒嗛〉
+ handleSizeChange(val) {
+ this.page.size = val;
+ this.searchList();
+ },
+ handleCurrentChange(val) {
+ this.page.current = val;
+ this.searchList();
+ },
+ //
+ // 鍒嗛〉
+ handleOldSizeChange(val) {
+ this.oldPage.size = val;
+ this.searchList();
+ },
+ handleOldCurrentChange(val) {
+ this.oldPage.current = val;
+ this.searchList();
+ },
+ //
+ getUserList(){
+ this.$axios.post(this.$api.user.selectUserList, {
+ page: {current: -1, size: -1,},
+ entity: {name: null}
+ }, {
+ headers: {
+ 'Content-Type': 'application/json'
+ }
+ }).then(res => {
+ if (res.code === 201) {
+ return
+ }
+ this.userList = res.data.body.records
+ })
+ },
+ },
+ // 鐢ㄤ簬涓婁紶鏂囦欢鐨勪俊鎭�
+ computed: {
+ headers() {
+ return {
+ 'token': sessionStorage.getItem('token')
+ }
+ },
+ action() {
+ return this.javaApi + this.$api.processMethodSearchNew.importMethodSearchNew
+ }
+ },
+};
+</script>
+
+<style scoped>
+.view-title {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ height: 60px;
+ padding-left: 20px;
+}
+.search-background {
+ width: 100%;
+ height: 80px;
+ line-height: 80px;
+ background-color: #ffffff;
+ display: flex;
+}
+.search-group {
+ display: flex;
+ align-items: center;
+ margin: 0 20px;
+}
+.table {
+ margin-top: 20px;
+ background-color: #ffffff;
+ padding-top: 10px;
+}
+.table-tab {
+ margin: 0 10px 10px 14px;
+}
+.inline-upload {
+ display: inline-block;
+ vertical-align: middle;
+}
+</style>
--
Gitblit v1.9.3