From 7480271afcd5bbee7cc9829aa845d5679e4e239f Mon Sep 17 00:00:00 2001 From: chenrui <1187576398@qq.com> Date: 星期三, 26 二月 2025 16:39:04 +0800 Subject: [PATCH] 服务和供应品采购 --- src/api/cnas/externalService/serviceAndSupplyPro/serviceAndSupplyPro.js | 10 src/views/CNAS/resourceDemand/standardMaterialAccept/component/AddRecord.vue | 16 src/views/CNAS/externalService/serviceAndSupplyPro/component/CardPanel.vue | 74 ++++ src/views/CNAS/externalService/serviceAndSupplyPro/component/ConsumableOverview.vue | 121 +++++++ src/views/CNAS/externalService/serviceAndSupplyPro/component/index.vue | 71 ++++ src/views/CNAS/resourceDemand/standardMaterialAccept/index.vue | 29 - src/views/CNAS/externalService/serviceAndSupplyPro/index.vue | 178 +++++++++++ src/views/CNAS/resourceDemand/standardMaterialAccept/component/Step1.vue | 393 ++++++++++++------------ src/api/cnas/resourceDemand/standardMaterialAccept/standardMaterialAccept.js | 12 9 files changed, 672 insertions(+), 232 deletions(-) diff --git a/src/api/cnas/externalService/serviceAndSupplyPro/serviceAndSupplyPro.js b/src/api/cnas/externalService/serviceAndSupplyPro/serviceAndSupplyPro.js new file mode 100644 index 0000000..890fb4e --- /dev/null +++ b/src/api/cnas/externalService/serviceAndSupplyPro/serviceAndSupplyPro.js @@ -0,0 +1,10 @@ +import request from '@/utils/request' + +// 鏈嶅姟鍜屼緵搴斿搧閲囪喘 +export function procurementSuppliesList(query) { + return request({ + url: '/procurementSuppliesList/procurementSuppliesList', + method: 'get', + params: query + }) +} diff --git a/src/api/cnas/resourceDemand/standardMaterialAccept/standardMaterialAccept.js b/src/api/cnas/resourceDemand/standardMaterialAccept/standardMaterialAccept.js index 707631a..010c461 100644 --- a/src/api/cnas/resourceDemand/standardMaterialAccept/standardMaterialAccept.js +++ b/src/api/cnas/resourceDemand/standardMaterialAccept/standardMaterialAccept.js @@ -24,6 +24,18 @@ }) } +/** + * @desc 鏍囧噯鐗╄川娓呭崟 + */ +export function getStandardSubstanceAll(query) { + return request({ + url: '/feStandardSubstance/getStandardSubstanceAll', + method: 'get', + params: query + }) +} + + diff --git a/src/views/CNAS/externalService/serviceAndSupplyPro/component/CardPanel.vue b/src/views/CNAS/externalService/serviceAndSupplyPro/component/CardPanel.vue new file mode 100644 index 0000000..ec4034f --- /dev/null +++ b/src/views/CNAS/externalService/serviceAndSupplyPro/component/CardPanel.vue @@ -0,0 +1,74 @@ +<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> diff --git a/src/views/CNAS/externalService/serviceAndSupplyPro/component/ConsumableOverview.vue b/src/views/CNAS/externalService/serviceAndSupplyPro/component/ConsumableOverview.vue new file mode 100644 index 0000000..6c465f3 --- /dev/null +++ b/src/views/CNAS/externalService/serviceAndSupplyPro/component/ConsumableOverview.vue @@ -0,0 +1,121 @@ +<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> + <limsTable + style="margin-top: 18px; padding: 0 15px;" + :height="'20vh'" + :column="columns" + :table-data="tableData" + > + </limsTable> + </template> + </TableCard> + </div> +</template> +<script> +import CardPanel from './CardPanel.vue'; +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 }, + 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) { + procurementSuppliesList({contentsId: id}).then(res => { + if(res.code == 200) { + this.cardList = res.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> diff --git a/src/views/CNAS/externalService/serviceAndSupplyPro/component/index.vue b/src/views/CNAS/externalService/serviceAndSupplyPro/component/index.vue new file mode 100644 index 0000000..67f98a5 --- /dev/null +++ b/src/views/CNAS/externalService/serviceAndSupplyPro/component/index.vue @@ -0,0 +1,71 @@ +<template> + <div class="table_card"> + <div v-if="showTitle" class="title"> + <span style="font-weight: bold">{{ title }}</span> + </div> + <div> + <slot name="tab"></slot> + </div> + <div v-if="showForm" class="table_card_form"> + <slot name="form"></slot> + </div> + <div> + <slot name="table"></slot> + </div> + </div> +</template> +<script> +export default { + props: { + title: { + type: String, + default: '鏍囬' + }, + showTitle: { + type: Boolean, + default: true + }, + showForm: { + type: Boolean, + default: true + } + }, + data() { + return {}; + } +}; +</script> +<style scoped> +.table_card { + text-align: left; +} + +.title { + position: relative; + font-size: 18px; + color: #333; + font-weight: 400; + padding-left: 10px; + margin-left: 15px; +} + +.title::before { + position: absolute; + left: 0; + top: 4px; + content: ''; + width: 4px; + height: 18px; + background-color: #3A7BFA; + border-radius: 2px; +} + +.table_card_form { + display: flex; + justify-content: space-between; + height: 34px; + padding: 0 15px; + margin-bottom: 10px; +} + +</style> diff --git a/src/views/CNAS/externalService/serviceAndSupplyPro/index.vue b/src/views/CNAS/externalService/serviceAndSupplyPro/index.vue new file mode 100644 index 0000000..836d07a --- /dev/null +++ b/src/views/CNAS/externalService/serviceAndSupplyPro/index.vue @@ -0,0 +1,178 @@ +<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 "../serviceAndSupplyPro/component/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> diff --git a/src/views/CNAS/resourceDemand/standardMaterialAccept/component/AddRecord.vue b/src/views/CNAS/resourceDemand/standardMaterialAccept/component/AddRecord.vue index 1e54f5e..bd776c7 100644 --- a/src/views/CNAS/resourceDemand/standardMaterialAccept/component/AddRecord.vue +++ b/src/views/CNAS/resourceDemand/standardMaterialAccept/component/AddRecord.vue @@ -1,12 +1,12 @@ <template> <el-dialog :visible.sync="dialogVisible" title="鏍囧噯鐗╄川楠屾敹璁板綍" width="70%"> - <!-- <el-steps :active="currentStep" finish-status="success"> + <el-steps :active="currentStep" finish-status="success"> <el-step class="cursor-pointer" v-for="(item, index) in steps" :key="index" :title="item"> </el-step> - </el-steps> --> -<!-- <el-form :model="model" label-width="140px" size="small">--> -<!-- <Step1 :model.sync="model"></Step1>--> -<!-- </el-form>--> + </el-steps> + <el-form :model="model" label-width="140px" size="small"> + <Step1 :model.sync="model"></Step1> + </el-form> <span slot="footer" class="dialog-footer"> <el-button @click="dialogVisible = false">鍙� 娑�</el-button> <el-button type="primary" @click="submit">淇� 瀛�</el-button> @@ -15,16 +15,16 @@ </template> <script> -// import Step1 from './Step/Step1.vue' +import Step1 from './Step1.vue' export default { components: { - // Step1 + Step1 }, data() { return { dialogVisible: false, currentStep: 0, // 姝ラ鏉℃樉绀虹鍑犳 - // steps: ['鎻愪氦', '寮�绠遍獙鏀跺鏍�', '瀹夎楠屾敹妫�鏌�', '瀹夎楠屾敹澶嶆牳', '楠屾敹鏍告煡', '楠屾敹鏍告煡瀹℃牳'], + steps: ['鎻愪氦', '寮�绠遍獙鏀跺鏍�', '瀹夎楠屾敹妫�鏌�', '瀹夎楠屾敹澶嶆牳', '楠屾敹鏍告煡', '楠屾敹鏍告煡瀹℃牳'], model: { acceptance: { id: undefined, diff --git a/src/views/CNAS/resourceDemand/standardMaterialAccept/component/Step1.vue b/src/views/CNAS/resourceDemand/standardMaterialAccept/component/Step1.vue index c1f26ad..967c41b 100644 --- a/src/views/CNAS/resourceDemand/standardMaterialAccept/component/Step1.vue +++ b/src/views/CNAS/resourceDemand/standardMaterialAccept/component/Step1.vue @@ -1,201 +1,198 @@ -<!--<template>--> -<!-- <el-card class="card">--> -<!-- <el-col :span="12">--> -<!-- <el-form-item label="鍘傚浠h〃">--> -<!-- <el-input v-model="model.acceptance.producer"></el-input>--> -<!-- </el-form-item>--> -<!-- </el-col>--> -<!-- <el-col :span="12">--> -<!-- <el-form-item label="鐩稿叧闄勪欢">--> -<!-- <div class="table-between">--> -<!-- <el-input v-model="model.acceptance.file" style="width: 82%;"></el-input>--> -<!-- <el-upload--> -<!-- ref="upload"--> -<!-- style="float: left; margin: 0 12px 0 20px;"--> -<!-- :action="action"--> -<!-- :show-file-list="false"--> -<!-- :on-success="onSuccess"--> -<!-- >--> -<!-- <el-button type="primary">--> -<!-- 闄勪欢涓婁紶--> -<!-- </el-button>--> -<!-- </el-upload>--> -<!-- </div>--> -<!-- </el-form-item>--> -<!-- </el-col>--> -<!-- <el-col :span="12">--> -<!-- <el-form-item label="鎺ユ敹浜�">--> -<!-- <el-input v-model="model.acceptance.recipient"></el-input>--> -<!-- </el-form-item>--> -<!-- </el-col>--> -<!-- <el-col :span="12">--> -<!-- <el-form-item label="鎺ュ彈绛惧瓧">--> -<!-- <el-input v-model="model.acceptance.signature"></el-input>--> -<!-- </el-form-item>--> -<!-- </el-col>--> -<!-- <el-col :span="12">--> -<!-- <el-form-item label="楠屾敹鎯呭喌">--> -<!-- <el-input v-model="model.acceptance.situation"></el-input>--> -<!-- </el-form-item>--> -<!-- </el-col>--> -<!-- <el-col :span="12">--> -<!-- <el-form-item label="瀹夎璋冭瘯鎯呭喌">--> -<!-- <el-input v-model="model.acceptance.installation"></el-input>--> -<!-- </el-form-item>--> -<!-- </el-col>--> -<!-- <el-col :span="12">--> -<!-- <el-form-item label="娓呭崟" prop="substanceId" required>--> -<!-- <el-select v-model="model.acceptance.substanceId" placeholder="璇烽�夋嫨" style="width: 100%">--> -<!-- <el-option--> -<!-- v-for="item in options"--> -<!-- :key="item.value"--> -<!-- :label="item.name"--> -<!-- :value="item.id">--> -<!-- </el-option>--> -<!-- </el-select>--> -<!-- </el-form-item>--> -<!-- </el-col>--> -<!-- <el-col :span="12">--> -<!-- <el-form-item label="鍒拌揣鏃ユ湡">--> -<!-- <el-date-picker--> -<!-- v-model="model.acceptance.arriveDate"--> -<!-- align="right"--> -<!-- type="date"--> -<!-- placeholder="閫夋嫨鏃ユ湡"--> -<!-- style="width: 100%"--> -<!-- value-format="yyyy-MM-dd"--> -<!-- >--> -<!-- </el-date-picker>--> -<!-- </el-form-item>--> -<!-- </el-col>--> -<!-- <el-col :span="12">--> -<!-- <el-form-item label="缁翠慨鍗曚綅">--> -<!-- <el-input v-model="model.acceptance.maintenanceUnit"></el-input>--> -<!-- </el-form-item>--> -<!-- </el-col>--> -<!-- <el-col :span="24">--> -<!-- <el-form-item label="澶囦欢纭">--> -<!-- <el-button type="primary" style="float: right;" @click="addSpareTable">澧炲姞琛�</el-button>--> -<!-- </el-form-item>--> -<!-- </el-col>--> -<!-- <el-col :span="24">--> -<!-- <el-form-item>--> -<!-- <ZTTable--> -<!-- style="margin-bottom: 20px;"--> -<!-- :column="spareColumns"--> -<!-- :table-data="model.list"--> -<!-- >--> -<!-- <template slot="name" slot-scope="{ row, index }">--> -<!-- <el-input v-if="row.isEdit" size="small" v-model="row.name"></el-input>--> -<!-- <span v-else>{{ row.name }}</span>--> -<!-- </template>--> -<!-- <template slot="number" slot-scope="{ row, index }">--> -<!-- <el-input v-if="row.isEdit" size="small" v-model="row.number"></el-input>--> -<!-- <span v-else>{{ row.number }}</span>--> -<!-- </template>--> -<!-- <template slot="action" slot-scope="{ row, index }">--> -<!-- <div v-if="row.isEdit">--> -<!-- <el-button type="text" @click="save(index)">淇濆瓨</el-button>--> -<!-- <el-button type="text">鍙栨秷</el-button>--> -<!-- </div>--> -<!-- <div v-else>--> -<!-- <el-button type="text" @click="edit(index)">淇敼</el-button>--> -<!-- </div>--> -<!-- </template>--> -<!-- </ZTTable>--> -<!-- </el-form-item>--> -<!-- </el-col>--> -<!-- </el-card>--> -<!--</template>--> +<template> + <el-card class="card"> + <el-col :span="12"> + <el-form-item label="鍘傚浠h〃"> + <el-input v-model="model.acceptance.producer"></el-input> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="鐩稿叧闄勪欢"> + <div class="table-between"> + <el-input v-model="model.acceptance.file" style="width: 82%;"></el-input> + <el-upload + ref="upload" + style="float: left; margin: 0 12px 0 20px;" + :action="action" + :show-file-list="false" + :on-success="onSuccess" + > + <el-button type="primary"> + 闄勪欢涓婁紶 + </el-button> + </el-upload> + </div> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="鎺ユ敹浜�"> + <el-input v-model="model.acceptance.recipient"></el-input> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="鎺ュ彈绛惧瓧"> + <el-input v-model="model.acceptance.signature"></el-input> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="楠屾敹鎯呭喌"> + <el-input v-model="model.acceptance.situation"></el-input> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="瀹夎璋冭瘯鎯呭喌"> + <el-input v-model="model.acceptance.installation"></el-input> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="娓呭崟" prop="substanceId" required> + <el-select v-model="model.acceptance.substanceId" placeholder="璇烽�夋嫨" style="width: 100%"> + <el-option + v-for="item in options" + :key="item.value" + :label="item.name" + :value="item.id"> + </el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="鍒拌揣鏃ユ湡"> + <el-date-picker + v-model="model.acceptance.arriveDate" + align="right" + type="date" + placeholder="閫夋嫨鏃ユ湡" + style="width: 100%" + value-format="yyyy-MM-dd" + > + </el-date-picker> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="缁翠慨鍗曚綅"> + <el-input v-model="model.acceptance.maintenanceUnit"></el-input> + </el-form-item> + </el-col> + <el-col :span="24"> + <el-form-item label="澶囦欢纭"> + <el-button type="primary" style="float: right;" @click="addSpareTable">澧炲姞琛�</el-button> + </el-form-item> + </el-col> + <el-col :span="24"> + <el-form-item> + <lims-table :tableData="model.list" :column="spareColumns" :height="'calc(100vh - 250px)'"> + <template slot="name" slot-scope="{ row, index }"> + <el-input v-if="row.isEdit" size="small" v-model="row.name"></el-input> + <span v-else>{{ row.name }}</span> + </template> + <template slot="number" slot-scope="{ row, index }"> + <el-input v-if="row.isEdit" size="small" v-model="row.number"></el-input> + <span v-else>{{ row.number }}</span> + </template> + <template slot="action" slot-scope="{ row, index }"> + <div v-if="row.isEdit"> + <el-button type="text" @click="save(index)">淇濆瓨</el-button> + <el-button type="text">鍙栨秷</el-button> + </div> + <div v-else> + <el-button type="text" @click="edit(index)">淇敼</el-button> + </div> + </template> + </lims-table> + </el-form-item> + </el-col> + </el-card> +</template> -<!--<script>--> -<!--import ZTTable from '@/components/caorui/ZTTable/index.vue';--> -<!--import { getStandardSubstanceAll } from "@/assets/api/api";--> -<!--import axios from 'axios';--> +<script> +// import { getStandardSubstanceAll } from "@/assets/api/api"; +import axios from 'axios'; +import limsTable from '@/components/Table/lims-table.vue' +import { + getStandardSubstanceAll +} from '@/api/cnas/resourceDemand/standardMaterialAccept/standardMaterialAccept' -<!--export default {--> -<!-- components: {--> -<!-- ZTTable--> -<!-- },--> -<!-- props: {--> -<!-- model: {--> -<!-- type: Object,--> -<!-- default: () => {}--> -<!-- }--> -<!-- },--> -<!-- data() {--> -<!-- return {--> -<!-- spareColumns: [--> -<!-- {--> -<!-- label: "鍚嶇О",--> -<!-- prop: "name",--> -<!-- align: "center",--> -<!-- dataType: "slot",--> -<!-- slot: "name",--> -<!-- }, {--> -<!-- label: "鏁伴噺",--> -<!-- prop: "number",--> -<!-- align: "center",--> -<!-- dataType: "slot",--> -<!-- slot: "number",--> -<!-- }, {--> -<!-- label: "鎿嶄綔",--> -<!-- align: "center",--> -<!-- dataType: "slot",--> -<!-- slot: "action",--> -<!-- width: 150--> -<!-- }--> -<!-- ],--> -<!-- options: []--> -<!-- }--> -<!-- },--> -<!-- computed: {--> -<!-- action() {--> -<!-- return `${this.javaApi}/${this.$api.personnel.saveCNASFile}`--> -<!-- }--> -<!-- },--> -<!-- mounted() {--> -<!-- this.getStand()--> -<!-- },--> -<!-- methods: {--> -<!-- async getStand() {--> -<!-- const { code, data } = await axios({--> -<!-- url: getStandardSubstanceAll,--> -<!-- method: 'get'--> -<!-- })--> -<!-- this.options = data--> -<!-- },--> -<!-- addSpareTable() {--> -<!-- this.model.list.push({--> -<!-- acceptanceId: this.model.acceptance.id,--> -<!-- name: '',--> -<!-- number: '',--> -<!-- isEdit: true--> -<!-- })--> -<!-- },--> -<!-- onSuccess(response) {--> -<!-- this.model.acceptance.file = response.data--> -<!-- this.$emit('update:model', this.model)--> -<!-- },--> -<!-- save(index) {--> -<!-- this.model.list[index].isEdit = false--> -<!-- this.$emit('update:model', this.model)--> -<!-- },--> -<!-- edit(index) {--> -<!-- this.model.list[index].isEdit = true--> -<!-- }--> -<!-- }--> -<!--}--> -<!--</script>--> +export default { + components: { + limsTable + }, + props: { + model: { + type: Object, + default: () => {} + } + }, + data() { + return { + spareColumns: [ + { + label: "鍚嶇О", + prop: "name", + align: "center", + dataType: "slot", + slot: "name", + }, { + label: "鏁伴噺", + prop: "number", + align: "center", + dataType: "slot", + slot: "number", + }, { + label: "鎿嶄綔", + align: "center", + dataType: "slot", + slot: "action", + width: 150 + } + ], + options: [] + } + }, + computed: { + action() { + return `${this.javaApi}/personBasicInfo/saveCNASFile` + } + }, + mounted() { + this.getStand() + }, + methods: { + async getStand() { + getStandardSubstanceAll().then(res => { + this.options = res.data + }) + }, + addSpareTable() { + this.model.list.push({ + acceptanceId: this.model.acceptance.id, + name: '', + number: '', + isEdit: true + }) + }, + onSuccess(response) { + this.model.acceptance.file = response.data + this.$emit('update:model', this.model) + }, + save(index) { + this.model.list[index].isEdit = false + this.$emit('update:model', this.model) + }, + edit(index) { + this.model.list[index].isEdit = true + } + } +} +</script> -<!--<style scoped>--> -<!--.card {--> -<!-- margin-top: 1em;--> -<!-- height: 56vh;--> -<!-- overflow-y: scroll;--> -<!--}--> -<!--.table-between {--> -<!-- display: flex;--> -<!-- justify-content: space-between;--> -<!--}--> -<!--</style>--> +<style scoped> +.card { + margin-top: 1em; + height: 56vh; + overflow-y: scroll; +} +.table-between { + display: flex; + justify-content: space-between; +} +</style> diff --git a/src/views/CNAS/resourceDemand/standardMaterialAccept/index.vue b/src/views/CNAS/resourceDemand/standardMaterialAccept/index.vue index 1a67d66..241a3c0 100644 --- a/src/views/CNAS/resourceDemand/standardMaterialAccept/index.vue +++ b/src/views/CNAS/resourceDemand/standardMaterialAccept/index.vue @@ -23,30 +23,6 @@ </div> <AddRecord ref="addRecordRef" @submit="submit"></AddRecord> </div> - - <!-- <div class="tables">--> - <!-- <ZTTable--> - <!-- :column="columns"--> - <!-- :table-data="tableData"--> - <!-- >--> - <!-- <template slot="action" slot-scope="{ row }">--> - <!-- <el-button type="text" @click="edit(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>--> - <!-- </div>--> - <!-- <AddRecord ref="addRecordRef" @submit="submit"></AddRecord>--> </template> <script> @@ -56,6 +32,7 @@ // import AddRecord from './components/AddRecord.vue'; import limsTable from '@/components/Table/lims-table.vue' +import AddRecord from './component/AddRecord.vue'; import { getPageAcceptance, updateAcceptanc, @@ -63,8 +40,8 @@ } from '@/api/cnas/resourceDemand/standardMaterialAccept/standardMaterialAccept' export default { components: { - limsTable - + limsTable, + AddRecord }, data() { return { -- Gitblit v1.9.3