From a33907b698d54eda47449f912070f482a6ae066f Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期五, 26 九月 2025 15:37:59 +0800
Subject: [PATCH] 原材料订单拆分功能调整v2
---
src/views/CNAS/systemManagement/documentRecords/distributionCollectionRecord.vue | 412 +++++++++++++++++++++++++++-------------------------------
1 files changed, 191 insertions(+), 221 deletions(-)
diff --git a/src/views/CNAS/systemManagement/documentRecords/distributionCollectionRecord.vue b/src/views/CNAS/systemManagement/documentRecords/distributionCollectionRecord.vue
index 9be00a1..aabb2dc 100644
--- a/src/views/CNAS/systemManagement/documentRecords/distributionCollectionRecord.vue
+++ b/src/views/CNAS/systemManagement/documentRecords/distributionCollectionRecord.vue
@@ -1,40 +1,35 @@
<template>
<!-- 鎵�鏈夋枃浠讹紙鍐呫�佸閮ㄦ枃浠讹級鐨勫彂鏀句笌鍥炴敹璁板綍 -->
- <div class="DistributionRetrievalRecordsAllDocuments">
- <el-row class="title">
- <el-col :span="12" style="padding-left: 20px;text-align: left;">鎵�鏈夋枃浠讹紙鍐呫�佸閮ㄦ枃浠讹級鐨勫彂鏀句笌鍥炴敹璁板綍</el-col>
- <el-col :span="12" style="text-align: right;">
- <el-button size="medium" type="primary" @click="openAdd" v-if="addPower">鏂板</el-button>
- <el-upload :action="action" :multiple="false" :show-file-list="false" accept='.doc,.docx' :headers="headers"
- :on-change="beforeUpload" :on-error="onError" ref='upload' v-if="upPower" :on-success="handleSuccessUp"
- style="display:inline-block;margin-left: 20px;">
- <el-button type="primary" size="medium">瀵煎叆</el-button></el-upload>
- <el-button size="medium" type="primary" @click="handleDown" :loading="outLoading" v-if="outPower"
- style="display:inline-block;margin-left: 20px;">瀵煎嚭</el-button>
- </el-col>
- </el-row>
+ <div class="capacity-scope">
<div class="search">
- <div class="search_thing">
- <div class="search_label">鏂囦欢鍚嶇О锛�</div>
- <div class="search_input"><el-input size="small" placeholder="璇疯緭鍏�" clearable
- v-model="componentData.entity.documentName" @keyup.enter.native="refreshTable()"></el-input></div>
+ <div>
+ <el-form :model="queryParams" ref="queryForm" size="small" :inline="true">
+ <el-form-item label="鏂囦欢鍚嶇О" prop="documentName">
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="queryParams.documentName"
+ @keyup.enter.native="refreshTable()"></el-input>
+ </el-form-item>
+ <el-form-item label="鏂囦欢缂栧彿" prop="documentCode">
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="queryParams.documentCode"
+ @keyup.enter.native="refreshTable()"></el-input>
+ </el-form-item>
+ <el-form-item>
+ <el-button type="primary" size="mini" @click="refreshTable">鏌ヨ</el-button>
+ <el-button size="mini" @click="refresh">閲嶇疆</el-button>
+ </el-form-item>
+ </el-form>
</div>
- <div class="search_thing">
- <div class="search_label">鏂囦欢缂栧彿锛�</div>
- <div class="search_input">
- <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="componentData.entity.documentCode"
- @keyup.enter.native="refreshTable()"></el-input>
- </div>
- </div>
- <div class="search_thing" style="padding-left: 30px;">
- <el-button size="small" @click="refresh()">閲� 缃�</el-button>
- <el-button size="small" type="primary" @click="refreshTable()">鏌� 璇�</el-button>
+ <div>
+ <el-button size="small" type="primary" @click="openAdd">鏂板</el-button>
+ <el-upload :action="action" :multiple="false" :show-file-list="false" accept='.doc,.docx'
+ :headers="uploadHeader" :on-change="beforeUpload" :on-error="onError" ref='upload'
+ :on-success="handleSuccessUp" style="display:inline-block;margin: 0 8px;">
+ <el-button type="primary" size="small">瀵煎叆</el-button></el-upload>
+ <el-button size="small" type="primary" @click="handleDown" :loading="outLoading">瀵煎嚭</el-button>
</div>
</div>
<div class="table">
- <ValueTable ref="ValueTable" :url="$api.manageRecordIssueRecycle.pageManageRecordIssueRecycle"
- :delUrl="$api.manageRecordIssueRecycle.delManageRecordIssueRecycle" :componentData="componentData"
- :upUrl="$api.manageRecordIssueRecycle.doManageRecordIssueRecycle" :key="upIndex" />
+ <lims-table :tableData="tableData" :column="column" :page="page" :tableLoading="tableLoading"
+ :height="'calc(100vh - 260px)'" @pagination="pagination"></lims-table>
</div>
<el-dialog :title="title" :visible.sync="addDialogVisible" width="400px" top="6vh">
<el-row>
@@ -133,14 +128,29 @@
</template>
<script>
-import ValueTable from '@/components/Table/value-table.vue'
+import limsTable from "@/components/Table/lims-table.vue";
import {
getYearAndMonthAndDays
} from '@/utils/date'
-import { getToken } from "@/utils/auth";
+import {
+ selectUserCondition,
+} from "@/api/business/inspectionTask.js";
+import {
+ exportOutManageRecordIssueRecycle,
+ doManageRecordIssueRecycle,
+ addManageRecordIssueRecycle,
+ selectCNSAPersonTree,
+ pageManageRecordIssueRecycle,
+ delManageRecordIssueRecycle,
+} from '@/api/cnas/systemManagement/documentRecords.js'
+import {
+ pageManageDocumentList,
+} from '@/api/cnas/systemManagement/documentControl.js'
+import { mapGetters } from "vuex";
export default {
+ name: 'DistributionCollectionRecord',
components: {
- ValueTable
+ limsTable
},
data() {
return {
@@ -149,140 +159,95 @@
upPower: true,
outLoading: false,
addLoading: false,
- componentData: {
- entity: {
- documentName: null,
- documentCode: null,
- orderBy: {
- field: 'id',
- order: 'desc'
- }
- },
- isIndex: true,
- showSelect: false,
- select: false,
- // selectMethod: 'handleChangeTask',
- do: [{
- id: 'delete',
- font: '鍒犻櫎',
- type: 'text',
- method: 'doDiy',
- disabFun: (row, index) => {
- return !!row.signedUser
- }
- }, {
- id: 'handleEdit',
- font: '淇敼',
- type: 'text',
- method: 'handleEdit',
- field: [],
- disabFun: (row, index) => {
- return !!row.signedUser
- }
- }, {
- id: 'handleBack',
- font: '鍥炴敹',
- type: 'text',
- method: 'handleBack',
- disabFun: (row, index) => {
- return !!row.signedUser
- }
- }],
- tagField: {
- // documentType:{
- // select: []
- // },
- // receiveUserName:{
- // select: []
- // },
- },
- selectField: {
- // documentType:{
- // select: []
- // },
- // receiveUserName:{
- // select: []
- // },
- },
- addUpload: ['signatoryUrl'],
- requiredAdd: [],
- requiredUp: [],
- datePicker: ['receiveDate'],
- noHead: ['signedUserName', 'signedDate', 'departLims'],//涓嶅弬涓庢柊澧炵紪杈戠殑瀛楁
- needSort: [],
- inputType: ''
- },
- entityCopy: {},
- upIndex: 0,
title: '鏂板',
addDialogVisible: false,
addInfo: {},
personList: [],
fileType: [],
fileList: [],
- list: []
+ list: [],
+ queryParams: {},
+ tableData: [],
+ column: [
+ { label: "鏂囦欢缂栧彿", prop: "documentCode" },
+ { label: "鏂囦欢鍚嶇О", prop: "documentName", width: "120px" },
+ {
+ label: "鐗堝彿",
+ prop: "documentVersion",
+ },
+ { label: "浠芥暟", prop: "pages" },
+ { label: "鏂囦欢绫诲埆", prop: "documentType" },
+ { label: "鍒嗗彂鍙�", prop: "number" },
+ { label: "鎺ュ彈浜�", prop: "receiveUserName" },
+ { label: "鎺ユ敹閮ㄩ棬", prop: "departLims" },
+ { label: "鎺ュ彈鏃ユ湡", prop: "receiveDate" },
+ { label: "绛炬敹浜�", prop: "signedUserName" },
+ { label: "绛炬敹鏃ユ湡", prop: "signedDate" },
+ {
+ dataType: "action",
+ fixed: "right",
+ label: "鎿嶄綔",
+ operation: [
+ {
+ name: "缂栬緫",
+ type: "text",
+ clickFun: (row) => {
+ this.handleEdit(row);
+ },
+ disabled: (row) => {
+ return !!row.signedUser
+ },
+ },
+ {
+ name: "鍥炴敹",
+ type: "text",
+ clickFun: (row) => {
+ this.handleBack(row);
+ },
+ disabled: (row) => {
+ return !!row.signedUser
+ },
+ },
+ {
+ name: "鍒犻櫎",
+ type: "text",
+ clickFun: (row) => {
+ this.handleDelete(row);
+ },
+ disabled: (row) => {
+ return !!row.signedUser
+ },
+ },
+ ],
+ },
+ ],
+ page: {
+ total: 0,
+ size: 10,
+ current: 0,
+ },
+ tableLoading: false,
}
},
// 鐢ㄤ簬涓婁紶鏂囦欢鐨勪俊鎭�
computed: {
- headers() {
- return {
- 'Authorization': "Bearer " + getToken()
- }
- },
action() {
- return this.javaApi + this.$api.manageRecordIssueRecycle.exportInManageRecordIssueRecycle
- }
+ return this.javaApi + '/manageRecordIssueRecycle/exportInManageRecordIssueRecycle'
+ },
+ ...mapGetters(["userId"]),
},
mounted() {
- this.entityCopy = this.HaveJson(this.componentData.entity);
- this.getPower()
+ // this.entityCopy = this.HaveJson(this.componentData.entity);
+ this.getList()
this.getAuthorizedPerson()
this.selectEnumByCategory()
this.getFileList()
- this.selectTreeList()
+ // TODO 閮ㄩ棬鎺ュ彛闇�瑕侀噸鍐�
+ // this.selectTreeList()
},
methods: {
- getPower() {
- let power = JSON.parse(sessionStorage.getItem('power'))
- let add = false
- let del = false
- let up = false;
- let out = false;
- let edit = false
- for (var i = 0; i < power.length; i++) {
- if (power[i].menuMethod == 'addManageRecordIssueRecycle') {
- add = true
- }
- if (power[i].menuMethod == 'delManageRecordIssueRecycle') {
- del = true
- }
- if (power[i].menuMethod == 'exportInManageRecordIssueRecycle') {
- up = true
- }
- if (power[i].menuMethod == 'doManageRecordIssueRecycle') {
- edit = true
- }
- if (power[i].menuMethod == 'exportOutManageRecordIssueRecycle') {
- out = true
- }
- }
- if (!add) {
- this.componentData.do.splice(2, 1)
- }
- if (!add) {
- this.componentData.do.splice(1, 1)
- }
- if (!del) {
- this.componentData.do.splice(0, 1)
- }
- this.addPower = add
- this.outPower = out
- this.upPower = up
- },
// 鏂板
openAdd() {
- // this.$refs.ValueTable.openAddDia(this.$api.manageRecordIssueRecycle.addManageRecordIssueRecycle);
this.addInfo = {}
this.title = '鏂板'
this.addDialogVisible = true;
@@ -295,27 +260,43 @@
// 瀵煎嚭
handleDown() {
this.outLoading = true
- this.$axios.post(this.$api.manageRecordIssueRecycle.exportOutManageRecordIssueRecycle, { entity: this.componentData.entity }, { headers: { 'Content-Type': 'application/json' } }).then(res => {
+ exportOutManageRecordIssueRecycle(this.queryParams).then(res => {
this.outLoading = false
- if (res.code == 201) return this.$message.error('瀵煎嚭澶辫触')
- this.$message.success('瀵煎嚭鎴愬姛')
- let url = this.javaApi + 'word/' + res.message
- const link = document.createElement('a');
- link.href = url;
- link.download = '鏂囦欢鍙戞斁涓庡洖鏀惰褰�';
- link.click();
+ this.$download.saveAs(res.data, '鏂囦欢鍙戞斁涓庡洖鏀惰褰�')
})
},
- refreshTable() {
- this.refreshTable()()
+ getList() {
+ this.tableLoading = true;
+ let param = { ...this.queryParams, ...this.page };
+ delete param.total;
+ pageManageRecordIssueRecycle({ ...param })
+ .then((res) => {
+ this.tableLoading = false;
+ if (res.code === 200) {
+ this.tableData = res.data.records;
+ this.page.total = res.data.total;
+ }
+ })
+ .catch((err) => {
+ this.tableLoading = false;
+ });
+ },
+ pagination({ page, limit }) {
+ this.page.current = page;
+ this.page.size = limit;
+ this.getList();
},
refresh() {
- this.componentData.entity = this.HaveJson(this.entityCopy)
- this.upIndex++
- this.refreshTable()
+ this.queryParams = {};
+ this.page.current = 1;
+ this.getList();
+ },
+ refreshTable() {
+ this.page.current = 1;
+ this.getList();
},
getAuthorizedPerson() {
- this.$axios.get(this.$api.user.getUserMenu).then(res => {
+ selectUserCondition().then(res => {
let data = []
res.data.forEach(a => {
data.push({
@@ -323,8 +304,6 @@
value: a.id
})
})
- // this.componentData.tagField.receiveUserName.select = data
- // this.componentData.selectField.receiveUserName.select = data
this.personList = data
})
},
@@ -346,39 +325,24 @@
this.upLoading = false;
if (response.code == 200) {
this.$message.success('涓婁紶鎴愬姛');
- this.refreshTable()()
+ this.refreshTable()
} else {
this.$message.error('涓婁紶澶辫触');
}
},
selectEnumByCategory() {
- this.$axios.post(this.$api.enums.selectEnumByCategory, {
- category: "鏂囦欢绫诲埆"
- }).then(res => {
- // this.componentData.tagField.documentType.select = res.data
- // this.componentData.selectField.documentType.select = res.data
- this.fileType = res.data
- })
+ // 鏂囦欢绫诲埆
+ this.getDicts("document_type").then((response) => {
+ this.fileType = this.dictToValue(response.data);
+ });
},
// 鑾峰彇鏂囦欢鍒楄〃--鏂囦欢娓呭崟
getFileList() {
- this.$axios.post(this.$api.manageDocumentList.pageManageDocumentList, {
- entity: {
- orderBy: {
- field: 'createTime',
- order: 'desc'
- }
- },
- page: {
- current: -1,
- size: -1
- }
- }, {
- headers: {
- 'Content-Type': 'application/json'
- }
+ pageManageDocumentList({
+ current: -1,
+ size: -1
}).then(res => {
- this.fileList = res.data.body.records.map(m => {
+ this.fileList = res.data.records.map(m => {
m.title = m.documentCode
return m
})
@@ -402,18 +366,27 @@
let { id, documentCode, documentName, documentVersion, pages, documentType, number, receiveUser, receiveDate, departLims } = this.addInfo
obj = { id, documentCode, documentName, documentVersion, pages, documentType, number, receiveUser, receiveDate, departLims }
}
- this.$axios.post(this.$api.manageRecordIssueRecycle[this.title == '鏂板' ? 'addManageRecordIssueRecycle' : 'doManageRecordIssueRecycle'], obj, { headers: { 'Content-Type': 'application/json' }, noQs: true }).then(res => {
- this.addLoading = false
- if (res.code == 201) {
- return
- }
- this.addDialogVisible = false
- this.$message({
- type: 'success',
- message: '鎿嶄綔鎴愬姛!'
- });
- this.refreshTable()
- }).catch(err => { })
+ if (this.title == '鏂板') {
+ addManageRecordIssueRecycle(obj).then(res => {
+ this.addLoading = false
+ this.addDialogVisible = false
+ this.$message({
+ type: 'success',
+ message: '鎿嶄綔鎴愬姛!'
+ });
+ this.refreshTable()
+ }).catch(err => { })
+ } else {
+ doManageRecordIssueRecycle(obj).then(res => {
+ this.addLoading = false
+ this.addDialogVisible = false
+ this.$message({
+ type: 'success',
+ message: '鎿嶄綔鎴愬姛!'
+ });
+ this.refreshTable()
+ }).catch(err => { })
+ }
},
// 鍥炴敹
handleBack(row) {
@@ -424,12 +397,9 @@
}).then(() => {
let obj = {}
let { id, documentCode, documentName, documentVersion, pages, documentType, number, receiveUser, receiveDate, departLims } = row
- obj = { id, documentCode, documentName, documentVersion, pages, documentType, number, receiveUser, receiveDate, departLims, signedDate: getYearAndMonthAndDays(), signedUser: JSON.parse(localStorage.getItem("user")).userId }
- this.$axios.post(this.$api.manageRecordIssueRecycle.doManageRecordIssueRecycle, obj, { headers: { 'Content-Type': 'application/json' }, noQs: true }).then(res => {
+ obj = { id, documentCode, documentName, documentVersion, pages, documentType, number, receiveUser, receiveDate, departLims, signedDate: getYearAndMonthAndDays(), signedUser: this.userId }
+ doManageRecordIssueRecycle(obj).then(res => {
this.addLoading = false
- if (res.code == 201) {
- return
- }
this.addDialogVisible = false
this.$message({
type: 'success',
@@ -441,25 +411,33 @@
},
// 鏌ヨ鏍戝舰鍒楄〃
selectTreeList() {
- this.$axios.get(this.$api.personnel.selectCNSAPersonTree).then((res) => {
+ selectCNSAPersonTree().then((res) => {
this.list = res.data[0].children;
});
+ },
+ handleDelete(row) {
+ this.$confirm("鏄惁鍒犻櫎璇ユ潯鏁版嵁?", "鎻愮ず", {
+ confirmButtonText: "纭畾",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
+ .then(() => {
+ delManageRecordIssueRecycle({ id: row.id }).then((res) => {
+ this.$message.success("鍒犻櫎鎴愬姛");
+ this.refresh();
+ });
+ })
+ .catch(() => { });
},
}
}
</script>
<style scoped>
-.title {
- height: 60px;
- line-height: 60px;
-}
-
.search {
- background-color: #fff;
- height: 80px;
+ height: 46px;
display: flex;
- align-items: center;
+ justify-content: space-between;
}
.search_thing {
@@ -476,13 +454,5 @@
.search_input {
width: calc(100% - 110px);
-}
-
-.table {
- margin-top: 10px;
- background-color: #fff;
- width: calc(100% - 40px);
- height: calc(100% - 60px - 80px - 10px - 40px);
- padding: 20px;
}
</style>
--
Gitblit v1.9.3