| | |
| | | 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, |
| | | }) |
| | | } |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
| | |
| | | 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 }, |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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="代å·"> |
| | | <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="代å·"> |
| | | <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> |
| | |
| | | <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() { |
| | |
| | | }; |
| | | }, |
| | | components: { |
| | | // Contents, |
| | | // Store, |
| | | ConsumableOverview |
| | | // ConsumableList |
| | | Contents, |
| | | Store, |
| | | ConsumableOverview, |
| | | ConsumableList |
| | | }, |
| | | watch: { |
| | | contentsId(newVal, oldVal) { |
| | |
| | | }, |
| | | // æ¥è¯¢ææç®å½ |
| | | getTreeData() { |
| | | this.$axios |
| | | .get(this.$api.procurementSuppliesContents.directoryListing) |
| | | .then((res) => { |
| | | directoryListing().then((res) => { |
| | | this.treeData = res.data; |
| | | }); |
| | | }, |