Merge remote-tracking branch 'origin/cnas' into master
| | |
| | | personPostAuthorizationRecord, |
| | | deviceCheck, |
| | | personCommunicationAbility, |
| | | procurementSuppliesContents, |
| | | procurementSuppliesStore, |
| | | } |
| | | } |
| | | |
| | |
| | | const personCommunicationAbility = { |
| | | exportPersonCommunicationAbility:'/personCommunicationAbility/exportPersonCommunicationAbility',//å¯¼åº |
| | | } |
| | | |
| | | const procurementSuppliesContents = { |
| | | directoryListing: "/procurementSuppliesContents/directoryListing", // éè´ç©èµç®å½å表 |
| | | selectById: "/procurementSuppliesContents/selectProcurementSuppliesContentById", // éè´ç©èµç®å½è¯¦æ
|
| | | add: "/procurementSuppliesContents/addProcurementSuppliesContents", // éè´ç©èµç®å½æ°å¢ |
| | | update: "/procurementSuppliesContents/updateProcurementSuppliesContents", // éè´ç©èµç®å½ä¿®æ¹ |
| | | deleteById: "/procurementSuppliesContents/deleteProcurementSuppliesContentById", // éè´ç©èµç®å½å é¤ |
| | | getUserList: "/procurementSuppliesContents/getUserList", // éè´ç©èµç®å½è·åç¨æ·å表 |
| | | getNodeNames: "/procurementSuppliesContents/getNodeNames", // éè´ç©èµç®å½è·åèç¹åç§° |
| | | selectSuppliersDirectoryContentsById:'/suppliersDirectoryContents/selectSuppliersDirectoryContentsById',//ä¾åºåç®å½è¯¦æ
|
| | | } |
| | | |
| | | const procurementSuppliesStore = { |
| | | storeList: '/procurementSuppliesStore/storeList', // èæå
¥åºå表 |
| | | addStore: '/procurementSuppliesStore/addStore', // èæå
¥åºæ°å¢ |
| | | deleteStore: '/procurementSuppliesStore/deleteStore', // èæå
¥åºå é¤ |
| | | updateStore: '/procurementSuppliesStore/updateStore', // èæå
¥åºä¿®æ¹ |
| | | selectStoreById: '/procurementSuppliesStore/selectStoreById', // æ ¹æ®idæ¥è¯¢èæå
¥åº |
| | | exportExcel: '/procurementSuppliesStore/exportExcel', // èæå
¥åºå¯¼åº |
| | | updateStore: '/procurementSuppliesStore/updateStore', // èæå
¥åºä¿®æ¹ |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="card-container" @click="handleCard"> |
| | | <div class="card-panel" :class="[isActive == index ? 'isActive' : '']"> |
| | | <el-image |
| | | style="width: 80%; height: 140px" |
| | | :src="javaApi + '/img/' + data.logo" |
| | | fit="fill" |
| | | /> |
| | | </div> |
| | | <div class="title"> |
| | | {{ data.supplierRef }} |
| | | </div> |
| | | </div> |
| | | </template> |
| | | <script> |
| | | |
| | | export default { |
| | | props: { |
| | | data: { |
| | | type: Object, |
| | | default: () => {} |
| | | }, |
| | | index: { |
| | | type: Number, |
| | | default: -1 |
| | | }, |
| | | isActive: { |
| | | type: Number, |
| | | default: -1 |
| | | } |
| | | }, |
| | | data(){ |
| | | return { |
| | | |
| | | } |
| | | }, |
| | | mounted() { |
| | | // console.log(1111,this.data) |
| | | }, |
| | | methods: { |
| | | handleCard() { |
| | | this.$emit('handleCard', this.data, this.index) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | .card-container { |
| | | margin: 10px 10px 10px 0; |
| | | text-align: center; |
| | | } |
| | | .card-panel { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | width: 90%; |
| | | height: 180px; |
| | | box-shadow: 0px 0px 20px 0px #0000001A; |
| | | cursor: pointer; |
| | | border-radius: 5px; |
| | | border: 1px solid transparent; |
| | | } |
| | | .card-panel:hover { |
| | | border: 1px solid #409EFF; |
| | | background: #1D56C50D; |
| | | } |
| | | .isActive { |
| | | border: 1px solid #409EFF; |
| | | background: #1D56C50D; |
| | | } |
| | | .title { |
| | | margin-top: 15px; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <el-row class="card-box"> |
| | | <el-col :span="4" v-for="(item, index) in cardList" :key="index"> |
| | | <CardPanel |
| | | :isActive="isActive" |
| | | :data="item" |
| | | :index="index" |
| | | @handleCard="handleCard" |
| | | /> |
| | | </el-col> |
| | | </el-row> |
| | | <TableCard title="ä¾åºåä¿¡æ¯" :showForm="false" style="margin-top: 5px"> |
| | | <template v-slot:table> |
| | | <ZTTable |
| | | style="margin-top: 18px; padding: 0 15px;" |
| | | :height="'40vh'" |
| | | :column="columns" |
| | | :table-data="tableData" |
| | | > |
| | | <div slot="action" slot-scope="scope"> |
| | | <el-button type="text" @click="showDialog(scope)">æ¥ç</el-button> |
| | | </div> |
| | | </ZTTable> |
| | | </template> |
| | | </TableCard> |
| | | <Edit ref="editRef" @submit="getTableData" type="详æ
" /> |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import CardPanel from './components/CardPanel.vue'; |
| | | import TableCard from '@/components/caorui/TableCard/index.vue'; |
| | | import ZTTable from '@/components/caorui/ZTTable/index.vue'; |
| | | import Edit from "../components/Edit.vue" |
| | | import { selectSupplierManagementPage } from "@/assets/api/api"; |
| | | import axios from 'axios'; |
| | | |
| | | export default { |
| | | components: {CardPanel, TableCard, ZTTable, Edit}, |
| | | props: { |
| | | contentsId: { |
| | | type: Number, |
| | | default: 0 |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | columns: [ |
| | | { |
| | | label: "ä¾åºåç¼å·", |
| | | prop: "supplierRef" |
| | | }, |
| | | { |
| | | label: "ä¾åºååç§°", |
| | | prop: "supplierRef" |
| | | }, |
| | | { |
| | | label: "å°å", |
| | | prop: "supplierName" |
| | | }, |
| | | { |
| | | label: "è系人", |
| | | prop: "contacts" |
| | | }, |
| | | { |
| | | label: "èç³»çµè¯", |
| | | prop: "phone" |
| | | }, |
| | | { |
| | | label: "ä¼ ç", |
| | | prop: "fax" |
| | | }, |
| | | { |
| | | label: "ç½å", |
| | | prop: "website" |
| | | }, |
| | | { |
| | | label: "é®ç®±", |
| | | prop: "email" |
| | | }, |
| | | { |
| | | label: "䏿¬¡æ´æ°æ¶é´", |
| | | prop: "updateTime" |
| | | }, |
| | | { |
| | | fixed: "right", |
| | | dataType: "slot", |
| | | slot: "action", |
| | | label: "æä½" |
| | | } |
| | | ], |
| | | cardList: [], |
| | | tableData: [], |
| | | isActive: -1 |
| | | } |
| | | }, |
| | | watch: { |
| | | contentsId(newVal) { |
| | | if (newVal !== 0) { |
| | | this.getTableData(); |
| | | } |
| | | }, |
| | | }, |
| | | mounted() { |
| | | this.getTableData(this.contentsId) |
| | | }, |
| | | methods: { |
| | | // è·åè¡¨æ ¼æ°æ® |
| | | async getTableData() { |
| | | const {code, data } = await axios({ |
| | | method: 'get', |
| | | url: `${selectSupplierManagementPage}/${this.contentsId}`, |
| | | }) |
| | | if(code == 200) { |
| | | this.cardList = data; |
| | | } |
| | | }, |
| | | handleCard(data, index) { |
| | | this.isActive = index |
| | | this.tableData = [data] |
| | | }, |
| | | showDialog(row) { |
| | | this.$refs.editRef.openDialog(row) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | .card-box { |
| | | width: 100%; |
| | | padding-left: 5px; |
| | | padding-right: 5px; |
| | | height: 30vh; |
| | | overflow-y: auto; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <TableCard :showTitle="false"> |
| | | <template slot="form"> |
| | | <div class="action-box"> |
| | | <div></div> |
| | | <div class="flex"> |
| | | <el-button :disabled="contentsId == 0" icon="el-icon-plus" type="primary" @click="showDialog()"> |
| | | æ°å»º |
| | | </el-button> |
| | | <el-button icon="el-icon-upload2" @click="exportExcel"> |
| | | 导åºExcel |
| | | </el-button> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | <template v-slot:table> |
| | | <ZTTable |
| | | :column="columns" |
| | | :height="'70vh'" |
| | | :isSelection="true" |
| | | :table-data="tableData" |
| | | style="margin-top: 18px; padding: 0 15px;" |
| | | > |
| | | <div slot="action" slot-scope="scope"> |
| | | <el-button type="text" @click="showDialog(scope)">ç¼è¾</el-button> |
| | | <el-button type="text" @click="delRow(scope)"> |
| | | <span style="color: #F56C6C">å é¤</span> |
| | | </el-button> |
| | | </div> |
| | | </ZTTable> |
| | | <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> |
| | | <Edit ref="editRef" :contentsId="contentsId" @submit="getTableData" type="ç¼è¾" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import TableCard from '@/components/caorui/TableCard/index.vue'; |
| | | import ZTTable from '@/components/caorui/ZTTable/index.vue'; |
| | | import Edit from "../components/Edit.vue" |
| | | import { selectQualifiedSupplierManagementPage, delSupplierManagement, exportSupplierManagement } from "@/assets/api/api"; |
| | | import axios from "axios"; |
| | | |
| | | export default { |
| | | components: { |
| | | TableCard, ZTTable, Edit |
| | | }, |
| | | props: { |
| | | contentsId: { |
| | | type: Number, |
| | | default: 0 |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | columns: [ |
| | | { |
| | | label: "ä¾åºåç¼å·", |
| | | prop: "supplierRef" |
| | | }, |
| | | { |
| | | label: "ä¾åºå", |
| | | prop: "supplierName" |
| | | }, |
| | | { |
| | | label: "ä¾åºç©å(æå¡)åç§°", |
| | | prop: "supplierItemServiceName" |
| | | }, |
| | | { |
| | | label: "å°å", |
| | | prop: "adress" |
| | | }, |
| | | { |
| | | label: "èç³»çµè¯", |
| | | prop: "phone" |
| | | }, |
| | | { |
| | | fixed: "right", |
| | | dataType: "slot", |
| | | slot: "action", |
| | | label: "æä½" |
| | | } |
| | | ], |
| | | tableData: [], |
| | | pagination: { |
| | | current: 1, |
| | | pageSize: 20, |
| | | total: 0 |
| | | }, |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.getTableData() |
| | | }, |
| | | watch: { |
| | | contentsId(newVal) { |
| | | if (newVal !== 0) { |
| | | this.getTableData(); |
| | | } |
| | | }, |
| | | }, |
| | | methods: { |
| | | // è·åè¡¨æ ¼æ°æ® |
| | | async getTableData() { |
| | | const {code, data } = await axios({ |
| | | method: 'get', |
| | | url: selectQualifiedSupplierManagementPage, |
| | | params: { |
| | | ...this.pagination, |
| | | parentId: this.contentsId |
| | | } |
| | | }) |
| | | if(code == 200) { |
| | | this.tableData = data.records; |
| | | } |
| | | }, |
| | | showDialog(scope) { |
| | | this.$refs.editRef.openDialog(scope) |
| | | }, |
| | | handleCurrent(val) { |
| | | this.pagination.current = val; |
| | | this.getTableData() |
| | | }, |
| | | handleSize(size) { |
| | | this.pagination.pageSize = size; |
| | | this.getTableData() |
| | | }, |
| | | // å 餿°æ® |
| | | delRow(scope) { |
| | | this.$confirm('æ¤æä½å°æ°¸ä¹
å é¤è¯¥æä»¶, æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then( async () => { |
| | | const { code } = await axios({ |
| | | method: 'post', |
| | | url: `${delSupplierManagement}/${scope.row.supplierManagementId}`, |
| | | }) |
| | | if(code == 200) { |
| | | this.$message.success('å 餿å') |
| | | this.getTableData() |
| | | } else { |
| | | this.$message.error('å é¤å¤±è´¥') |
| | | } |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }) |
| | | }, |
| | | async exportExcel() { |
| | | const res = await axios({ |
| | | method: "post", |
| | | url: `${exportSupplierManagement}/${this.contentsId}`, |
| | | responseType: "blob" |
| | | }) |
| | | const blob = new Blob([res], {type: 'application/octet-stream'}); |
| | | //å°Blob å¯¹è±¡è½¬æ¢æå符串 |
| | | let reader = new FileReader(); |
| | | reader.readAsText(blob, 'utf-8'); |
| | | reader.onload = () => { |
| | | try { |
| | | let result = JSON.parse(reader.result); |
| | | if (result.message) { |
| | | this.$message.error(result.message); |
| | | } else { |
| | | const url = URL.createObjectURL(blob); |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | link.download = 'åæ ¼ä¾åºå.xlsx'; |
| | | link.click(); |
| | | this.$message.success('å¯¼åºæå') |
| | | } |
| | | } catch (err) { |
| | | console.log(err); |
| | | const url = URL.createObjectURL(blob); |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | link.download = 'åæ ¼ä¾åºå.xlsx'; |
| | | link.click(); |
| | | this.$message.success('å¯¼åºæå') |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </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 |
| | | title="ä¾åºå详æ
" |
| | | width="40%" |
| | | :visible.sync="dialogVisible" |
| | | > |
| | | <el-form :model="model" label-width="auto"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ä¾åºå"> |
| | | <el-input v-model="model.supplierName" placeholder="请è¾å
¥" :disabled="type=='详æ
'" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ç¼å·"> |
| | | <el-input v-model="model.supplierRef" placeholder="请è¾å
¥" :disabled="type=='详æ
'" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="ä¾åºåç©åæå¡åç§°"> |
| | | <el-input v-model="model.supplierItemServiceName" :disabled="type=='详æ
'" placeholder="请è¾å
¥" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="é®ç¼"> |
| | | <el-input v-model="model.postalCode" :disabled="type=='详æ
'" placeholder="请è¾å
¥" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å°å"> |
| | | <el-input v-model="model.adress" :disabled="type=='详æ
'" placeholder="请è¾å
¥" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="logo"> |
| | | <div class="rows"> |
| | | <el-input placeholder="请è¾å
¥" :disabled="type=='详æ
'" v-model="model.logo" style="width: 100%;" /> |
| | | <el-upload |
| | | ref="upload" |
| | | style="float: left; margin: 0 12px 0 20px;" |
| | | :action="action" |
| | | :show-file-list="false" |
| | | :on-success="onSuccess" |
| | | > |
| | | <el-button class="uploadFile" slot="trigger" type="primary" :disabled="type=='详æ
'">æµè§</el-button> |
| | | </el-upload> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="è系人"> |
| | | <el-input v-model="model.contacts" placeholder="请è¾å
¥" :disabled="type=='详æ
'" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="èç³»çµè¯"> |
| | | <el-input v-model="model.phone" placeholder="请è¾å
¥" :disabled="type=='详æ
'" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ·å"> |
| | | <el-input v-model="model.householdName" placeholder="请è¾å
¥" :disabled="type=='详æ
'" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ä¼ ç"> |
| | | <el-input v-model="model.fax" placeholder="请è¾å
¥" :disabled="type=='详æ
'" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="弿·è¡"> |
| | | <el-input v-model="model.openingName" placeholder="请è¾å
¥" :disabled="type=='详æ
'" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ç½å"> |
| | | <el-input v-model="model.website" placeholder="请è¾å
¥" :disabled="type=='详æ
'" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="è´¦å·"> |
| | | <el-input v-model="model.accountName" placeholder="请è¾å
¥" :disabled="type=='详æ
'" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="Email"> |
| | | <el-input v-model="model.email" placeholder="请è¾å
¥" :disabled="type=='详æ
'" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <span slot="footer" v-if="type!='详æ
'"> |
| | | <el-button @click="dialogVisible = false">å æ¶</el-button> |
| | | <el-button type="primary" @click="submit">ä¿ å</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | import { addSupplierManagement, updateSupplierManagement } from "@/assets/api/api"; |
| | | import axios from 'axios'; |
| | | export default { |
| | | props: { |
| | | contentsId: { |
| | | type: Number, |
| | | default: 0 |
| | | }, |
| | | type:{ |
| | | type: String, |
| | | default: 'ç¼è¾' |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | dialogVisible: false, |
| | | model: { |
| | | parentId: this.contentsId, |
| | | supplierManagementId: undefined, |
| | | supplierName: undefined, // ä¾åºå |
| | | supplierRef: undefined, // ç¼å· |
| | | supplierItemServiceName: undefined, // ä¾åºåç©åæå¡åç§° |
| | | postalCode: undefined, // é®ç¼ |
| | | adress: undefined, // å°å |
| | | logo: undefined, // logo |
| | | contacts: undefined, // è系人 |
| | | phone: undefined, // èç³»çµè¯ |
| | | householdName: undefined, // æ·å |
| | | fax: undefined, // ä¼ ç |
| | | openingName: undefined, // 弿·è¡ |
| | | website: undefined, // ç½å |
| | | accountName: undefined, // è´¦å· |
| | | email: undefined // Email |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | action() { |
| | | return `${this.javaApi}/${this.$api.personnel.saveCNASFile}` |
| | | } |
| | | }, |
| | | methods: { |
| | | openDialog(form) { |
| | | if(form) { |
| | | console.log(form.row) |
| | | this.model.supplierManagementId = form.row.supplierManagementId |
| | | this.model.supplierName = form.row.supplierName |
| | | this.model.supplierRef = form.row.supplierRef |
| | | this.model.supplierItemServiceName = form.row.supplierItemServiceName |
| | | this.model.postalCode = form.row.postalCode |
| | | this.model.adress = form.row.adress |
| | | this.model.logo = form.row.logo |
| | | this.model.contacts = form.row.contacts |
| | | this.model.phone = form.row.phone |
| | | this.model.householdName = form.row.householdName |
| | | this.model.fax = form.row.fax |
| | | this.model.openingName = form.row.openingName |
| | | this.model.website = form.row.website |
| | | this.model.accountName = form.row.accountName |
| | | this.model.email = form.row.email |
| | | }else{ |
| | | this.model = { |
| | | parentId: this.contentsId, |
| | | supplierManagementId: undefined, |
| | | supplierName: undefined, // ä¾åºå |
| | | supplierRef: undefined, // ç¼å· |
| | | supplierItemServiceName: undefined, // ä¾åºåç©åæå¡åç§° |
| | | postalCode: undefined, // é®ç¼ |
| | | adress: undefined, // å°å |
| | | logo: undefined, // logo |
| | | contacts: undefined, // è系人 |
| | | phone: undefined, // èç³»çµè¯ |
| | | householdName: undefined, // æ·å |
| | | fax: undefined, // ä¼ ç |
| | | openingName: undefined, // 弿·è¡ |
| | | website: undefined, // ç½å |
| | | accountName: undefined, // è´¦å· |
| | | email: undefined // Email |
| | | } |
| | | } |
| | | this.model.parentId = this.contentsId |
| | | this.dialogVisible = true |
| | | }, |
| | | async submit() { |
| | | if(this.model.supplierManagementId) { |
| | | const { code } = await axios({ |
| | | url: updateSupplierManagement, |
| | | method: 'post', |
| | | data: this.model, |
| | | noQs: true |
| | | }) |
| | | if(code == 200) { |
| | | this.$message.success('ä¿®æ¹æå') |
| | | this.$emit('submit') |
| | | this.dialogVisible = false |
| | | } |
| | | } else { |
| | | const { code } = await axios({ |
| | | url: addSupplierManagement, |
| | | method: 'post', |
| | | data: this.model, |
| | | noQs: true |
| | | }) |
| | | if(code == 200) { |
| | | this.$message.success('æ°å¢æå') |
| | | this.$emit('submit') |
| | | this.dialogVisible = false |
| | | } |
| | | } |
| | | }, |
| | | async onSuccess(response) { |
| | | this.$set(this.model, "logo", response.data) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .rows { |
| | | width: 100%; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
| | | <ZTTable |
| | | :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> |
| | | </ZTTable> |
| | | <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" @submit="fetchData"></ConsumableProject> |
| | | </div> |
| | | <Edit ref="editRef" :contentsId="contentsId" @submit="fetchData"/> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import TableCard from '@/components/caorui/TableCard/index.vue'; |
| | | import ZTTable from '@/components/caorui/ZTTable/index.vue'; |
| | | import Edit from "./components/Edit.vue" |
| | | import axios from "axios"; |
| | | import { |
| | | addProcurementSuppliesList, |
| | | deleteProcurementSuppliesList, |
| | | procurementSuppliesList, |
| | | procurementSuppliesListExport |
| | | } from "@/assets/api/api"; |
| | | import ConsumableProject from "@/components/do/a6.service-and-supply-purchase/ConsumableProject.vue" |
| | | |
| | | export default { |
| | | components: { |
| | | TableCard, ZTTable, 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.selectEnumByCategory() |
| | | }, |
| | | methods: { |
| | | async fetchData() { |
| | | const res = await axios({ |
| | | method: 'get', |
| | | url: `${procurementSuppliesList}`, |
| | | params: { |
| | | // page: this.pagination.current, |
| | | // pageSize: this.pagination.pageSize, |
| | | contentsId: this.contentsId |
| | | } |
| | | }) |
| | | if (res.code === 200) { |
| | | this.tableData = res.data.records |
| | | if (this.tableData.length > 0) { |
| | | this.rowClick(this.tableData[0]) |
| | | } |
| | | } |
| | | }, |
| | | // è·ååå
¸ |
| | | async selectEnumByCategory() { |
| | | await this.$axios.post(this.$api.enums.selectEnumByCategory, { |
| | | category: "èæç±»å" |
| | | }).then(res => { |
| | | this.options = res.data |
| | | }) |
| | | }, |
| | | 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() { |
| | | const res = await axios({ |
| | | method: "post", |
| | | url: `${procurementSuppliesListExport}/${this.contentsId}`, |
| | | responseType: "blob" |
| | | }) |
| | | const blob = new Blob([res], {type: 'application/octet-stream'}); |
| | | //å°Blob å¯¹è±¡è½¬æ¢æå符串 |
| | | let reader = new FileReader(); |
| | | reader.readAsText(blob, 'utf-8'); |
| | | reader.onload = () => { |
| | | try { |
| | | let result = JSON.parse(reader.result); |
| | | if (result.message) { |
| | | this.$message.error(result.message); |
| | | } else { |
| | | const url = URL.createObjectURL(blob); |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | link.download = 'èæå表.xlsx'; |
| | | link.click(); |
| | | this.$message.success('å¯¼åºæå') |
| | | } |
| | | } catch (err) { |
| | | console.log(err); |
| | | const url = URL.createObjectURL(blob); |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | link.download = 'èæå表.xlsx'; |
| | | link.click(); |
| | | this.$message.success('å¯¼åºæå') |
| | | } |
| | | } |
| | | }, |
| | | handleCurrent() { |
| | | }, |
| | | handleSize() { |
| | | }, |
| | | handleDelete(row) { |
| | | this.$axios.post(deleteProcurementSuppliesList, row, { |
| | | headers: { |
| | | 'Content-Type': 'application/json' |
| | | } |
| | | }).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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <el-row class="card-box"> |
| | | <el-col :span="4" v-for="(item, index) in cardList" :key="index"> |
| | | <CardPanel |
| | | :isActive="isActive" |
| | | :data="item" |
| | | :index="index" |
| | | @handleCard="handleCard" |
| | | /> |
| | | </el-col> |
| | | <el-col :span="24" v-if="cardList.length==0" style="color: #909399;font-size: 14px;text-align: center;margin-top: 20px;">ææ æ°æ®</el-col> |
| | | </el-row> |
| | | <TableCard title="èæä¿¡æ¯" :showForm="false" style="margin-top: 5px"> |
| | | <template v-slot:table> |
| | | <ZTTable |
| | | style="margin-top: 18px; padding: 0 15px;" |
| | | :height="'20vh'" |
| | | :column="columns" |
| | | :table-data="tableData" |
| | | > |
| | | </ZTTable> |
| | | </template> |
| | | </TableCard> |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import CardPanel from '@/components/caorui/6-6/ConsumableOverview/components/CardPanel'; |
| | | import TableCard from '@/components/caorui/TableCard/index.vue'; |
| | | import ZTTable from '@/components/caorui/ZTTable/index.vue'; |
| | | import { procurementSuppliesList } from "@/assets/api/api"; |
| | | import axios from "axios"; |
| | | |
| | | export default { |
| | | components: { CardPanel, TableCard, ZTTable }, |
| | | props: { |
| | | contentsId: { |
| | | type: Number, |
| | | default: 0 |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | isActive: -1, |
| | | columns: [ |
| | | { |
| | | label: "èæç¼å·", |
| | | prop: "itemNumber" |
| | | }, |
| | | { |
| | | label: "èæåç§°", |
| | | prop: "consumablesName" |
| | | }, |
| | | { |
| | | label: "èæç±»å", |
| | | prop: "consumablesType" |
| | | }, |
| | | { |
| | | label: "è§æ ¼", |
| | | prop: "specifications" |
| | | }, |
| | | { |
| | | label: "åä½", |
| | | prop: "unit" |
| | | }, |
| | | { |
| | | label: "åä»·", |
| | | prop: "referencePrice" |
| | | }, |
| | | { |
| | | label: "å½ååºå", |
| | | prop: "currentAmount" |
| | | }, |
| | | { |
| | | label: "è´è´£äºº", |
| | | prop: "personInChargeName" |
| | | }, |
| | | { |
| | | label: "䏿¬¡æ´æ°æ¶é´", |
| | | prop: "updateTime" |
| | | } |
| | | ], |
| | | cardList: [], |
| | | tableData: [] |
| | | } |
| | | }, |
| | | watch: { |
| | | contentsId(newVal, oldVal) { |
| | | this.getTableData(newVal) |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.getTableData(this.contentsId) |
| | | }, |
| | | methods: { |
| | | handleCard(data, index) { |
| | | this.isActive = index |
| | | this.tableData = [data] |
| | | }, |
| | | async getTableData(id) { |
| | | const { code, data } = await axios({ |
| | | method: 'get', |
| | | url: `${procurementSuppliesList}`, |
| | | params: { |
| | | contentsId: id |
| | | } |
| | | }) |
| | | if(code == 200) { |
| | | this.cardList = data.records.map(m=>{ |
| | | m.logo = m.consumablesIcon |
| | | return m |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | .card-box { |
| | | width: 100%; |
| | | padding-left: 5px; |
| | | padding-right: 5px; |
| | | height: 30vh; |
| | | overflow-y: auto; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
| | | <ZTTable |
| | | :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> |
| | | </ZTTable> |
| | | <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,$emit('submit')"/> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import TableCard from '@/components/caorui/TableCard/index.vue'; |
| | | import ZTTable from '@/components/caorui/ZTTable/index.vue'; |
| | | import Edit from "./components/Edit.vue" |
| | | import AddProject from './components/AddProject.vue'; |
| | | import { |
| | | deleteProcurementSuppliesExpends, |
| | | procurementSuppliesExpendsList, |
| | | procurementSuppliesList |
| | | } from "../../../assets/api/api"; |
| | | import axios from "axios"; |
| | | |
| | | export default { |
| | | components: { |
| | | TableCard, ZTTable, 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 |
| | | const res = await axios({ |
| | | method: 'get', |
| | | url: `${procurementSuppliesExpendsList}/${this.listId}`, |
| | | params: { |
| | | // page: this.pagination.current, |
| | | // pageSize: this.pagination.pageSize, |
| | | } |
| | | }) |
| | | if (res.code === 200) { |
| | | this.tableData = res.data |
| | | } |
| | | }, |
| | | showDialog() { |
| | | this.$refs.AddProjectRef.openDialog(this.row); |
| | | }, |
| | | deleteData(row) { |
| | | this.$axios.post(deleteProcurementSuppliesExpends, row, { |
| | | headers: { |
| | | 'Content-Type': 'application/json' |
| | | } |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success('å 餿å') |
| | | this.$emit('submit') |
| | | 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> |
| | | <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"> |
| | | <ZTTable |
| | | :column="tableColumn" |
| | | :height="'calc(100vh - 20em)'" |
| | | :table-data="storageTableData" |
| | | :table-loading="tableLoading" |
| | | style="padding: 0 10px;margin-bottom: 16px"> |
| | | </ZTTable> |
| | | <el-pagination |
| | | :current-page="1" |
| | | :page-size="page.size" |
| | | :page-sizes="[10, 20, 30, 50, 100]" |
| | | :total="total" layout="->,total, sizes, prev, pager, next, jumper" |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange"> |
| | | </el-pagination> |
| | | </div> |
| | | |
| | | <!-- ç¼è¾-æ°å¢å¼¹æ¡ --> |
| | | <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.nodeName" :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" @click="save">ä¿ å</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { procurementSuppliesList, procurementSuppliesStoreExportExcel } from "../../../assets/api/api"; |
| | | import axios from "axios"; |
| | | import ZTTable from '../../caorui/ZTTable/index.vue'; |
| | | |
| | | export default { |
| | | computed: { |
| | | title() { |
| | | return this.dialogType == "add" ? "æ°å»ºå
¥åº" : "ç¼è¾å
¥åº"; |
| | | }, |
| | | }, |
| | | 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: { |
| | | size: 20, |
| | | current: 1, |
| | | }, |
| | | total: 0, |
| | | consumableOptions: [], |
| | | options: [], |
| | | storageTableData: [], |
| | | searchForm: { |
| | | orderBy: { |
| | | field: "id", |
| | | order: "desc", |
| | | }, |
| | | }, |
| | | }; |
| | | }, |
| | | components: { |
| | | ZTTable, |
| | | }, |
| | | mounted() { |
| | | this.searchList(); |
| | | this.getUserList(); |
| | | this.fetchListOptions() |
| | | this.selectEnumByCategory() |
| | | }, |
| | | methods: { |
| | | // ä¿å |
| | | save() { |
| | | let data = { |
| | | store: this.form, |
| | | consumables: this.consumables, |
| | | }; |
| | | if(this.form.id){ |
| | | // ç¼è¾ |
| | | this.$axios |
| | | .post(this.$api.procurementSuppliesStore.updateStore, data, { |
| | | headers: { |
| | | "Content-Type": "application/json", |
| | | }, |
| | | }) |
| | | .then((res) => { |
| | | if (res.code == 200) { |
| | | this.$message.success("ä¿åæå"); |
| | | this.handleClose(); |
| | | // this.$refs.selectList() |
| | | this.searchList() |
| | | } |
| | | }); |
| | | }else{ |
| | | // æ°å¢ |
| | | this.$axios |
| | | .post(this.$api.procurementSuppliesStore.addStore, data, { |
| | | headers: { |
| | | "Content-Type": "application/json", |
| | | }, |
| | | }) |
| | | .then((res) => { |
| | | if (res.code == 200) { |
| | | this.$message.success("ä¿åæå"); |
| | | this.handleClose(); |
| | | // this.$refs.selectList() |
| | | this.searchList() |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | // è·ååå
¸ |
| | | selectEnumByCategory() { |
| | | this.$axios.post(this.$api.enums.selectEnumByCategory, { |
| | | category: "èæç±»å" |
| | | }).then(res => { |
| | | this.options = res.data |
| | | }) |
| | | }, |
| | | findType(val) { |
| | | console.log(val) |
| | | return this.options.find(item => item.value === val).label |
| | | }, |
| | | // æ·»å è¡¨æ ¼æ°æ® |
| | | addTableData() { |
| | | this.$nextTick() |
| | | 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"; |
| | | this.$axios.get(this.$api.procurementSuppliesStore.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 () { |
| | | const entity = this.searchForm |
| | | const page = this.page |
| | | this.tableLoading = true |
| | | this.$axios.post(this.$api.procurementSuppliesStore.storeList, {entity, page}, { |
| | | headers: { |
| | | "Content-Type": "application/json" |
| | | }, |
| | | noQs: true |
| | | }).then(res => { |
| | | this.tableLoading = false |
| | | if (res.code === 201) return |
| | | this.storageTableData = res.data.body.records |
| | | this.total = res.data.body.total |
| | | }).catch(err => { |
| | | console.log('err---', err); |
| | | this.tableLoading = false |
| | | }) |
| | | }, |
| | | // å页 |
| | | handleSizeChange(val) { |
| | | this.page.size = val; |
| | | this.searchList(); |
| | | }, |
| | | handleCurrentChange(val) { |
| | | this.page.current = val; |
| | | this.searchList(); |
| | | }, |
| | | // 导åºexcel |
| | | async importExcel() { |
| | | const res = await axios({ |
| | | method: "post", |
| | | url: `${procurementSuppliesStoreExportExcel}/${this.contentsId}`, |
| | | responseType: "blob" |
| | | }) |
| | | const blob = new Blob([res], {type: 'application/octet-stream'}); |
| | | //å°Blob å¯¹è±¡è½¬æ¢æå符串 |
| | | let reader = new FileReader(); |
| | | reader.readAsText(blob, 'utf-8'); |
| | | reader.onload = () => { |
| | | try { |
| | | let result = JSON.parse(reader.result); |
| | | if (result.message) { |
| | | this.$message.error(result.message); |
| | | } else { |
| | | const url = URL.createObjectURL(blob); |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | link.download = 'èæå
¥åº.xlsx'; |
| | | link.click(); |
| | | this.$message.success('å¯¼åºæå') |
| | | } |
| | | } catch (err) { |
| | | console.log(err); |
| | | const url = URL.createObjectURL(blob); |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | link.download = 'èæå
¥åº.xlsx'; |
| | | link.click(); |
| | | 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() { |
| | | this.$axios |
| | | .get(this.$api.procurementSuppliesContents.getUserList) |
| | | .then((res) => { |
| | | this.users = res.data; |
| | | }); |
| | | }, |
| | | async fetchListOptions() { |
| | | const res = await axios({ |
| | | method: 'get', |
| | | url: `${procurementSuppliesList}`, |
| | | params: { |
| | | contentsId: this.contentsId |
| | | } |
| | | }) |
| | | if (res.code === 200) { |
| | | this.consumableOptions = res.data.records |
| | | } |
| | | }, |
| | | // å é¤ |
| | | deleteStore (row) { |
| | | this.$confirm('æ¤æä½å°æ°¸ä¹
å é¤è¯¥æ°æ®, æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | this.tableLoading = true |
| | | this.$axios.get(this.$api.procurementSuppliesStore.deleteStore + '?id=' + row.id + '&consumablesId=' + row.consumablesId).then(res => { |
| | | this.tableLoading = false |
| | | if (res.code === 201) return |
| | | this.$message.success('å 餿å') |
| | | this.searchList() |
| | | }).catch(err => { |
| | | this.tableLoading = false |
| | | console.log('err---', err); |
| | | }) |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }); |
| | | }, |
| | | }, |
| | | }; |
| | | </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> |
| | | <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 "../../../../assets/api/api"; |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | dialogTitle: "", |
| | | dialogVisible: false, |
| | | model: { |
| | | listId: undefined, |
| | | name: "" |
| | | }, |
| | | consumableOptions: [], |
| | | row: undefined |
| | | } |
| | | }, |
| | | created() { |
| | | this.fetchConsumableOptions() |
| | | }, |
| | | methods: { |
| | | fetchConsumableOptions() { |
| | | this.$axios.get(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() { |
| | | this.$axios.post(addProcurementSuppliesExpends, this.model, { |
| | | headers: { |
| | | 'Content-Type': 'application/json' |
| | | }}).then(res => { |
| | | if (res.code === 200) { |
| | | this.dialogVisible = false |
| | | this.$emit('submit') |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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 options" :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.nodeName" :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" |
| | | :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" |
| | | 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, selectSupplierManagementPage} from "@/assets/api/api"; |
| | | import {selectSupplierManagementAll, updateProcurementSuppliesList} from "../../../../assets/api/api"; |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | dialogVisible: false, |
| | | model: { |
| | | consumablesType: undefined, |
| | | consumablesIcon: undefined, |
| | | attachment: undefined, |
| | | }, |
| | | options: [], |
| | | procurementSuppliesContentOptions: [], |
| | | userOptions: [], |
| | | supplierOptions: [], |
| | | rules: { |
| | | consumablesType: [{ required: true, message: 'è¯·éæ©èæç±»å', trigger: 'blur' }], |
| | | }, |
| | | } |
| | | }, |
| | | props: { |
| | | contentsId: { |
| | | type: Number, |
| | | required: true, |
| | | } |
| | | }, |
| | | computed: { |
| | | action() { |
| | | return `${this.javaApi}/${this.$api.personnel.saveCNASFile}` |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.selectEnumByCategory() |
| | | 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 |
| | | }, |
| | | // è·ååå
¸ |
| | | selectEnumByCategory() { |
| | | this.$axios.post(this.$api.enums.selectEnumByCategory, { |
| | | category: "èæç±»å" |
| | | }).then(res => { |
| | | this.options = res.data |
| | | }) |
| | | }, |
| | | findProcurementSuppliesContentOptions() { |
| | | this.$axios.get(this.$api.procurementSuppliesContents.getNodeNames, {}).then(res => { |
| | | if (res.code === 200) { |
| | | this.procurementSuppliesContentOptions = res.data |
| | | } |
| | | }) |
| | | }, |
| | | findUserOptions() { |
| | | this.$axios.get(this.$api.procurementSuppliesContents.getUserList, {}).then(res => { |
| | | if (res.code === 200) { |
| | | this.userOptions = res.data |
| | | } |
| | | }) |
| | | }, |
| | | findSupplierOptions() { |
| | | this.$axios.get(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) { |
| | | this.model.contentsId = this.model.contentId |
| | | if (this.model.id) { |
| | | this.$axios.post(updateProcurementSuppliesList, this.model, { |
| | | headers: { |
| | | 'Content-Type': 'application/json' |
| | | } |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | this.dialogVisible = false |
| | | } |
| | | }) |
| | | } else { |
| | | this.$axios.post(addProcurementSuppliesList, this.model, { |
| | | headers: { |
| | | 'Content-Type': 'application/json' |
| | | } |
| | | }).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 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> |
| | | |
| | | <!-- æ°å¢å¼¹æ¡ --> |
| | | <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 { |
| | | suppliersDirectoryContentsAddSuppliersDirectoryContents, |
| | | suppliersDirectoryContentsUpdateSuppliersDirectoryContents, |
| | | suppliersDirectoryContentsDeleteSuppliersDirectoryContentsById, |
| | | suppliersDirectoryContentsGetSuppliersDirectoryContentsNodeNames |
| | | } from '@/assets/api/api' |
| | | 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: "", |
| | | }, |
| | | addForm: { |
| | | nodeName: "", |
| | | code: "", |
| | | 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() { |
| | | this.$axios |
| | | .get( |
| | | this.from=='èææ '?(this.$api.procurementSuppliesContents.selectById + "?id=" + this.id):(this.$api.procurementSuppliesContents.selectSuppliersDirectoryContentsById + "?id=" + this.id) |
| | | ) |
| | | .then((res) => { |
| | | if (res.data == null) { |
| | | this.form = { |
| | | nodeName: "", |
| | | code: "", |
| | | }; |
| | | return; |
| | | } |
| | | this.form = res.data; |
| | | }); |
| | | }, |
| | | // æ°å»º |
| | | addContents() { |
| | | this.dialogVisible = true; |
| | | this.resetForm(); |
| | | }, |
| | | resetForm() { |
| | | this.addForm = { |
| | | nodeName: "", |
| | | code: "", |
| | | parentId: null, |
| | | }; |
| | | }, |
| | | 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; |
| | | } |
| | | |
| | | this.$axios |
| | | .post( |
| | | this.from == 'èææ ' |
| | | ? this.$api.procurementSuppliesContents.add |
| | | : suppliersDirectoryContentsAddSuppliersDirectoryContents, |
| | | this.addForm, |
| | | { |
| | | headers: { |
| | | "Content-Type": "application/json", |
| | | }, |
| | | } |
| | | ) |
| | | .then((res) => { |
| | | if (res.code === 200) { |
| | | this.$message.success("æ·»å æå"); |
| | | this.dialogVisible = false; |
| | | this.$emit("contentsUpdate", res.data); |
| | | this.getContentsDetail(); |
| | | } |
| | | }); |
| | | }, |
| | | // æ´æ° |
| | | updateContents() { |
| | | Object.keys(this.form).forEach((key) => { |
| | | if (key == "children") { |
| | | delete this.form[key]; |
| | | } |
| | | }); |
| | | this.$axios |
| | | .post( |
| | | this.from == 'èææ ' |
| | | ? this.$api.procurementSuppliesContents.update |
| | | : suppliersDirectoryContentsUpdateSuppliersDirectoryContents, |
| | | |
| | | this.form, |
| | | { |
| | | headers: { |
| | | "Content-Type": "application/json", |
| | | }, |
| | | }) |
| | | .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(() => { |
| | | this.$axios |
| | | .get( |
| | | this.from == 'èææ ' |
| | | ? `${this.$api.procurementSuppliesContents.deleteById}?id=${this.form.id}` |
| | | : `${suppliersDirectoryContentsDeleteSuppliersDirectoryContentsById}?id=${this.form.id}` |
| | | ) |
| | | .then((res) => { |
| | | if (res.code == 200) { |
| | | this.$message.success("å 餿å"); |
| | | this.$emit("contentsUpdate", this.form.parentId, true); |
| | | this.getContentsDetail(); |
| | | } |
| | | }); |
| | | }); |
| | | }, |
| | | // è·åææç®å½èç¹ |
| | | getNodeNames() { |
| | | this.$axios |
| | | .get( |
| | | this.from == 'èææ ' |
| | | ? this.$api.procurementSuppliesContents.getNodeNames |
| | | : suppliersDirectoryContentsGetSuppliersDirectoryContentsNodeNames |
| | | ) |
| | | .then((res) => { |
| | | this.nodeNames = res.data; |
| | | }); |
| | | }, |
| | | // è·åææç¨æ· |
| | | getUserList() { |
| | | this.$axios |
| | | .get(this.$api.procurementSuppliesContents.getUserList) |
| | | .then((res) => { |
| | | this.users = res.data; |
| | | }); |
| | | }, |
| | | }, |
| | | created() {}, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .parent-class { |
| | | margin-top: 20px; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="purchase-page"> |
| | | <div class="purchase-left"> |
| | | <el-input v-model="form.nodeName" placeholder="请è¾å
¥èç¹åç§°" suffix-icon="el-icon-search" size="small" clearable |
| | | @keyup.enter.native="searchFilter(treeData)" @blur="searchFilter(treeData)" |
| | | @clear="searchFilter(treeData)"> |
| | | </el-input> |
| | | <el-tree ref="tree" :data="treeData" :props="defaultProps" @node-click="handleNodeClick" |
| | | :default-expanded-keys="expandedKeys" node-key="id"> |
| | | </el-tree> |
| | | </div> |
| | | <div class="purchase-right"> |
| | | <el-tabs v-model="activeName" @tab-click="handleClick" style="height: 100%;"> |
| | | <el-tab-pane label="æ»è§" name="1" style="height: 100%;"> |
| | | <ConsumableOverview v-if="activeName == '1'" ref="consumableOverviewRef" :contentsId="contentsId" style="height: 100%;"></ConsumableOverview> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="åæ ¼ä¾æ¹åå½" name="2"> |
| | | <QualifiedSuppliers v-if="activeName == '2'" :contentsId="contentsId"></QualifiedSuppliers> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="ç®å½ç»´æ¤" name="3"> |
| | | <Contents |
| | | v-if="activeName == '3'" |
| | | :id="contentsId" |
| | | :treeData="treeData" |
| | | @contentsUpdate="contentsUpdate" |
| | | from="ä¾åºæ " |
| | | ></Contents> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import Contents from "@/components/do/a6.service-and-supply-purchase/contents.vue"; |
| | | import ConsumableOverview from "@/components/caorui/6-6/ConsumableOverview/index.vue"; |
| | | import QualifiedSuppliers from "@/components/caorui/6-6/QualifiedSuppliers/index.vue"; |
| | | import {suppliersDirectoryContentsSuppliersDirectoryContentsListing } from "@/assets/api/api"; |
| | | export default { |
| | | components: { |
| | | ConsumableOverview, QualifiedSuppliers, Contents |
| | | }, |
| | | data() { |
| | | return { |
| | | contentsId: 0, |
| | | activeName: "1", |
| | | form: { |
| | | nodeName: "", |
| | | }, |
| | | treeData: [], |
| | | expandedKeys: [], |
| | | defaultProps: { |
| | | children: "children", |
| | | label: "nodeName", |
| | | }, |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.getTreeData(); |
| | | }, |
| | | methods: { |
| | | searchFilter() { |
| | | this.treeData = JSON.parse(JSON.stringify(this.treeData)); |
| | | this.expandedKeys = []; |
| | | if (this.form.nodeName == "") { |
| | | return; |
| | | } |
| | | const findNodesWithFiber = (nodes) => { |
| | | nodes.forEach((node) => { |
| | | if (node.nodeName && node.nodeName.includes(this.form.nodeName)) { |
| | | this.expandedKeys.push(node.id); |
| | | } |
| | | if (node.children && node.children.length > 0) { |
| | | findNodesWithFiber(node.children); |
| | | } |
| | | }); |
| | | }; |
| | | findNodesWithFiber(this.treeData); |
| | | }, |
| | | // ç®å½ç»´æ¤æ´æ° |
| | | contentsUpdate(val, flag = false) { |
| | | if (val) { |
| | | this.getTreeData(); |
| | | this.expandedKeys = []; |
| | | if (flag) { |
| | | const findNodesWithFiber = (nodes) => { |
| | | nodes.forEach((item) => { |
| | | if (item.parentId == val) { |
| | | this.expandedKeys.push(item.id); |
| | | } |
| | | if (item.children && item.children.length > 0) { |
| | | findNodesWithFiber(item.children); |
| | | } |
| | | }); |
| | | }; |
| | | findNodesWithFiber(this.treeData); |
| | | this.expandedKeys = this.expandedKeys.filter((item) => item !== val); |
| | | } else { |
| | | this.expandedKeys.push(val); |
| | | } |
| | | } else { |
| | | this.getTreeData(); |
| | | } |
| | | }, |
| | | // æ¥è¯¢ææç®å½ |
| | | getTreeData() { |
| | | this.$axios |
| | | .get(suppliersDirectoryContentsSuppliersDirectoryContentsListing) |
| | | .then((res) => { |
| | | this.treeData = res.data; |
| | | }); |
| | | }, |
| | | // ç¹å»æ èç¹ |
| | | handleNodeClick(data) { |
| | | this.contentsId = data.id; |
| | | // this.$refs.consumableOverviewRef.getTableData(data.id) |
| | | }, |
| | | handleClick(tab, event) { |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .purchase-left { |
| | | width: 250px; |
| | | height: 100%; |
| | | background: #fff; |
| | | margin-right: 10px; |
| | | border-radius: 16px; |
| | | box-sizing: border-box; |
| | | padding: 10px 16px; |
| | | flex-shrink: 0; |
| | | } |
| | | |
| | | .purchase-right { |
| | | background: #fff; |
| | | width: calc(100% - 15em); |
| | | height: 100%; |
| | | border-radius: 16px; |
| | | box-sizing: border-box; |
| | | padding: 10px 16px; |
| | | } |
| | | |
| | | .purchase-page { |
| | | display: flex; |
| | | padding-top: 10px; |
| | | padding-bottom: 10px; |
| | | box-sizing: border-box; |
| | | width: 100%; |
| | | } |
| | | >>>.el-tabs__content{ |
| | | height: calc(100% - 40px); |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="purchase-page"> |
| | | <div class="purchase-left"> |
| | | <el-input |
| | | v-model="form.nodeName" |
| | | placeholder="请è¾å
¥èç¹åç§°" |
| | | suffix-icon="el-icon-search" |
| | | size="small" |
| | | clearable |
| | | @keyup.enter.native="searchFilter(treeData)" |
| | | @blur="searchFilter(treeData)" |
| | | @clear="searchFilter(treeData)" |
| | | > |
| | | </el-input> |
| | | <el-tree |
| | | ref="tree" |
| | | :data="treeData" |
| | | :props="defaultProps" |
| | | @node-click="handleNodeClick" |
| | | :default-expanded-keys="expandedKeys" |
| | | node-key="id" |
| | | > |
| | | </el-tree> |
| | | </div> |
| | | <div class="purchase-right"> |
| | | <el-tabs v-model="activeName" @tab-click="handleClick"> |
| | | <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-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 "@/components/do/a6.service-and-supply-purchase/ConsumableOverview.vue"; |
| | | import ConsumableList from "@/components/do/a6.service-and-supply-purchase/ConsumableList.vue" |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | tabsKey: 0, |
| | | contentsId: 0, |
| | | activeName: "first", |
| | | form: { |
| | | nodeName: "", |
| | | }, |
| | | treeData: [], |
| | | expandedKeys: [], |
| | | defaultProps: { |
| | | children: "children", |
| | | label: "nodeName", |
| | | }, |
| | | }; |
| | | }, |
| | | components: { |
| | | Contents, |
| | | Store, |
| | | ConsumableOverview, |
| | | ConsumableList |
| | | }, |
| | | watch: { |
| | | contentsId(newVal, oldVal) { |
| | | if(newVal != oldVal) { |
| | | this.tabsKey = Math.random(); |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | searchFilter() { |
| | | this.treeData = JSON.parse(JSON.stringify(this.treeData)); |
| | | this.expandedKeys = []; |
| | | if(this.form.nodeName == "") { |
| | | return; |
| | | } |
| | | const findNodesWithFiber = (nodes) => { |
| | | nodes.forEach((node) => { |
| | | if (node.nodeName && node.nodeName.includes(this.form.nodeName)) { |
| | | this.expandedKeys.push(node.id); |
| | | } |
| | | if (node.children && node.children.length > 0) { |
| | | findNodesWithFiber(node.children); |
| | | } |
| | | }); |
| | | }; |
| | | findNodesWithFiber(this.treeData); |
| | | }, |
| | | |
| | | // ç®å½ç»´æ¤æ´æ° |
| | | contentsUpdate(val, flag = false) { |
| | | if (val) { |
| | | this.getTreeData(); |
| | | this.expandedKeys = []; |
| | | if (flag) { |
| | | const findNodesWithFiber = (nodes) => { |
| | | nodes.forEach((item) => { |
| | | if (item.parentId == val) { |
| | | this.expandedKeys.push(item.id); |
| | | } |
| | | if(item.children && item.children.length > 0) { |
| | | findNodesWithFiber(item.children); |
| | | } |
| | | }); |
| | | }; |
| | | findNodesWithFiber(this.treeData); |
| | | this.expandedKeys = this.expandedKeys.filter((item) => item !== val); |
| | | } else { |
| | | this.expandedKeys.push(val); |
| | | } |
| | | }else { |
| | | this.getTreeData(); |
| | | } |
| | | }, |
| | | // æ¥è¯¢ææç®å½ |
| | | getTreeData() { |
| | | this.$axios |
| | | .get(this.$api.procurementSuppliesContents.directoryListing) |
| | | .then((res) => { |
| | | this.treeData = res.data; |
| | | }); |
| | | }, |
| | | // ç¹å»æ èç¹ |
| | | handleNodeClick(data) { |
| | | this.contentsId = data.id; |
| | | }, |
| | | handleClick(tab, event) { |
| | | console.log(tab, event); |
| | | }, |
| | | }, |
| | | created() { |
| | | this.getTreeData(); |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .purchase-left { |
| | | width: 250px; |
| | | height: 100%; |
| | | background: #fff; |
| | | margin-right: 10px; |
| | | border-radius: 16px; |
| | | box-sizing: border-box; |
| | | padding: 10px 16px; |
| | | flex-shrink: 0; |
| | | } |
| | | .purchase-right { |
| | | background: #fff; |
| | | width: calc(100% - 15em); |
| | | height: 100%; |
| | | border-radius: 16px; |
| | | box-sizing: border-box; |
| | | padding: 10px 16px; |
| | | } |
| | | .purchase-page { |
| | | display: flex; |
| | | padding-top: 10px; |
| | | padding-bottom: 10px; |
| | | box-sizing: border-box; |
| | | width: 100%; |
| | | } |
| | | </style> |
| | |
| | | // const javaApi = 'http://10.1.13.77:8001'; |
| | | |
| | | // éä¿¡æ£å¼åº |
| | | Vue.prototype.LOCATIONVUE = "http://10.193.45.63:8080"; |
| | | const javaApi = 'https://ztwxlims.ztt.cn:7443/lims/'; |
| | | // Vue.prototype.LOCATIONVUE = "http://10.193.45.63:8080"; |
| | | // const javaApi = 'https://ztwxlims.ztt.cn:7443/lims/'; |
| | | |
| | | // //äº |
| | | // Vue.prototype.LOCATIONVUE = "http://114.132.189.42:8080"; |