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/outDocumenRecordt.vue | 520 +++++++++++++++++++++++++++++++++++----------------------
1 files changed, 319 insertions(+), 201 deletions(-)
diff --git a/src/views/CNAS/systemManagement/documentRecords/outDocumenRecordt.vue b/src/views/CNAS/systemManagement/documentRecords/outDocumenRecordt.vue
index 0bcdb64..1554a54 100644
--- a/src/views/CNAS/systemManagement/documentRecords/outDocumenRecordt.vue
+++ b/src/views/CNAS/systemManagement/documentRecords/outDocumenRecordt.vue
@@ -1,44 +1,34 @@
<template>
<!-- 澶栨潵鏂囦欢纭璁板綍 -->
- <div class="ExternalDocumentConfirmationRecords">
- <el-row class="title">
- <el-col :span="20" style="padding-left: 20px;text-align: left;">澶栨潵鏂囦欢纭璁板綍</el-col>
- </el-row>
- <el-tabs type="border-card" v-model="activeName" style="height: 100%;">
+ <div class="capacity-scope">
+ <el-tabs type="border-card" v-model="activeName" style="height: 100%;" @change="getTableData">
<el-tab-pane label="濉啓" name="濉啓" style="height: 100%;">
- <div style="display: flex;align-items: center;justify-content: flex-end;margin-right: 20px;">
- <el-button size="small" type="primary" @click="handleAdd0" style="margin-left: 20px;"
- 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;">
+ <div style="display: flex;align-items: center;justify-content: flex-end;margin-bottom: 10px">
+ <el-button size="small" type="primary" @click="openAdd('鏂板')" style="margin-left: 20px;">鏂板</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-left: 20px;">
<el-button size="small" type="primary" :loading="upLoading">瀵煎叆</el-button></el-upload>
</div>
- <div class="table" style="height: calc(100% - 200px)">
- <ValueTable ref="ValueTable0" :url="$api.manageRecordTotal.pageManageRecordVerify"
- :componentData="componentData0" :key="upIndex0" :delUrl="$api.manageRecordTotal.delManageRecordVerify"
- :upUrl="$api.manageRecordTotal.doManageRecordVerify" />
- </div>
+ <lims-table :tableData="tableData0" :column="column0" :page="page0" :tableLoading="tableLoading0"
+ :height="'calc(100vh - 290px)'" @pagination="pagination0"></lims-table>
</el-tab-pane>
<el-tab-pane label="鍘嗗彶璁板綍" name="鍘嗗彶璁板綍" style="height: 100%;">
- <div class="search">
- <div class="search_thing">
- <div class="search_label">骞达細</div>
- <div class="search_input">
- <el-date-picker v-model="componentData.entity.year" type="year" placeholder="閫夋嫨骞�" format="yyyy"
- value-format="yyyy" size="small" @change="refreshTable()">
+ <div>
+ <el-form :model="queryParams" ref="queryForm" size="small" :inline="true">
+ <el-form-item label="骞�" prop="year">
+ <el-date-picker v-model="queryParams.year" type="year" placeholder="閫夋嫨骞�" format="yyyy" value-format="yyyy"
+ size="small" @change="refreshTable()">
</el-date-picker>
- </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-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="table">
- <ValueTable ref="ValueTable" :url="$api.manageRecordTotal.pageManageRecordTotal"
- :componentData="componentData" :key="upIndex" />
- </div>
+ <lims-table :tableData="tableData" :column="column" :page="page" :tableLoading="tableLoading"
+ :height="'calc(100vh - 290px)'" @pagination="pagination"></lims-table>
</el-tab-pane>
</el-tabs>
<!-- 璇︽儏/涓嬭浇/瀹℃牳 -->
@@ -51,17 +41,64 @@
<el-button type="primary" @click="submitCheck('閫氳繃')" :loading="checkLoading">閫� 杩�</el-button>
</span>
</el-dialog>
+ <!-- 鏂板/缂栬緫 -->
+ <el-dialog :title="title" :visible.sync="addDia" width="500px">
+ <el-form :model="addForm" ref="addForm" :rules="addRules" label-position="right" label-width="120px">
+ <el-form-item label="澶栨潵鏂囦欢鍚嶇О" prop="documentName">
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addForm.documentName"></el-input>
+ </el-form-item>
+ <el-form-item label="鏂囦欢缂栧彿" prop="documentCode">
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addForm.documentCode">
+ </el-input>
+ </el-form-item>
+ <el-form-item label="鏍囧噯瑙勮寖鍚嶇О" prop="standardName">
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addForm.standardName">
+ </el-input>
+ </el-form-item>
+ <el-form-item label="鏍囧噯鍙�" prop="standardCode">
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addForm.standardCode">
+ </el-input>
+ </el-form-item>
+ <el-form-item label="鐢熸晥鏃ユ湡" prop="effectiveDate">
+ <el-date-picker v-model="addForm.effectiveDate" format="yyyy-MM-dd" placeholder="閫夋嫨鏃ユ湡" size="small"
+ style="width: 100%" type="date" value-format="yyyy-MM-dd">
+ </el-date-picker>
+ </el-form-item>
+ <el-form-item label="浣滃簾鏃ユ湡" prop="cancelDate">
+ <el-date-picker v-model="addForm.cancelDate" format="yyyy-MM-dd" placeholder="閫夋嫨鏃ユ湡" size="small"
+ style="width: 100%" type="date" value-format="yyyy-MM-dd">
+ </el-date-picker>
+ </el-form-item>
+ <el-form-item label="澶囨敞" prop="note">
+ <el-input size="small" placeholder="璇疯緭鍏�" type="textarea" :rows="2" clearable v-model="addForm.note">
+ </el-input>
+ </el-form-item>
+ </el-form>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="addDia = false">鍙� 娑�</el-button>
+ <el-button :loading="uploading" type="primary" @click="submitProduct('addForm')">纭� 璁�</el-button>
+ </span>
+ </el-dialog>
</div>
</template>
<script>
+import limsTable from "@/components/Table/lims-table.vue";
import filePreview from '@/components/Preview/filePreview.vue'
-import ValueTable from '@/components/Table/value-table.vue'
-import { getToken } from "@/utils/auth";
+import {
+ addManageRecordVerify,
+ pageManageRecordVerify,
+ submitManageRecordTotal,
+ ratifyManageRecordTotal,
+ delManageRecordVerify,
+ pageManageRecordTotal,
+ doManageRecordVerify
+} from '@/api/cnas/systemManagement/documentRecords.js'
export default {
+ name: 'OutDocumenRecordt',
components: {
- ValueTable,
filePreview,
+ limsTable,
},
data() {
return {
@@ -70,158 +107,205 @@
lookDialogVisible: false,
noCheckLoading: false,
checkLoading: false,
- componentData: {
- entity: {
- year: null,
- orderBy: {
- field: 'id',
- order: 'desc'
- }
- },
- isIndex: true,
- showSelect: false,
- select: false,
- do: [{
- id: 'handleLook',
- font: '鏌ョ湅',
- type: 'text',
- method: 'handleLook',
- disabFun: (row, index) => {
- return !row.url
- }
- }, {
- id: 'handleDown0',
- font: '涓嬭浇',
- type: 'text',
- method: 'handleDown0',
- disabFun: (row, index) => {
- return !row.url
- }
- },
- {
- id: 'handleSubmit',
- font: '鎻愪氦',
- type: 'text',
- method: 'handleSubmit',
- disabFun: (row, index) => {
- return !!row.submitUserName
- }
- }, {
- id: 'handleApproval',
- font: '鎵瑰噯',
- type: 'text',
- method: 'handleApproval',
- disabFun: (row, index) => {
- return !row.submitUserName || !!row.ratifyUserName
- }
- }],
- tagField: {},
- selectField: {},
- requiredAdd: [],
- requiredUp: [],
- needSort: [],
- inputType: ''
- },
- // 鏍峰搧鍒楄〃
- componentData0: {
- entity: {
- manageRecordTotalId: null,
- orderBy: {
- field: 'id',
- order: 'desc'
- }
- },
- isIndex: true,
- showSelect: false,
- select: false,
- do: [{
- id: 'update',
- font: '淇敼',
- type: 'text',
- method: 'doDiy'
- }, {
- id: 'delete',
- font: '鍒犻櫎',
- type: 'text',
- method: 'doDiy'
- }],
- tagField: {},
- selectField: {},
- requiredAdd: ['documentName', 'documentCode'],
- requiredUp: ['documentName', 'documentCode'],
- datePicker: ['effectiveDate', 'cancelDate'],
- needSort: [],
- inputType: ''
- },
- upIndex0: 100,
- entityCopy: {},
- upIndex: 0,
addPower: true,
upPower: true,
currentInfo: {},
upLoading: false,
+ queryParams: {},
+ tableData: [],
+ column: [
+ { label: "骞翠唤", prop: "year" },
+ { label: "鎬绘暟閲�", prop: "totalNum", width: "120px" },
+ {
+ label: "鎷熷埗浜�",
+ prop: "submitUserName",
+ },
+ { label: "鎷熷埗鏃ユ湡", prop: "submitDate" },
+ { label: "鎵瑰噯浜�", prop: "ratifyUserName" },
+ { label: "鎵瑰噯鏃ユ湡", prop: "ratifyDate" },
+ { label: "鎵瑰噯缁撴灉", prop: "ratifyState" },
+ {
+ dataType: "action",
+ fixed: "right",
+ label: "鎿嶄綔",
+ operation: [
+ {
+ name: "鏌ョ湅",
+ type: "text",
+ clickFun: (row) => {
+ this.handleLook(row);
+ },
+ disabled: (row) => {
+ return !row.url
+ },
+ },
+ {
+ name: "涓嬭浇",
+ type: "text",
+ clickFun: (row) => {
+ this.handleDown0(row);
+ },
+ disabled: (row) => {
+ return !row.url
+ },
+ },
+ {
+ name: "鎻愪氦",
+ type: "text",
+ clickFun: (row) => {
+ this.handleSubmit(row);
+ },
+ disabled: (row) => {
+ return !!row.submitUserName
+ },
+ },
+ {
+ name: "鎵瑰噯",
+ type: "text",
+ clickFun: (row) => {
+ this.handleApproval(row);
+ },
+ disabled: (row) => {
+ return !row.submitUserName || !!row.ratifyUserName
+ },
+ },
+ ],
+ },
+ ],
+ page: {
+ total: 0,
+ size: 10,
+ current: 0,
+ },
+ tableLoading: false,
+ tableData0: [],
+ column0: [
+ { label: "澶栨潵鏂囦欢鍚嶇О", prop: "documentName" },
+ { label: "鏂囦欢缂栧彿", prop: "documentCode", width: "120px" },
+ {
+ label: "鏍囧噯瑙勮寖鍚嶇О",
+ prop: "standardName",
+ },
+ { label: "鏍囧噯鍙�", prop: "standardCode" },
+ { label: "鐢熸晥鏃ユ湡", prop: "effectiveDate" },
+ { label: "浣滃簾鏃ユ湡", prop: "cancelDate" },
+ { label: "澶囨敞", prop: "note" },
+ {
+ dataType: "action",
+ fixed: "right",
+ label: "鎿嶄綔",
+ operation: [
+ {
+ name: "缂栬緫",
+ type: "text",
+ clickFun: (row) => {
+ this.openAdd("缂栬緫", row);
+ },
+ },
+ {
+ name: "鍒犻櫎",
+ type: "text",
+ clickFun: (row) => {
+ this.handleDelete(row);
+ },
+ },
+ ],
+ },
+ ],
+ page0: {
+ total: 0,
+ size: 10,
+ current: 0,
+ },
+ tableLoading0: false,
+ title: '鏂板',
+ addForm: {},
+ addDia: false,
+ addRules: {
+ documentName: [{ required: true, message: "璇疯緭鍏ュ鏉ユ枃浠跺悕绉�", trigger: "blur" }],
+ documentCode: [
+ { required: true, message: "璇疯緭鍏ユ枃浠剁紪鍙�", trigger: "blur" },
+ ],
+ },
+ uploading: false,
}
},
// 鐢ㄤ簬涓婁紶鏂囦欢鐨勪俊鎭�
computed: {
- headers() {
- return {
- 'Authorization': "Bearer " + getToken()
- }
- },
action() {
- return this.javaApi + this.$api.manageRecordTotal.exportManageRecordVerify
+ return this.javaApi + '/manageRecordVerify/exportManageRecordVerify'
}
},
mounted() {
- this.entityCopy = this.HaveJson(this.componentData.entity);
- this.getPower()
+ this.getTableData();
},
methods: {
- getPower() {
- let power = JSON.parse(sessionStorage.getItem('power'))
- let add = false
- let del = false
- let up = false;
- let sub = false
- let ratify = false
- for (var i = 0; i < power.length; i++) {
- if (power[i].menuMethod == 'addManageRecordVerify') {
- add = true
- }
- if (power[i].menuMethod == 'delManageRecordVerify') {
- del = true
- }
- if (power[i].menuMethod == 'exportManageRecordVerify') {
- up = true
- }
- if (power[i].menuMethod == 'submitManageRecordTotal') {
- sub = true
- }
- if (power[i].menuMethod == 'ratifyManageRecordTotal') {
- ratify = true
- }
+ getTableData() {
+ if (this.activeName === '濉啓') {
+ this.getList0()
+ } else {
+ this.getList()
}
- if (!ratify) {
- this.componentData.do.splice(3, 1)
- }
- if (!sub) {
- this.componentData.do.splice(2, 1)
- }
- if (!del) {
- this.componentData0.do.splice(1, 1)
- }
- if (!add) {
- this.componentData0.do.splice(0, 1)
- }
- this.addPower = add
- this.upPower = up
},
- handleAdd0() {
- this.$refs.ValueTable0.openAddDia(this.$api.manageRecordTotal.addManageRecordVerify);
+ openAdd(title, row) {
+ this.title = title;
+ if (row) {
+ this.addForm = row;
+ } else {
+ this.addForm = {};
+ }
+ this.addDia = true;
+ },
+ getList() {
+ this.tableLoading = true;
+ let param = { ...this.queryParams, ...this.page };
+ delete param.total;
+ pageManageRecordTotal({ ...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();
+ },
+ getList0() {
+ this.tableLoading0 = true;
+ let param = { ...this.page0 };
+ delete param.total;
+ pageManageRecordVerify({ ...param })
+ .then((res) => {
+ this.tableLoading0 = false;
+ if (res.code === 200) {
+ this.tableData0 = res.data.records;
+ this.page0.total = res.data.total;
+ }
+ })
+ .catch((err) => {
+ this.tableLoading0 = false;
+ });
+ },
+ pagination0({ page, limit }) {
+ this.page0.current = page;
+ this.page0.size = limit;
+ this.getList0();
+ },
+ refresh() {
+ this.queryParams = {};
+ this.page.current = 1;
+ this.getList();
},
refreshTable() {
- this.refreshTable()()
+ this.page.current = 1;
+ this.getList();
},
beforeUpload(file) {
if (file.size > 1024 * 1024 * 10) {
@@ -241,15 +325,10 @@
this.upLoading = false;
if (response.code == 200) {
this.$message.success('涓婁紶鎴愬姛');
- this.$refs['ValueTable0'].selectList()
+ this.getList0();
} else {
this.$message.error('涓婁紶澶辫触');
}
- },
- refresh() {
- this.componentData.entity = this.HaveJson(this.entityCopy)
- this.upIndex++
- this.refreshTable()
},
submitCheck(type) { },
// 鏌ョ湅
@@ -260,19 +339,12 @@
// 鍏敤鏂规硶
commonFun(row, callbanck) {
this.currentInfo = row
- this.componentData0.entity.manageRecordTotalId = row.id
- this.$axios.post(this.$api.manageRecordTotal.pageManageRecordVerify, {
- entity: this.componentData0.entity,
- page: {
- current: -1,
- size: -1
- }
- }, {
- headers: {
- 'Content-Type': 'application/json'
- }, noQs: true
+ pageManageRecordVerify({
+ current: -1,
+ size: -1,
+ manageRecordTotalId: row.id
}).then(res => {
- this.currentInfo.arr = res.data.body.records
+ this.currentInfo.arr = res.data.records
this.lookDialogVisible = true
if (callbanck) {
callbanck()
@@ -280,11 +352,7 @@
}).catch(err => { });
},
handleDown0(row) {
- let url = this.javaApi + 'word/' + row.url
- const link = document.createElement('a');
- link.href = url;
- link.download = row.month + ' 澶栨潵鏂囦欢纭璁板綍';
- link.click();
+ this.$download.saveAs(row.url, '澶栨潵鏂囦欢纭璁板綍')
},
// 鎻愪氦
handleSubmit(row) {
@@ -293,14 +361,14 @@
cancelButtonText: '鍙栨秷',
type: 'warning'
}).then(() => {
- this.$axios.post(this.$api.manageRecordTotal.submitManageRecordTotal, {
+ submitManageRecordTotal({
id: row.id
}).then(res => {
this.$message({
type: 'success',
message: '鎻愪氦鎴愬姛!'
});
- this.refreshTable()()
+ this.refreshTable()
}).catch(err => { });
})
},
@@ -316,20 +384,71 @@
} else {
this.noCheckLoading = true
}
- this.$axios.post(this.$api.manageRecordTotal.ratifyManageRecordTotal, {
+ ratifyManageRecordTotal({
id: this.currentInfo.id,
ratifyState: state
}).then(res => {
this.checkLoading = false
this.noCheckLoading = false
- if (res.code === 201) return
this.$message({
type: 'success',
message: '鎿嶄綔鎴愬姛!'
});
- this.refreshTable()()
+ this.refreshTable()
this.lookDialogVisible = false
}).catch(err => { });
+ },
+ handleDelete(row) {
+ this.$confirm("鏄惁鍒犻櫎璇ユ潯鏁版嵁?", "鎻愮ず", {
+ confirmButtonText: "纭畾",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
+ .then(() => {
+ delManageRecordVerify({ id: row.id }).then((res) => {
+ this.$message.success("鍒犻櫎鎴愬姛");
+ this.getList0()
+ });
+ })
+ .catch(() => { });
+ },
+ submitProduct(formName) {
+ this.$refs[formName].validate((valid) => {
+ if (valid) {
+ this.uploading = true;
+ if (this.title == "鏂板") {
+ addManageRecordVerify(this.addForm)
+ .then((res) => {
+ this.uploading = false;
+ if (res.code != 200) {
+ return;
+ }
+ this.$message.success("鎻愪氦鎴愬姛");
+ this.getList0()
+ this.addDia = false;
+ })
+ .catch((err) => {
+ this.uploading = false;
+ });
+ } else {
+ doManageRecordVerify(this.addForm)
+ .then((res) => {
+ this.uploading = false;
+ if (res.code != 200) {
+ return;
+ }
+ this.$message.success("鎻愪氦鎴愬姛");
+ this.getList0()
+ this.addDia = false;
+ })
+ .catch((err) => {
+ this.uploading = false;
+ });
+ }
+ } else {
+ return false;
+ }
+ });
},
}
}
@@ -356,7 +475,7 @@
}
.search_label {
- width: 110px;
+ width: 30px;
font-size: 14px;
text-align: right;
}
@@ -367,9 +486,8 @@
.table {
background-color: #fff;
- width: calc(100% - 40px);
- height: calc(100% - 60px - 140px);
- padding: 20px;
+ height: 100%;
+ margin-top: 10px;
}
>>>.el-tabs__content {
--
Gitblit v1.9.3