From 572513916ac83d8a0b5c685f369006a3cb3afdcd Mon Sep 17 00:00:00 2001
From: chenrui <1187576398@qq.com>
Date: 星期四, 27 二月 2025 14:54:02 +0800
Subject: [PATCH] 服务和供应品采购代码迁移
---
src/api/cnas/externalService/serviceAndSupplyPro/serviceAndSupplyPro.js | 220 +++++++
src/views/CNAS/externalService/serviceAndSupplyPro/component/Edit.vue | 252 ++++++++
src/views/CNAS/externalService/serviceAndSupplyPro/component/ConsumableList.vue | 240 +++++++
src/views/CNAS/externalService/serviceAndSupplyPro/component/Store.vue | 468 +++++++++++++++
src/views/CNAS/externalService/serviceAndSupplyPro/component/AddProject.vue | 97 +++
src/views/CNAS/externalService/serviceAndSupplyPro/component/ConsumableOverview.vue | 1
src/views/CNAS/externalService/serviceAndSupplyPro/component/contents.vue | 312 ++++++++++
src/views/CNAS/externalService/serviceAndSupplyPro/index.vue | 53
src/views/CNAS/externalService/serviceAndSupplyPro/component/ConsumableProject.vue | 164 +++++
9 files changed, 1,780 insertions(+), 27 deletions(-)
diff --git a/src/api/cnas/externalService/serviceAndSupplyPro/serviceAndSupplyPro.js b/src/api/cnas/externalService/serviceAndSupplyPro/serviceAndSupplyPro.js
index 890fb4e..2a0d5ca 100644
--- a/src/api/cnas/externalService/serviceAndSupplyPro/serviceAndSupplyPro.js
+++ b/src/api/cnas/externalService/serviceAndSupplyPro/serviceAndSupplyPro.js
@@ -8,3 +8,223 @@
params: query
})
}
+
+export function deleteProcurementSuppliesList(query) {
+ return request({
+ url: '/procurementSuppliesList/deleteProcurementSuppliesList',
+ method: 'delete',
+ params: query
+ })
+}
+
+export function exportProcurementSuppliesList(query) {
+ return request({
+ url: "/procurementSuppliesList/exportProcurementSuppliesList",
+ method: "get",
+ responseType: "blob",
+ params: query,
+ });
+}
+
+export function addProcurementSuppliesList(query) {
+ return request({
+ url: '/procurementSuppliesList/addProcurementSuppliesList',
+ method: 'post',
+ data: query,
+ })
+}
+
+export function selectEnumByCategory(query) {
+ return request({
+ url: '/enum/selectEnumByCategory',
+ method: 'post',
+ data: query,
+ })
+}
+
+export function updateProcurementSuppliesList(query) {
+ return request({
+ url: '/procurementSuppliesList/updateProcurementSuppliesList',
+ method: 'post',
+ data: query,
+ })
+}
+
+// 鏈嶅姟鍜屼緵搴斿搧閲囪喘
+export function selectSupplierManagementAll(query) {
+ return request({
+ url: '/supplierManagement/selectSupplierManagementAll',
+ method: 'get',
+ params: query
+ })
+}
+
+export function addProcurementSuppliesExpends(query) {
+ return request({
+ url: '/procurementSuppliesExpends/addProcurementSuppliesExpends',
+ method: 'post',
+ data: query,
+ })
+}
+
+export function deleteProcurementSuppliesExpends(query) {
+ return request({
+ url: '/procurementSuppliesExpends/deleteProcurementSuppliesExpends',
+ method: 'delete',
+ params: query
+ })
+}
+
+export function procurementSuppliesExpendlist(query) {
+ return request({
+ url: '/procurementSuppliesExpends/procurementSuppliesExpendlist/',
+ method: 'get',
+ params: query
+ })
+}
+
+export function exportProcurementSuppliesStoreExcel(query) {
+ return request({
+ url: '/procurementSuppliesStore/exportExcel',
+ method: "get",
+ responseType: "blob",
+ params: query,
+ })
+}
+
+// 鏂板鑺傜偣
+export function addSuppliersDirectoryContents(query) {
+ return request({
+ url: '/suppliersDirectoryContents/addSuppliersDirectoryContents',
+ method: 'post',
+ data: query,
+ })
+}
+
+// 缂栬緫鑺傜偣
+export function updateSuppliersDirectoryContents(query) {
+ return request({
+ url: '/suppliersDirectoryContents/updateSuppliersDirectoryContents',
+ method: 'post',
+ data: query,
+ })
+}
+
+// 鍒犻櫎鑺傜偣
+export function deleteSuppliersDirectoryContentsById(query) {
+ return request({
+ url: '/suppliersDirectoryContents/deleteSuppliersDirectoryContentsById',
+ method: 'delete',
+ params: query
+ })
+}
+
+// 閲囪喘鐗╄祫鐩綍鍒犻櫎
+export function deleteProcurementSuppliesContentById(query) {
+ return request({
+ url: '/procurementSuppliesContents/deleteProcurementSuppliesContentById',
+ method: 'delete',
+ params: query
+ })
+}
+
+// 鏌ヨ鎵�鏈夎妭鐐�
+export function getSuppliersDirectoryContentsNodeNames(query) {
+ return request({
+ url: '/suppliersDirectoryContents/getSuppliersDirectoryContentsNodeNames',
+ method: 'get',
+ params: query
+ })
+}
+
+// 閲囪喘鐗╄祫鐩綍鑾峰彇鑺傜偣鍚嶇О
+export function getProcurementSuppliesContentsNodeNames(query) {
+ return request({
+ url: '/procurementSuppliesContents/getNodeNames',
+ method: 'get',
+ params: query
+ })
+}
+
+//鑾峰彇鐢ㄦ埛鍒楄〃
+export function selectUserCondition(query) {
+ return request({
+ url: "/system/newUser/selectUserCondition",
+ method: "get",
+ params: query,
+ });
+}
+
+// 閲囪喘鐗╄祫鐩綍璇︽儏
+export function selectProcurementSuppliesContentById(query) {
+ return request({
+ url: "/procurementSuppliesContents/selectProcurementSuppliesContentById",
+ method: "get",
+ params: query,
+ });
+}
+
+// 閲囪喘鐗╄祫鐩綍鍒楄〃
+export function directoryListing(query) {
+ return request({
+ url: "/procurementSuppliesContents/directoryListing",
+ method: "get",
+ params: query,
+ });
+}
+
+// 鑰楁潗鍏ュ簱淇敼
+export function updateStore(query) {
+ return request({
+ url: '/procurementSuppliesStore/updateStore',
+ method: 'post',
+ data: query,
+ })
+}
+
+// 鑰楁潗鍏ュ簱鏂板
+export function addStore(query) {
+ return request({
+ url: '/procurementSuppliesStore/addStore',
+ method: 'post',
+ data: query,
+ })
+}
+
+// 鏍规嵁id鏌ヨ鑰楁潗鍏ュ簱
+export function selectStoreById(query) {
+ return request({
+ url: "/procurementSuppliesStore/selectStoreById",
+ method: "get",
+ params: query,
+ });
+}
+
+// 鑰楁潗鍏ュ簱鍒楄〃
+export function storeList(query) {
+ return request({
+ url: "/procurementSuppliesStore/storeList",
+ method: "get",
+ params: query,
+ });
+}
+
+// 鑰楁潗鍏ュ簱鍒犻櫎
+export function deleteStore(query) {
+ return request({
+ url: '/procurementSuppliesStore/deleteStore',
+ method: 'delete',
+ params: query
+ })
+}
+
+// 閲囪喘鐗╄祫鐩綍鏂板
+export function addProcurementSuppliesContents(query) {
+ return request({
+ url: '/procurementSuppliesContents/addProcurementSuppliesContents',
+ method: 'post',
+ data: query,
+ })
+}
+
+
diff --git a/src/views/CNAS/externalService/serviceAndSupplyPro/component/AddProject.vue b/src/views/CNAS/externalService/serviceAndSupplyPro/component/AddProject.vue
new file mode 100644
index 0000000..326d5f4
--- /dev/null
+++ b/src/views/CNAS/externalService/serviceAndSupplyPro/component/AddProject.vue
@@ -0,0 +1,97 @@
+<template>
+ <el-dialog
+ :title="dialogTitle"
+ width="60%"
+ :visible.sync="dialogVisible"
+ >
+ <el-form :model="model" label-width="100px">
+ <el-col :span="12">
+ <el-form-item label="椤圭洰鍚嶇О">
+ <el-select
+ v-model="model.name"
+ placeholder="璇烽�夋嫨椤圭洰鍚嶇О"
+ style="width: 100%"
+ :disabled="row ? true:false"
+ @change="handleSelect"
+ >
+ <el-option
+ v-for="(v, i) in consumableOptions"
+ :label="v.consumablesName"
+ :value="v"
+ :key="i"
+ />
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="娑堣�楁暟閲�">
+ <el-input-number v-model="model.amount" :min="0" :step="1" placeholder="璇疯緭鍏ユ秷鑰楁暟閲�"></el-input-number>
+ </el-form-item>
+ </el-col>
+ </el-form>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="dialogVisible = false">鍙� 娑�</el-button>
+ <el-button type="primary" @click="sumbit">纭� 瀹�</el-button>
+ </span>
+ </el-dialog>
+</template>
+
+<script>
+
+import {
+ addProcurementSuppliesExpends,
+ procurementSuppliesList
+} from "@/api/cnas/externalService/serviceAndSupplyPro/serviceAndSupplyPro";
+
+export default {
+ data() {
+ return {
+ dialogTitle: "",
+ dialogVisible: false,
+ model: {
+ listId: undefined,
+ name: ""
+ },
+ consumableOptions: [],
+ row: undefined
+ }
+ },
+ created() {
+ this.fetchConsumableOptions()
+ },
+ methods: {
+ fetchConsumableOptions() {
+ procurementSuppliesList().then(res => {
+ if (res.code === 200) {
+ this.consumableOptions = res.data.records
+ }
+ })
+ },
+ openDialog(row) {
+ if(row) {
+ console.log(row, 'true')
+ this.dialogTitle = `${row.consumablesName}娣诲姞娑堣�楅」`
+ this.row = row
+ this.model.listId = row.id
+ this.model.name = row.consumablesName
+ } else {
+ this.dialogTitle = '娣诲姞娑堣�楅」'
+ }
+ this.dialogVisible = true
+ },
+ handleSelect(item) {
+ console.log(item)
+ this.model.listId = item.id
+ this.model.name = item.consumablesName
+ },
+ sumbit() {
+ addProcurementSuppliesExpends(this.model).then(res => {
+ if (res.code === 200) {
+ this.dialogVisible = false
+ this.$emit('submit')
+ }
+ })
+ }
+ }
+ }
+</script>
diff --git a/src/views/CNAS/externalService/serviceAndSupplyPro/component/ConsumableList.vue b/src/views/CNAS/externalService/serviceAndSupplyPro/component/ConsumableList.vue
new file mode 100644
index 0000000..189ccd3
--- /dev/null
+++ b/src/views/CNAS/externalService/serviceAndSupplyPro/component/ConsumableList.vue
@@ -0,0 +1,240 @@
+<template>
+ <div>
+ <TableCard :showTitle="false">
+ <template slot="form">
+ <div class="action-box">
+ <div></div>
+ <div class="flex">
+ <el-button icon="el-icon-plus" size="small" type="primary" @click="showDialog(undefined)">
+ 鏂板缓
+ </el-button>
+ <el-button icon="el-icon-upload2" size="small" @click="exportExcel">
+ 瀵煎嚭Excel
+ </el-button>
+ </div>
+ </div>
+ </template>
+ <template v-slot:table>
+ <limsTable
+ :column="columns"
+ :currentChange="rowClick"
+ :height="'25vh'"
+ :highlightCurrentRow="true"
+ :isSelection="false"
+ :rowStyle="tableRowStyle"
+ :table-data="tableData"
+ rowKey="id"
+ style="margin-top: 18px; padding: 0 15px;"
+ >
+ <template v-slot:consumablesTypeSlot="{row}">
+ {{ findType(row.consumablesType) }}
+ </template>
+ <template v-slot:operation="scope">
+ <el-button size="small" type="text" @click="showDialog(scope.row)">缂栬緫</el-button>
+ <el-button size="small" style="color: #f56c6c" type="text" @click="handleDelete(scope.row)">鍒犻櫎</el-button>
+ </template>
+ </limsTable>
+ <div class="pagination">
+ <div></div>
+ <el-pagination
+ :page-size="pagination.pageSize"
+ :page-sizes="[10, 20, 30, 40]"
+ :total="pagination.total"
+ layout="total, sizes, prev, pager, next, jumper"
+ @current-change="handleCurrent"
+ @size-change="handleSize"
+ >
+ </el-pagination>
+ </div>
+ </template>
+ </TableCard>
+ <el-divider></el-divider>
+ <div>
+ <ConsumableProject ref="consumableProject"></ConsumableProject>
+ </div>
+ <Edit ref="editRef" :contentsId="contentsId" @submit="fetchData"/>
+ </div>
+</template>
+
+<script>
+import TableCard from './index.vue';
+import Edit from "./Edit.vue"
+import limsTable from '@/components/Table/lims-table.vue'
+import {
+ deleteProcurementSuppliesList,
+ procurementSuppliesList,
+ exportProcurementSuppliesList
+} from "@/api/cnas/externalService/serviceAndSupplyPro/serviceAndSupplyPro";
+import ConsumableProject from "./ConsumableProject.vue"
+
+export default {
+ dicts: ["consumables_type"],
+ components: {
+ TableCard, limsTable,Edit, ConsumableProject
+ },
+ props: {
+ contentsId: {
+ type: Number,
+ required: true,
+ }
+ },
+ watch: {
+ contentsId(newVal, oldVal) {
+ if (newVal !== 0) {
+ this.fetchData()
+ }
+ }
+ },
+ data() {
+ return {
+ columns: [
+ {
+ label: "璐у彿",
+ prop: "itemNumber"
+ },
+ {
+ label: "绫诲埆",
+ prop: "consumablesType",
+ dataType: "slot",
+ slot: "consumablesTypeSlot"
+ },
+ {
+ label: "鍚嶇О",
+ prop: "consumablesName"
+ },
+ {
+ label: "瑙勬牸",
+ prop: "specifications"
+ },
+ {
+ label: "鍙傝�冧緵搴斿晢",
+ prop: "supplierName"
+ },
+ {
+ label: "搴撳瓨涓嬮檺",
+ prop: "lowerLimit"
+ },
+ {
+ label: "褰撳墠搴撳瓨",
+ prop: "currentAmount"
+ },
+ {
+ label: "璁¢噺鍗曚綅",
+ prop: "unit"
+ },
+ {
+ label: "澶囨敞",
+ prop: "remark"
+ },
+ {
+ label: "璐熻矗浜�",
+ prop: "personInChargeName"
+ },
+ {
+ label: "鏈�杩戞洿鏂颁汉",
+ prop: "updateUserName"
+ },
+ {
+ label: "鏈�杩戞洿鏂版棩鏈�",
+ prop: "updateTime"
+ },
+ {
+ fixed: 'right',
+ label: "鎿嶄綔",
+ width: 120,
+ dataType: "slot",
+ slot: "operation"
+ }
+ ],
+ tableData: [],
+ pagination: {
+ current: 1,
+ pageSize: 20,
+ total: 0
+ },
+ options: [],
+ }
+ },
+ mounted() {
+ this.fetchData()
+ this.options = this.dict.type.consumables_type;
+ },
+ methods: {
+ async fetchData() {
+ procurementSuppliesList({ contentId: this.contentsId}).then(res => {
+ if (res.code === 200) {
+ this.tableData = res.data.records
+ if (this.tableData.length > 0) {
+ this.rowClick(this.tableData[0])
+ }
+ }
+ })
+ },
+ findType(val) {
+ this.$nextTick()
+ let res
+ const e = this.options.find(item => item.value == val)
+ if(e) {
+ res = e.label
+ } else {
+ res = '-'
+ }
+ return res
+ },
+ showDialog(row) {
+ this.$refs.editRef.openDialog(row);
+ },
+ async exportExcel() {
+ exportProcurementSuppliesList({parentId:this.contentsId}).then(res => {
+ const blob = new Blob([res], {type: 'application/octet-stream'});
+ this.$download.saveAs(blob, '鑰楁潗鍒楄〃.xlsx')
+ this.$message.success('瀵煎嚭鎴愬姛')
+ })
+ },
+ handleCurrent() {
+ },
+ handleSize() {
+ },
+ handleDelete(row) {
+ deleteProcurementSuppliesList({ id:row.id }).then(res => {
+ if (res.code === 200) {
+ this.$message.success('鍒犻櫎鎴愬姛')
+ this.fetchData()
+ }
+ })
+ },
+ rowClick(row) {
+ this.$refs.consumableProject.fetchListId(row)
+ },
+ tableRowStyle({row}) {
+ if(row.currentAmount <= row.lowerLimit) {
+ return { background: '#ffcaca' }
+ } else {
+ return {}
+ }
+ }
+ }
+}
+</script>
+
+
+<style scoped>
+.flex {
+ display: flex;
+}
+
+.action-box {
+ width: 100%;
+ padding-top: 10px;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+
+.pagination {
+ padding-top: 15px;
+ padding-right: 10px;
+ display: flex;
+ justify-content: space-between
+}
+</style>
diff --git a/src/views/CNAS/externalService/serviceAndSupplyPro/component/ConsumableOverview.vue b/src/views/CNAS/externalService/serviceAndSupplyPro/component/ConsumableOverview.vue
index 6c465f3..6ac65b9 100644
--- a/src/views/CNAS/externalService/serviceAndSupplyPro/component/ConsumableOverview.vue
+++ b/src/views/CNAS/externalService/serviceAndSupplyPro/component/ConsumableOverview.vue
@@ -29,7 +29,6 @@
import TableCard from './index.vue';
import { procurementSuppliesList } from "@/api/cnas/externalService/serviceAndSupplyPro/serviceAndSupplyPro"
import limsTable from '@/components/Table/lims-table.vue'
-import axios from "axios";
export default {
components: { CardPanel, TableCard, limsTable },
diff --git a/src/views/CNAS/externalService/serviceAndSupplyPro/component/ConsumableProject.vue b/src/views/CNAS/externalService/serviceAndSupplyPro/component/ConsumableProject.vue
new file mode 100644
index 0000000..1f2ed15
--- /dev/null
+++ b/src/views/CNAS/externalService/serviceAndSupplyPro/component/ConsumableProject.vue
@@ -0,0 +1,164 @@
+<template>
+ <div>
+ <TableCard :showTitle="false">
+ <template slot="form">
+ <div class="action-box">
+ <div></div>
+ <div class="flex">
+ <el-button icon="el-icon-plus" size="small" type="primary" @click="showDialog">
+ 娣诲姞椤圭洰
+ </el-button>
+ <el-button icon="el-icon-upload2" size="small" @click="exportExcel">
+ 瀵煎嚭
+ </el-button>
+ </div>
+ </div>
+ </template>
+ <template v-slot:table>
+ <limsTable
+ :column="columns"
+ :height="'25vh'"
+ :isSelection="true"
+ :table-data="tableData"
+ style="margin-top: 18px; padding: 0 15px;"
+ >
+ <template v-slot:operation="scope">
+ <el-button size="small" type="text" @click="deleteData(scope.row)">鍒犻櫎</el-button>
+ </template>
+ </limsTable>
+ <div class="pagination">
+ <div></div>
+ <el-pagination
+ :page-size="pagination.pageSize"
+ :page-sizes="[10, 20, 30, 40]"
+ :total="pagination.total"
+ layout="total, sizes, prev, pager, next, jumper"
+ @current-change="handleCurrent"
+ @size-change="handleSize"
+ >
+ </el-pagination>
+ </div>
+ </template>
+ </TableCard>
+ <AddProject ref="AddProjectRef" @submit="fetchData"/>
+ </div>
+</template>
+
+<script>
+import TableCard from './index.vue';
+import limsTable from '@/components/Table/lims-table.vue'
+import Edit from "./Edit.vue"
+import AddProject from './AddProject.vue';
+import {
+ deleteProcurementSuppliesExpends,
+ procurementSuppliesExpendlist
+} from "@/api/cnas/externalService/serviceAndSupplyPro/serviceAndSupplyPro";
+
+export default {
+ components: {
+ TableCard, limsTable, Edit, AddProject
+ },
+ data() {
+ return {
+ columns: [
+ // {
+ // label: "缂栧彿"
+ // },
+ {
+ label: "椤圭洰鍚嶇О",
+ prop: "listName"
+ },
+ {
+ label: "娑堣�楁暟閲�",
+ prop: "amount"
+ },
+ {
+ label: "褰曞叆浜�",
+ prop: "enterUserName"
+ },
+ {
+ label: "鏈�杩戞洿鏂颁汉",
+ prop: "updateUserName"
+ },
+ {
+ label: "鏈�杩戞洿鏂版棩鏈�",
+ prop: "updateTime"
+ },
+ {
+ label: "鎿嶄綔",
+ dataType: "slot",
+ slot: "operation"
+ }
+ ],
+ tableData: [],
+ pagination: {
+ current: 1,
+ pageSize: 20,
+ total: 0
+ },
+ listId: 0,
+ row: undefined
+ }
+ },
+ mounted() {
+ this.fetchData()
+ },
+ methods: {
+ fetchListId(row) {
+ if(row) {
+ this.listId = row.id
+ this.row = row
+ }
+ this.fetchData()
+ },
+ async fetchData() {
+ if (this.listId === 0) return
+ procurementSuppliesExpendlist({
+ procurementSuppliesListId:this.listId
+ }).then(res => {
+ if (res.code === 200) {
+ this.tableData = res.data
+ }
+ })
+ },
+ showDialog() {
+ this.$refs.AddProjectRef.openDialog(this.row);
+ },
+ deleteData(row) {
+ deleteProcurementSuppliesExpends({ expendId:row.expendId}).then(res => {
+ if (res.code === 200) {
+ this.$message.success('鍒犻櫎鎴愬姛')
+ this.fetchData()
+ }
+ })
+ },
+ handleCurrent() {
+ },
+ handleSize() {
+ },
+ exportExcel() {
+ }
+ }
+}
+</script>
+
+<style scoped>
+.flex {
+ display: flex;
+}
+
+.action-box {
+ width: 100%;
+ padding-top: 10px;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+
+.pagination {
+ padding-top: 15px;
+ padding-right: 10px;
+ display: flex;
+ justify-content: space-between
+}
+</style>
diff --git a/src/views/CNAS/externalService/serviceAndSupplyPro/component/Edit.vue b/src/views/CNAS/externalService/serviceAndSupplyPro/component/Edit.vue
new file mode 100644
index 0000000..5e7f431
--- /dev/null
+++ b/src/views/CNAS/externalService/serviceAndSupplyPro/component/Edit.vue
@@ -0,0 +1,252 @@
+<template>
+ <el-dialog
+ :visible.sync="dialogVisible"
+ title="娣诲姞鑰楁潗椤圭洰淇℃伅"
+ width="70%"
+ >
+ <el-form ref="modelForm" :model="model" :rules="rules" label-width="100px">
+ <el-col :span="12">
+ <el-form-item label="鑰楁潗绫诲瀷" prop="consumablesType">
+ <el-select v-model="model.consumablesType" placeholder="璇烽�夋嫨鑰楁潗绫诲瀷" size="small" style="width: 100%">
+ <el-option v-for="(v, i) in dict.type.consumables_type" :key="i" :label="v.label" :value="v.value"></el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="璐у彿">
+ <el-input v-model="model.itemNumber" placeholder="璇疯緭鍏ヨ揣鍙�" size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鑰楁潗鍚嶇О">
+ <el-input v-model="model.consumablesName" placeholder="璇疯緭鍏ヨ�楁潗鍚嶇О" size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="瑙勬牸">
+ <el-input v-model="model.specifications" placeholder="璇疯緭鍏ヨ鏍�" size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="璁¢噺鍗曚綅">
+ <el-input v-model="model.unit" placeholder="璇疯緭鍏ヨ閲忓崟浣�" size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鍙傝�冧环鏍�">
+ <el-input-number v-model="model.referencePrice" :min="0" :precision="2" :step="0.01" placeholder="璇疯緭鍏ュ弬鑰冧环鏍�"
+ size="small"></el-input-number>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="瀛樻斁浣嶇疆">
+ <el-select v-model="model.contentId" placeholder="璇烽�夋嫨瀛樻斁浣嶇疆" size="small" style="width: 100%">
+ <el-option v-for="(v, i) in procurementSuppliesContentOptions" :key="i" :label="v.nodeName"
+ :value="v.id"></el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="璐熻矗浜�">
+ <el-select v-model="model.personInCharge" placeholder="璇烽�夋嫨璐熻矗浜�" size="small" style="width: 100%">
+ <el-option v-for="(v, i) in userOptions" :key="i" :label="v.name" :value="v.id"></el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="搴撳瓨涓婇檺">
+ <el-input-number v-model="model.upperLimit" :min="0" :step="1" placeholder="璇疯緭鍏ュ簱瀛樹笂闄�" size="small"></el-input-number>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="搴撳瓨涓嬮檺">
+ <el-input-number v-model="model.lowerLimit" :min="0" :step="1" placeholder="璇疯緭鍏ュ簱瀛樹笅闄�" size="small"></el-input-number>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <el-form-item label="渚涘簲鍟�">
+ <el-select v-model="model.supplier" placeholder="璇烽�夋嫨渚涘簲鍟�" size="small" style="width: 100%">
+ <el-option v-for="(v, i) in supplierOptions" :key="i" :label="v.supplierName"
+ :value="v.supplierManagementId"></el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <el-form-item label="鑰楁潗鍥炬爣">
+ <div class="rows">
+ <el-input v-model="model.consumablesIcon" placeholder="璇疯緭鍏ヨ�楁潗鍥炬爣" size="small" style="width: 90%;"/>
+ <el-upload
+ ref="upload"
+ :action="action"
+ :headers="uploadHeader"
+ :on-success="onSuccessIcon"
+ :show-file-list="false"
+ style="float: left; margin: 0 12px 0 20px;"
+ >
+ <el-button slot="trigger" class="uploadFile" size="small" type="primary">娴忚</el-button>
+ </el-upload>
+ </div>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <el-form-item label="鑰楁潗闄勪欢">
+ <div class="rows">
+ <el-input v-model="model.attachment" placeholder="璇疯緭鍏ヨ�楁潗闄勪欢" size="small" style="width: 90%;"/>
+ <el-upload
+ ref="upload"
+ :action="action"
+ :on-success="onSuccessFile"
+ :show-file-list="false"
+ :headers="uploadHeader"
+ style="float: left; margin: 0 12px 0 20px;"
+ >
+ <el-button slot="trigger" class="uploadFile" size="small" type="primary">娴忚</el-button>
+ </el-upload>
+ </div>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <el-form-item label="澶囨敞">
+ <el-input
+ v-model="model.remark"
+ :rows="2"
+ placeholder="璇疯緭鍏ュ娉�"
+ size="small"
+ type="textarea"
+ >
+ </el-input>
+ </el-form-item>
+ </el-col>
+ </el-form>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="resetForm">鍙� 娑�</el-button>
+ <el-button type="primary" @click="submit">淇� 瀛�</el-button>
+ </span>
+ </el-dialog>
+</template>
+
+<script>
+import {
+ addProcurementSuppliesList,
+ updateProcurementSuppliesList,
+ selectSupplierManagementAll,
+ getProcurementSuppliesContentsNodeNames,
+ selectUserCondition
+} from '@/api/cnas/externalService/serviceAndSupplyPro/serviceAndSupplyPro'
+export default {
+ data() {
+ return {
+ dialogVisible: false,
+ model: {
+ consumablesType: undefined,
+ consumablesIcon: undefined,
+ attachment: undefined,
+ },
+ procurementSuppliesContentOptions: [],
+ userOptions: [],
+ supplierOptions: [],
+ rules: {
+ consumablesType: [{ required: true, message: '璇烽�夋嫨鑰楁潗绫诲瀷', trigger: 'blur' }],
+ },
+ }
+ },
+ dicts: ["consumables_type"],
+ props: {
+ contentsId: {
+ type: Number,
+ required: true,
+ }
+ },
+ computed: {
+ action() {
+ return this.javaApi + '/personBasicInfo/saveCNASFile'
+ }
+ },
+ mounted() {
+ this.findProcurementSuppliesContentOptions()
+ this.findUserOptions()
+ this.findSupplierOptions()
+ },
+ methods: {
+ // 閲嶇疆琛ㄥ崟
+ resetForm() {
+ this.$refs.modelForm.resetFields();
+ this.dialogVisible = false
+ },
+ openDialog(row) {
+ if (row) {
+ console.log("row", row)
+ this.model = row
+ } else {
+ this.model = {}
+ }
+ this.dialogVisible = true
+ },
+ findProcurementSuppliesContentOptions() {
+ getProcurementSuppliesContentsNodeNames().then(res => {
+ if (res.code === 200) {
+ this.procurementSuppliesContentOptions = res.data
+ }
+ })
+ },
+ findUserOptions() {
+ selectUserCondition().then(res => {
+ if (res.code === 200) {
+ this.userOptions = res.data
+ }
+ })
+ },
+ findSupplierOptions() {
+ selectSupplierManagementAll().then(res => {
+ if (res.code === 200) {
+ this.supplierOptions = res.data
+ }
+ })
+ },
+ async onSuccessIcon(response) {
+ this.$set(this.model, "consumablesIcon", response.data)
+ },
+ async onSuccessFile(response) {
+ this.$set(this.model, "attachment", response.data)
+ },
+ submit() {
+ this.$refs.modelForm.validate((valid) => {
+ if (valid) {
+ if (this.model.id) {
+ updateProcurementSuppliesList(this.model).then(res => {
+ if (res.code === 200) {
+ this.dialogVisible = false
+ }
+ })
+ } else {
+ addProcurementSuppliesList(this.model).then(res => {
+ if (res.code === 200) {
+ this.dialogVisible = false
+ this.$emit('submit')
+ }
+ })
+ }
+ }
+ })
+ }
+ }
+}
+</script>
+
+<style scoped>
+>>>.el-dialog {
+ margin: 6vh auto 50px !important;
+}
+>>> .el-dialog__body {
+ max-height: 42em;
+ overflow-y: auto;
+}
+.rows {
+ width: 100%;
+ display: flex;
+ justify-content: space-between;
+}
+>>>.el-form-item__content {
+ line-height: 39px;
+}
+</style>
diff --git a/src/views/CNAS/externalService/serviceAndSupplyPro/component/Store.vue b/src/views/CNAS/externalService/serviceAndSupplyPro/component/Store.vue
new file mode 100644
index 0000000..1951036
--- /dev/null
+++ b/src/views/CNAS/externalService/serviceAndSupplyPro/component/Store.vue
@@ -0,0 +1,468 @@
+<template>
+ <div>
+ <div style="
+ display: flex;
+ justify-content: flex-end;
+ margin-right: 20px;
+ margin-bottom: 20px;
+ ">
+ <el-button icon="el-icon-plus" size="small" type="primary" @click="addOrUpdateStore('add')">娣诲姞
+ </el-button>
+ <el-button icon="el-icon-download" size="small" @click="importExcel">
+ 瀵煎嚭excel
+ </el-button>
+ </div>
+ <div class="table">
+ <limsTable
+ :column="tableColumn"
+ :height="'calc(100vh - 20em)'"
+ :table-data="storageTableData"
+ :table-loading="tableLoading"
+ style="padding: 0 10px;margin-bottom: 16px"
+ :page="page"
+ @pagination="pagination">
+ </limsTable>
+ </div>
+
+ <!-- 缂栬緫-鏂板寮规 -->
+ <el-dialog :before-close="handleClose" :close-on-click-modal="false"
+ :close-on-press-escape="false" :title="title"
+ :visible.sync="dialogVisible" width="70%">
+ <!-- 鍏ュ簱鍗� -->
+ <div>
+ <div style="display: flex; align-items: center">
+ <span style="margin-left: 10px">鍏ュ簱鍗�</span>
+ </div>
+ <el-form ref="formModel" :model="form" label-width="auto">
+ <el-col :span="12">
+ <el-form-item label="鍏ュ簱鍗曞彿">
+ <el-input v-model="form.oddNumbers" placeholder="璇疯緭鍏ュ叆搴撳崟鍙�" size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鍏ュ簱搴撳瓨">
+ <el-input v-model="form.inventory" placeholder="璇疯緭鍏ュ叆搴撳簱瀛�" size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鍏ュ簱鎬婚噾棰�">
+ <el-input v-model="form.totalAmount" placeholder="璇疯緭鍏ュ叆搴撴�婚噾棰�" size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鍏ュ簱鏃ユ湡">
+ <el-date-picker v-model="form.storageTime" format="yyyy-MM-dd"
+ placeholder="閫夋嫨鏃ユ湡"
+ size="small"
+ style="width: 100%" type="date" value-format="yyyy-MM-dd"></el-date-picker>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鍏ュ簱浜�">
+ <el-select v-model="form.storageUser" size="small" style="width: 100%">
+ <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id"></el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鍏ュ簱璇存槑">
+ <el-input v-model="form.remark" :rows="2" placeholder="璇疯緭鍏ュ唴瀹�" type="textarea">
+ </el-input>
+ </el-form-item>
+ </el-col>
+ </el-form>
+ </div>
+ <!-- 鍏ュ簱鏄庣粏 -->
+ <div>
+ <div>鍏ュ簱鏄庣粏</div>
+ <div class="input-form">
+ <div>
+ <div>
+ <span>鑰楁潗鍚嶇О:</span>
+ <el-select v-model="formTwo.id" filterable placeholder="璇烽�夋嫨鑰楁潗鍚嶇О" size="small" style="width: 70%">
+ <el-option v-for="(v, i) in consumableOptions" :key="i" :label="v.consumablesName"
+ :value="v.id"></el-option>
+ </el-select>
+ </div>
+ </div>
+ <div>
+ <div>
+ <span>鍗曚环:</span>
+ <el-input v-model="formTwo.unitPrice" placeholder="璇疯緭鍏ュ崟浠�" size="small" style="width: 70%">
+ </el-input>
+ </div>
+ </div>
+ <div>
+ <div>
+ <span>鍏ュ簱鏁伴噺:</span>
+ <el-input v-model="formTwo.storeNumber" placeholder="璇疯緭鍏ュ叆搴撴暟閲�" size="small" style="width: 70%">
+ </el-input>
+ </div>
+ </div>
+ <div>
+ <div>
+ <span>鎬讳环:</span>
+ <el-input v-model="formTwo.totalPrice" placeholder="璇疯緭鍏ユ�讳环" size="small" style="width: 70%">
+ </el-input>
+ </div>
+ </div>
+ <el-button size="mini" type="primary"
+ @click="addTableData">娣诲姞
+ </el-button>
+ </div>
+ <el-table :data="consumables" style="margin-top: 10px">
+ <el-table-column label="缂栧彿" type="index" width="120px"></el-table-column>
+ <el-table-column label="璐у彿" prop="itemNumber"></el-table-column>
+ <el-table-column label="绫诲埆" prop="type"></el-table-column>
+ <el-table-column label="鍚嶇О" prop="consumablesName"></el-table-column>
+ <el-table-column label="瑙勬牸" prop="specifications"></el-table-column>
+ <el-table-column label="鍙傝�冧緵搴斿晢" prop="supplier"></el-table-column>
+ <el-table-column label="璁¢噺鍗曚綅" prop="unit"></el-table-column>
+ <el-table-column label="鍗曚环" prop="unitPrice"></el-table-column>
+ <el-table-column label="鍏ュ簱鏁伴噺" prop="storeNumber"></el-table-column>
+ <el-table-column label="鎬讳环" prop="totalPrice"></el-table-column>
+ <el-table-column label="鎿嶄綔" width="80px">
+ <template slot-scope="scope">
+ <el-button size="mini" style="color: #f56c6c" type="text" @click="deleteTableData(scope.$index)">鍒犻櫎
+ </el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="handleClose">鍙� 娑�</el-button>
+ <el-button type="primary" :loading="saveLoading" @click="save">淇� 瀛�</el-button>
+ </span>
+ </el-dialog>
+ </div>
+</template>
+
+<script>
+import {
+ addStore,
+ deleteStore,
+ exportProcurementSuppliesStoreExcel,
+ procurementSuppliesList,
+ selectStoreById,
+ selectUserCondition,
+ storeList,
+ updateStore
+} from '@/api/cnas/externalService/serviceAndSupplyPro/serviceAndSupplyPro'
+import limsTable from '@/components/Table/lims-table.vue'
+
+export default {
+ computed: {
+ title() {
+ return this.dialogType == "add" ? "鏂板缓鍏ュ簱" : "缂栬緫鍏ュ簱";
+ },
+ },
+ dicts: ["consumables_type"],
+ props: {
+ contentsId: {
+ type: Number,
+ default: 0
+ }
+ },
+ watch: {
+
+ },
+ data() {
+ return {
+ mutiList: [],
+ consumables: [],
+ users: [],
+ form: {
+ oddNumbers: null,
+ inventory: null,
+ totalAmount: null,
+ storageTime: null,
+ storageUser: null,
+ remark: null,
+ },
+ formTwo: {
+ consumablesName: null,
+ unitPrice: null,
+ storeNumber: null,
+ totalPrice: null,
+ },
+ dialogVisible: false,
+ dialogType: "",
+ upIndex: 0,
+ tableColumn: [
+ {
+ label: '鍏ュ簱鍗曞彿',
+ prop: 'oddNumbers',
+ minWidth: '100'
+ },
+ {
+ label: '鑰楁潗鍚嶇О',
+ prop: 'consumablesName',
+ minWidth: '100'
+ },
+ {
+ label: '鍏ュ簱鏁伴噺',
+ prop: 'storeNumber',
+ minWidth: '100'
+ },
+ {
+ label: '鍏ュ簱鎬讳环',
+ prop: 'totalPrice',
+ minWidth: '100'
+ },
+ {
+ label: '鍏ュ簱浜�',
+ prop: 'storageUserName',
+ minWidth: '100'
+ }, {
+ label: '鍏ュ簱鏃ユ湡',
+ prop: 'storageTime',
+ minWidth: '100'
+ }, {
+ label: '璇存槑',
+ prop: 'remark',
+ minWidth: '100'
+ }, {
+ label: '鐧昏浜�',
+ prop: 'registrantName',
+ minWidth: '160'
+ },{
+ label: '鐧昏鏃ユ湡',
+ prop: 'registrantTime',
+ minWidth: '100'
+ },
+ {
+ dataType: 'action',
+ fixed: 'right',
+ minWidth: '120',
+ label: '鎿嶄綔',
+ operation: [
+ {
+ name: '缂栬緫',
+ type: 'text',
+ clickFun: (row) => {
+ this.addOrUpdateStore('edit', row);
+ },
+ },
+ {
+ name: '鍒犻櫎',
+ type: 'text',
+ color: '#f56c6c',
+ clickFun: (row) => {
+ this.deleteStore(row)
+ },
+ }
+ ]
+ }
+ ],
+ tableLoading: false,
+ page: {
+ total: 0,
+ size: 10,
+ current: 1
+ },
+ consumableOptions: [],
+ options: [],
+ storageTableData: [],
+ searchForm: {
+ orderBy: {
+ field: "id",
+ order: "desc",
+ },
+ },
+ saveLoading: false,
+ };
+ },
+ components: {
+ limsTable,
+ },
+ mounted() {
+ this.searchList();
+ this.getUserList();
+ this.fetchListOptions()
+ this.options = this.dict.type.consumables_type
+ },
+ methods: {
+ // 淇濆瓨
+ save() {
+ let data = {
+ store: this.form,
+ consumables: this.consumables,
+ };
+ this.saveLoading = true;
+ if (this.dialogType === "update") {
+ updateStore(data).then((res) => {
+ this.saveLoading = false
+ if (res.code == 200) {
+ this.$message.success("淇敼鎴愬姛");
+ this.handleClose();
+ // this.$refs.selectList()
+ this.searchList()
+ }
+ }).catch((err) => {
+ this.saveLoading = false
+ })
+ } else {
+ addStore(data).then((res) => {
+ this.saveLoading = false
+ if (res.code == 200) {
+ this.$message.success("鏂板鎴愬姛");
+ this.handleClose();
+ // this.$refs.selectList()
+ this.searchList()
+ }
+ }).catch((err) => {
+ this.saveLoading = false
+ })
+ }
+ },
+ findType(val) {
+ console.log(val)
+ return this.options.find(item => item.value === val).label
+ },
+ // 娣诲姞琛ㄦ牸鏁版嵁
+ addTableData() {
+ this.$nextTick()
+ console.log('this.consumableOptions',this.consumableOptions)
+ this.consumableOptions.forEach(item => {
+ if (item.id === this.formTwo.id) {
+ this.consumables.push({
+ itemNumber: null,
+ type: this.findType(item.consumablesType),
+ consumablesName: item.consumablesName,
+ specifications: item.specifications,
+ supplier: item.supplierName,
+ unit: item.unit,
+ unitPrice: this.formTwo.unitPrice,
+ storeNumber: this.formTwo.storeNumber,
+ totalPrice: this.formTwo.totalPrice,
+ });
+ }
+ })
+ },
+ deleteTableData(index) {
+ this.consumables.splice(index, 1);
+ },
+ // 鎵撳紑寮规
+ addOrUpdateStore(type,row) {
+ if (type === 'edit') {
+ this.dialogType = "update";
+ selectStoreById({id:row.id}).then(res => {
+ if (res.code === 201) return
+ this.consumables = res.data.consumables
+ this.form = {...res.data.store}
+ }).catch(err => {
+ console.log('err---', err);
+ })
+ } else {
+ this.dialogType = "add";
+ }
+ this.dialogVisible = true;
+ },
+ // 鏌ヨ鍒楄〃
+ searchList () {
+ this.tableLoading = true
+ storeList({...this.page,...this.searchForm}).then(res => {
+ this.tableLoading = false
+ if (res.code === 200){
+ this.storageTableData = res.data.records
+ this.page.total = res.data.total
+ }
+ }).catch(err => {
+ console.log('err---', err);
+ this.tableLoading = false
+ })
+ },
+ // 瀵煎嚭excel
+ async importExcel() {
+ exportProcurementSuppliesStoreExcel({parentId:this.contentsId}).then(res => {
+ const blob = new Blob([res], {type: 'application/octet-stream'});
+ this.$download.saveAs(blob, '鑰楁潗鍏ュ簱.xlsx')
+ this.$message.success('瀵煎嚭鎴愬姛')
+ })
+ },
+ handleClose() {
+ this.form = {
+ oddNumbers: null,
+ inventory: null,
+ totalAmount: null,
+ storageTime: null,
+ storageUser: null,
+ remark: null,
+ };
+ this.formTwo = {
+ consumablesName: null,
+ unitPrice: null,
+ storeNumber: null,
+ totalPrice: null,
+ };
+ this.consumables = [];
+ this.dialogVisible = false;
+ },
+ viewIssued(row) {
+ console.log(row);
+ },
+ // 鑾峰彇鎵�鏈夌敤鎴�
+ getUserList() {
+ selectUserCondition().then((res) => {
+ this.users = res.data;
+ });
+ },
+ async fetchListOptions() {
+ procurementSuppliesList({contentsId: this.contentsId}).then(res => {
+ if (res.code === 200) {
+ this.consumableOptions = res.data.records
+ }
+ })
+
+ },
+ // 鍒犻櫎
+ deleteStore (row) {
+ this.$confirm('姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ユ暟鎹�, 鏄惁缁х画?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ this.tableLoading = true
+ console.log('row>>>>>>>>>>>>>>s',row)
+ deleteStore({
+ id:row.id,
+ consumablesId:row.consumablesId
+ }).then(res => {
+ this.tableLoading = false
+ if (res.code === 200){
+ this.$message.success('鍒犻櫎鎴愬姛')
+ this.searchList()
+ }
+ }).catch(err => {
+ this.tableLoading = false
+ console.log('err---', err);
+ })
+ }).catch(() => {
+ this.$message({
+ type: 'info',
+ message: '宸插彇娑堝垹闄�'
+ });
+ });
+ },
+
+ pagination(page) {
+ this.page.size = page.limit
+ this.searchList();
+ },
+ },
+};
+</script>
+
+<style scoped>
+.el-dialog {
+ margin: 6vh auto 50px !important;
+}
+.el-dialog__body {
+ max-height: 42em;
+ overflow-y: auto;
+}
+.input-form {
+ display: flex;
+ margin: 10px 0;
+}
+</style>
diff --git a/src/views/CNAS/externalService/serviceAndSupplyPro/component/contents.vue b/src/views/CNAS/externalService/serviceAndSupplyPro/component/contents.vue
new file mode 100644
index 0000000..2d17786
--- /dev/null
+++ b/src/views/CNAS/externalService/serviceAndSupplyPro/component/contents.vue
@@ -0,0 +1,312 @@
+<template>
+ <div class="parent-class">
+ <div style="display: flex; justify-content: flex-end; margin-right: 20px">
+ <el-button
+ type="primary"
+ @click="addContents"
+ size="small"
+ icon="el-icon-plus"
+ >娣诲姞瀛愯妭鐐�</el-button
+ >
+ <el-button
+ type="danger"
+ @click="deletetContents"
+ size="small"
+ icon="el-icon-delete"
+ >鍒犻櫎瀛愯妭鐐�</el-button
+ >
+ <el-button
+ type="warning"
+ @click="updateContents"
+ size="small"
+ icon="el-icon-edit"
+ >鏇存柊瀛愯妭鐐�</el-button
+ >
+ </div>
+ <el-form label-width="100px">
+ <el-form-item label="鑺傜偣鍚嶇О">
+ <el-input
+ v-model="form.nodeName"
+ style="width: 200px"
+ size="small"
+ ></el-input>
+ </el-form-item>
+ <el-form-item label="浠e彿">
+ <el-input
+ v-model="form.code"
+ style="width: 200px"
+ size="small"
+ ></el-input>
+ </el-form-item>
+ <el-form-item label="鏇存柊浜�">
+ <el-select v-model="form.updateUser">
+ <el-option
+ v-for="item in users"
+ :key="item.id"
+ :label="item.name"
+ :value="item.id"
+ ></el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item label="鏇存柊鏃堕棿">
+ <el-input
+ v-model="form.updateTime"
+ style="width: 200px"
+ size="small"
+ ></el-input>
+ </el-form-item>
+ </el-form>
+
+ <!-- 鏂板寮规 -->
+ <el-dialog title="娣诲姞鑺傜偣" :visible.sync="dialogVisible" width="40%">
+ <el-form
+ label-width="100px"
+ :model="addForm"
+ ref="addForm"
+ :rules="rules"
+ >
+ <el-form-item label="鐖惰妭鐐瑰悕绉�">
+ <!-- <el-select v-model="addForm.parentId">
+ <el-option v-for="(item,index) in nodeNames" :key="index" :label="item.nodeName" :value="item.id"></el-option>
+ </el-select> -->
+ <el-cascader
+ v-model="addForm.parentId"
+ :options="treeData"
+ :props="{ checkStrictly: true, value: 'id', label: 'nodeName' }"
+ clearable
+ ></el-cascader>
+ </el-form-item>
+ <el-form-item label="鑺傜偣鍚嶇О" prop="nodeName">
+ <el-input
+ v-model="addForm.nodeName"
+ style="width: 200px"
+ size="small"
+ ></el-input>
+ </el-form-item>
+ <el-form-item label="浠e彿">
+ <el-input
+ v-model="addForm.code"
+ style="width: 200px"
+ size="small"
+ ></el-input>
+ </el-form-item>
+ </el-form>
+
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="dialogVisible = false">鍙� 娑�</el-button>
+ <el-button type="primary" @click="submitForm">纭� 瀹�</el-button>
+ </span>
+ </el-dialog>
+ </div>
+</template>
+<script>
+
+import {
+ addSuppliersDirectoryContents,
+ updateSuppliersDirectoryContents,
+ deleteSuppliersDirectoryContentsById,
+ getSuppliersDirectoryContentsNodeNames,
+ selectUserCondition,
+ selectProcurementSuppliesContentById,
+ getProcurementSuppliesContentsNodeNames,
+ addProcurementSuppliesContents, deleteProcurementSuppliesContentById
+} from '@/api/cnas/externalService/serviceAndSupplyPro/serviceAndSupplyPro'
+export default {
+ props: {
+ id: {
+ type: Number,
+ default: 0,
+ },
+ treeData: {
+ type: Array,
+ default: () => [],
+ },
+ from: {
+ type: String,
+ default: "鑰楁潗鏍�"
+ }
+ },
+ data() {
+ return {
+ nodeNames: [],
+ users: [],
+ dialogVisible: false,
+ form: {
+ nodeName: "",
+ code: "",
+ updateUser: "",
+ updateTime: "",
+ },
+ addForm: {
+ nodeName: "",
+ code: "",
+ updateUser: "",
+ updateTime: "",
+ parentId: null,
+ },
+ rules: {
+ nodeName: [
+ { required: true, message: "璇疯緭鍏ヨ妭鐐瑰悕绉�", trigger: "blur" },
+ ],
+ },
+ };
+ },
+ mounted() {
+ if (this.id !== 0) {
+ this.getContentsDetail();
+ }
+ this.getNodeNames();
+ this.getUserList();
+ },
+ watch: {
+ id(newVal, oldVal) {
+ if (newVal !== 0) {
+ console.log(newVal, oldVal);
+ this.getContentsDetail();
+ }
+ },
+ },
+ methods: {
+ // 鑾峰彇鐩綍璇︽儏
+ getContentsDetail() {
+ selectProcurementSuppliesContentById({id:this.id})
+ .then((res) => {
+ if (res.data == null) {
+ this.form = {
+ nodeName: "",
+ code: "",
+ updateUser: "",
+ updateTime: "",
+ };
+ return;
+ }
+ this.form = res.data;
+ });
+ },
+ // 鏂板缓
+ addContents() {
+ this.dialogVisible = true;
+ this.resetForm();
+ },
+ resetForm() {
+ this.addForm = {
+ nodeName: "",
+ code: "",
+ updateUser: "",
+ updateTime: "",
+ parentId: null,
+ };
+ },
+ async submitForm() {
+ let flag = true;
+ this.$refs.addForm.validate((valid) => {
+ if (!valid) {
+ flag = false;
+ return false;
+ }
+ });
+ if (this.addForm.parentId) {
+ this.addForm.parentId =
+ this.addForm.parentId[this.addForm.parentId.length - 1];
+ }
+ if (!flag) {
+ return;
+ }
+ try {
+ let res = null
+ console.log('this.from',this.from)
+ if(this.from == '鑰楁潗鏍�' ){
+ console.log('111')
+ res = await addProcurementSuppliesContents(this.addForm)
+ }else {
+ console.log('222')
+ res = await addSuppliersDirectoryContents(this.addForm)
+ }
+ if (res.code === 200) {
+ this.$message.success("娣诲姞鎴愬姛");
+ this.dialogVisible = false;
+ this.$emit("contentsUpdate", res.data);
+ this.getContentsDetail();
+ }
+ }catch (error){
+ this.$message.error("娣诲姞澶辫触");
+ }
+ },
+ // 鏇存柊
+ updateContents() {
+ Object.keys(this.form).forEach((key) => {
+ if (key == "children") {
+ delete this.form[key];
+ }
+ });
+ updateSuppliersDirectoryContents(this.form).then((res) => {
+ if (res.code === 200) {
+ this.$message.success("鏇存柊鎴愬姛");
+ this.$emit("contentsUpdate", this.id);
+ this.dialogVisible = false;
+ this.getContentsDetail();
+ }
+ });
+ },
+ // 鍒犻櫎
+ deletetContents() {
+ if (
+ this.form.id == null ||
+ this.form.id == "" ||
+ this.form.id == undefined
+ ) {
+ this.$message.error("璇烽�夋嫨瑕佸垹闄ょ殑鑺傜偣");
+ return;
+ }
+ this.$confirm("姝ゆ搷浣滃皢鍒犻櫎璇ヨ妭鐐�, 鏄惁缁х画?", "鎻愮ず", {
+ confirmButtonText: "纭畾",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ }).then(() => {
+ if(this.from == '鑰楁潗鏍�'){
+ deleteProcurementSuppliesContentById({id:this.form.id}).then((res) => {
+ if (res.code == 200) {
+ this.$message.success("鍒犻櫎鎴愬姛");
+ this.$emit("contentsUpdate", this.form.parentId, true);
+ this.getContentsDetail();
+ }
+ });
+ }else {
+ deleteSuppliersDirectoryContentsById({id:this.form.id}).then((res) => {
+ if (res.code == 200) {
+ this.$message.success("鍒犻櫎鎴愬姛");
+ this.$emit("contentsUpdate", this.form.parentId, true);
+ this.getContentsDetail();
+ }
+ });
+ }
+ });
+ },
+ // 鑾峰彇鎵�鏈夌洰褰曡妭鐐�
+ getNodeNames() {
+ if(this.from == '鑰楁潗鏍�'){
+ getProcurementSuppliesContentsNodeNames().then(res => {
+ this.nodeNames = res.data;
+ })
+ }else {
+ getSuppliersDirectoryContentsNodeNames().then(res => {
+ this.nodeNames = res.data;
+ })
+ }
+ },
+ // 鑾峰彇鎵�鏈夌敤鎴�
+ getUserList() {
+ selectUserCondition().then((res) => {
+ this.users = res.data;
+ })
+ },
+ },
+ created() {},
+};
+</script>
+
+ <style scoped>
+.parent-class {
+ margin-top: 20px;
+}
+</style>
diff --git a/src/views/CNAS/externalService/serviceAndSupplyPro/index.vue b/src/views/CNAS/externalService/serviceAndSupplyPro/index.vue
index 836d07a..9efac6d 100644
--- a/src/views/CNAS/externalService/serviceAndSupplyPro/index.vue
+++ b/src/views/CNAS/externalService/serviceAndSupplyPro/index.vue
@@ -27,30 +27,33 @@
<el-tab-pane label="鑰楁潗鎬昏" name="first" :lazy="true">
<ConsumableOverview v-if="activeName == 'first'" :contentsId="contentsId"></ConsumableOverview>
</el-tab-pane>
-<!-- <el-tab-pane label="鑰楁潗鍒楄〃" name="second" :lazy="true">-->
-<!-- <ConsumableList v-if="activeName == 'second'" :contentsId="contentsId"></ConsumableList>-->
-<!-- </el-tab-pane>-->
-<!-- <el-tab-pane label="鑰楁潗鍏ュ簱" name="third" :lazy="true">-->
-<!-- <Store v-if="activeName == 'third'" :contentsId="contentsId"></Store>-->
-<!-- </el-tab-pane>-->
-<!-- <el-tab-pane label="鐩綍缁存姢" name="fourth" :lazy="true">-->
-<!-- <Contents-->
-<!-- v-if="activeName == 'fourth'"-->
-<!-- :id="contentsId"-->
-<!-- @contentsUpdate="contentsUpdate"-->
-<!-- :treeData="treeData"-->
-<!-- from="鑰楁潗鏍�"-->
-<!-- ></Contents>-->
-<!-- </el-tab-pane>-->
+ <el-tab-pane label="鑰楁潗鍒楄〃" name="second" :lazy="true">
+ <ConsumableList v-if="activeName == 'second'" :contentsId="contentsId"></ConsumableList>
+ </el-tab-pane>
+ <el-tab-pane label="鑰楁潗鍏ュ簱" name="third" :lazy="true">
+ <Store v-if="activeName == 'third'" :contentsId="contentsId"></Store>
+ </el-tab-pane>
+ <el-tab-pane label="鐩綍缁存姢" name="fourth" :lazy="true">
+ <Contents
+ v-if="activeName == 'fourth'"
+ :id="contentsId"
+ @contentsUpdate="contentsUpdate"
+ :treeData="treeData"
+ from="鑰楁潗鏍�"
+ ></Contents>
+ </el-tab-pane>
</el-tabs>
</div>
</div>
</template>
<script>
-// import Contents from "@/components/do/a6.service-and-supply-purchase/contents.vue";
-// import Store from "@/components/do/a6.service-and-supply-purchase/store.vue";
-import ConsumableOverview from "../serviceAndSupplyPro/component/ConsumableOverview.vue";
-// import ConsumableList from "@/components/do/a6.service-and-supply-purchase/ConsumableList.vue"
+import Contents from "./component/contents.vue";
+import Store from "./component/Store.vue";
+import ConsumableOverview from "./component/ConsumableOverview.vue";
+import ConsumableList from "./component/ConsumableList.vue"
+import {
+ directoryListing
+} from '@/api/cnas/externalService/serviceAndSupplyPro/serviceAndSupplyPro'
export default {
data() {
@@ -70,10 +73,10 @@
};
},
components: {
- // Contents,
- // Store,
- ConsumableOverview
- // ConsumableList
+ Contents,
+ Store,
+ ConsumableOverview,
+ ConsumableList
},
watch: {
contentsId(newVal, oldVal) {
@@ -129,9 +132,7 @@
},
// 鏌ヨ鎵�鏈夌洰褰�
getTreeData() {
- this.$axios
- .get(this.$api.procurementSuppliesContents.directoryListing)
- .then((res) => {
+ directoryListing().then((res) => {
this.treeData = res.data;
});
},
--
Gitblit v1.9.3