| | |
| | | > --> |
| | | <el-tab-pane name="weight" |
| | | ><span class="mulsz" slot="label" |
| | | ><i class="el-icon-s-data"></i>身é«å¤´å´è¶å¿ |
| | | ><i class="el-icon-s-data"></i>身é¿å¤´å´è¶å¿ |
| | | </span></el-tab-pane |
| | | > |
| | | <!-- <el-tab-pane name="heartrate" |
| | |
| | | class="sontwoactiveName" |
| | | style="width: 880px; height: 560px" |
| | | ></div> |
| | | <div style="width: 400px"> |
| | | <div style="width: 600px"> |
| | | <el-card class="box-card"> |
| | | <el-button @click="borninfoVisible = true" type="success" round |
| | | >æ·»å æ°æ®</el-button |
| | | > |
| | | <SFtable |
| | | :currentList="borninfooptions" |
| | | :tableLabel="tableLabeltz" |
| | | :serialnumber="false" |
| | | :center="false" |
| | | :multiplechoice="false" |
| | | /> |
| | | <el-table :data="borninfooptions" style="width: 100%" border> |
| | | <el-table-column |
| | | prop="generatedTime" |
| | | label="è®°å½æ¥æ" |
| | | width="120" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <span v-if="!scope.row.editing">{{ |
| | | scope.row.generatedTime |
| | | }}</span> |
| | | <!-- <el-date-picker |
| | | v-else |
| | | v-model="scope.row.generatedTime" |
| | | type="date" |
| | | placeholder="éæ©æ¥æ" |
| | | value-format="yyyy-MM-dd" |
| | | size="small" |
| | | ></el-date-picker> --> |
| | | <el-date-picker |
| | | v-else |
| | | v-model="scope.row.generatedTime" |
| | | type="datetime" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | placeholder="éæ©æ¥ææ¶é´" |
| | | size="small" |
| | | > |
| | | </el-date-picker> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="doctor" label="责任å»ç" width="100"> |
| | | <template slot-scope="scope"> |
| | | <span v-if="!scope.row.editing">{{ scope.row.doctor }}</span> |
| | | <el-input |
| | | v-else |
| | | v-model="scope.row.doctor" |
| | | size="small" |
| | | placeholder="请è¾å
¥å»çå§å" |
| | | ></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="height" label="身é¿(cm)" width="100"> |
| | | <template slot-scope="scope"> |
| | | <span v-if="!scope.row.editing">{{ scope.row.height }}</span> |
| | | <el-input |
| | | v-else |
| | | v-model.number="scope.row.height" |
| | | size="small" |
| | | placeholder="身é¿" |
| | | ></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="headCir" label="头å´(cm)" width="100"> |
| | | <template slot-scope="scope"> |
| | | <span v-if="!scope.row.editing">{{ scope.row.headCir }}</span> |
| | | <el-input |
| | | v-else |
| | | v-model.number="scope.row.headCir" |
| | | size="small" |
| | | placeholder="头å´" |
| | | ></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="age" label="èé¾(å¨)" width="100"> |
| | | <template slot-scope="scope"> |
| | | <span v-if="!scope.row.editing">{{ scope.row.age }}</span> |
| | | <el-input |
| | | v-else |
| | | v-model.number="scope.row.age" |
| | | size="small" |
| | | placeholder="èé¾" |
| | | ></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="weight" label="ä½é(kg)" width="100"> |
| | | <template slot-scope="scope"> |
| | | <span v-if="!scope.row.editing">{{ scope.row.weight }}</span> |
| | | <el-input |
| | | v-else |
| | | v-model.number="scope.row.weight" |
| | | size="small" |
| | | placeholder="ä½é" |
| | | ></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä½" width="180" fixed="right"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | v-if="!scope.row.editing" |
| | | type="primary" |
| | | size="mini" |
| | | @click="handleEdit(scope.row)" |
| | | >ç¼è¾</el-button |
| | | > |
| | | <el-button |
| | | v-else |
| | | type="success" |
| | | size="mini" |
| | | @click="handleSave(scope.row)" |
| | | >ä¿å</el-button |
| | | > |
| | | <el-button |
| | | v-if="!scope.row.editing" |
| | | type="danger" |
| | | size="mini" |
| | | @click="handleDelete(scope.$index, scope.row)" |
| | | >å é¤</el-button |
| | | > |
| | | <el-button v-else size="mini" @click="handleCancel(scope.row)" |
| | | >åæ¶</el-button |
| | | > |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-card> |
| | | </div> |
| | | </div> |
| | |
| | | :model="borninfoform" |
| | | label-width="120px" |
| | | > |
| | | <!-- èº«é« --> |
| | | <el-form-item label="身é«(cm)" prop="height"> |
| | | <!-- èº«é¿ --> |
| | | <el-form-item label="身é¿(cm)" prop="height"> |
| | | <el-input |
| | | v-model.number="borninfoform.height" |
| | | autocomplete="off" |
| | | placeholder="请è¾å
¥èº«é«ï¼30-120cmï¼" |
| | | placeholder="请è¾å
¥èº«é¿ï¼30-120cmï¼" |
| | | > |
| | | </el-input> |
| | | </el-form-item> |
| | |
| | | > |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="ä½éï¼kgï¼" prop="weight"> |
| | | <el-input |
| | | v-model.number="borninfoform.weight" |
| | | autocomplete="off" |
| | | placeholder="请è¾å
¥ä½é" |
| | | > |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="è®°å½æ¥æ" prop="generatedTime"> |
| | | <!-- <el-date-picker |
| | | v-model="borninfoform.generatedTime" |
| | | type="date" |
| | | placeholder="éæ©æ¥æ" |
| | | > |
| | | </el-date-picker> --> |
| | | <el-date-picker |
| | | v-model="borninfoform.generatedTime" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | type="datetime" |
| | | placeholder="éæ©æ¥ææ¶é´" |
| | | > |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | |
| | | <!-- èé¾ --> |
| | | <el-form-item label="èé¾ï¼å¨ï¼" prop="age"> |
| | | <el-input |
| | | v-model.number="borninfoform.age" |
| | | v-model="borninfoform.age" |
| | | autocomplete="off" |
| | | placeholder="请è¾å
¥èé¾" |
| | | > |
| | |
| | | import { |
| | | listPatouthosp, |
| | | newborninfoadd, |
| | | newborninfoedit, |
| | | newborninforemove, |
| | | newborninfolist, |
| | | } from "@/api/smartor/patouthosp"; |
| | | import { listpatient } from "@/api/patient/record"; |
| | |
| | | dynamicTags: [], |
| | | borninforules: { |
| | | height: [ |
| | | { required: true, message: "身é«ä¸è½ä¸ºç©º", trigger: "blur" }, |
| | | { required: true, message: "身é¿ä¸è½ä¸ºç©º", trigger: "blur" }, |
| | | { |
| | | type: "number", |
| | | message: "å¿
须为æ°åå¼", |
| | |
| | | }, |
| | | { |
| | | validator: (rule, value, callback) => { |
| | | // æ°çå¿èº«é«ä¸è¬èå´ï¼30-120cm |
| | | // æ°çå¿èº«é¿ä¸è¬èå´ï¼30-120cm |
| | | if (value < 30 || value > 120) { |
| | | callback(new Error("请è¾å
¥30-120cmä¹é´çåç身é«å¼")); |
| | | callback(new Error("请è¾å
¥30-120cmä¹é´çåç身é¿å¼")); |
| | | } else if (!/^[0-9]+(\.[0-9]{1})?$/.test(value)) { |
| | | callback(new Error("æå¤ä¿çä¸ä½å°æ°")); |
| | | } else { |
| | |
| | | ], |
| | | age: [ |
| | | { required: true, message: "èé¾ä¸è½ä¸ºç©º", trigger: "blur" }, |
| | | { type: "integer", message: "å¿
é¡»ä¸ºæ´æ°å¨æ°" }, |
| | | // { type: "integer", message: "å¿
é¡»ä¸ºæ´æ°å¨æ°" }, |
| | | { |
| | | validator: (rule, value, callback) => { |
| | | // æ£æ¥æ¯å¦å·²åå¨è¯¥å¨æ°æ°æ® |
| | |
| | | { label: "èå¼ å", width: "", prop: "age" }, |
| | | ], |
| | | tableLabeltz: [ |
| | | { label: "æ¥æ", width: "", prop: "generatedTime" }, |
| | | { label: "责任å»ç", width: "", prop: "doctor" }, |
| | | { label: "身é«", width: "", prop: "height" }, |
| | | { label: "头å´", width: "", prop: "headCir" }, |
| | | { label: "身é¿(cm)", width: "", prop: "height" }, |
| | | { label: "头å´(cm)", width: "", prop: "headCir" }, |
| | | { label: "èé¾(å¨)", width: "", prop: "age" }, |
| | | { label: "ä½é(kg)", width: "", prop: "weight" }, |
| | | ], |
| | | tableLabelxl: [ |
| | | { label: "æµéæ¶é´", width: "", prop: "name" }, |
| | |
| | | if (tab.index == "1") { |
| | | this.getList(1); |
| | | } else if (tab.index == "2") { |
| | | console.log(1111); |
| | | |
| | | this.newcharts(); |
| | | } else if (tab.index == "3") { |
| | | this.handleClickfw(); |
| | |
| | | newborninfoadd(this.borninfoform).then((res) => { |
| | | if (res.code == 200) { |
| | | this.$modal.msgSuccess("æ°å¢æå"); |
| | | this.newbornList(); |
| | | // this.newbornList(); |
| | | this.tzechartsInit(); |
| | | this.borninfoVisible = false; |
| | | } else { |
| | | this.$modal.msgError("æ°å¢å¤±è´¥"); |
| | | this.newbornList(); |
| | | // this.newbornList(); |
| | | this.tzechartsInit(); |
| | | this.borninfoVisible = false; |
| | | } |
| | | }); |
| | |
| | | // 使ç¨åæå®çé
ç½®é¡¹åæ°æ®æ¾ç¤ºå¾è¡¨ã |
| | | myxyChart.setOption(option); |
| | | }, |
| | | tzechartsInit() { |
| | | // è·åæ°æ®éå |
| | | this.newbornList() |
| | | .then(() => { |
| | | // æ£æ¥æ°æ®æææ§ |
| | | // æ°çå¿å¾è¡¨ |
| | | // æ°çå¿å¾è¡¨ - ä½¿ç¨æ¶é´è½´ |
| | | async tzechartsInit() { |
| | | try { |
| | | // çå¾
æ°æ®å è½½å®æ |
| | | await this.newbornList(); |
| | | |
| | | if (!this.borninfooptions || this.borninfooptions.length === 0) { |
| | | console.warn("没æå¯ç¨çæ°çå¿æ°æ®"); |
| | | return; |
| | | } |
| | | // æ¾åºæå¤§çageå¼ï¼ç¡®å®Xè½´èå´ï¼ |
| | | const maxAge = Math.max( |
| | | ...this.borninfooptions.map((item) => parseInt(item.age) || 0) |
| | | |
| | | // åå§åå¾è¡¨ |
| | | const myChart = echarts.init(this.tzechartdom); |
| | | |
| | | // å¤çæ°æ® - ææ¶é´æåº |
| | | const sortedData = this.borninfooptions |
| | | .filter((item) => item.generatedTime) |
| | | .sort( |
| | | (a, b) => new Date(a.generatedTime) - new Date(b.generatedTime) |
| | | ); |
| | | if (maxAge <= 0) { |
| | | console.error("æ æç卿°æ°æ®"); |
| | | |
| | | if (sortedData.length === 0) { |
| | | console.warn("æ²¡æææçæ¶é´æ°æ®"); |
| | | return; |
| | | } |
| | | |
| | | // 卿çæxAxisæ°æ®ï¼ä»1å¨å°æå¤§å¨ï¼ |
| | | const xAxisData = Array.from( |
| | | { length: maxAge }, |
| | | (_, i) => `${i + 1}å¨` |
| | | ); |
| | | // åå¤å¾è¡¨æ°æ® |
| | | const timeData = sortedData.map((item) => item.generatedTime); |
| | | const heightData = sortedData.map((item) => ({ |
| | | name: item.generatedTime, |
| | | value: [item.generatedTime, item.height || null], |
| | | })); |
| | | const headCirData = sortedData.map((item) => ({ |
| | | name: item.generatedTime, |
| | | value: [item.generatedTime, item.headCir || null], |
| | | })); |
| | | const weightData = sortedData.map((item) => ({ |
| | | name: item.generatedTime, |
| | | value: [item.generatedTime, item.weight || null], |
| | | })); |
| | | |
| | | // åå§åæ°æ®æ°ç» |
| | | const heightData = Array(maxAge).fill(null); |
| | | const headCirData = Array(maxAge).fill(null); |
| | | |
| | | // éåæææ°æ®ç¹ï¼å¡«å
å°å¯¹åºä½ç½® |
| | | this.borninfooptions.forEach((item) => { |
| | | try { |
| | | const age = parseInt(item.age); |
| | | const height = parseFloat(item.height); |
| | | const headCir = parseFloat(item.headCir); |
| | | |
| | | // ç¡®ä¿æ°æ®ææä¸å¨æ°å¨èå´å
|
| | | if (age > 0 && age <= maxAge) { |
| | | const weekIndex = age - 1; |
| | | if (!isNaN(height)) heightData[weekIndex] = height; |
| | | if (!isNaN(headCir)) headCirData[weekIndex] = headCir; |
| | | } |
| | | } catch (e) { |
| | | console.error("æ°æ®å¤çé误:", e); |
| | | } |
| | | }); |
| | | |
| | | // è·åæ£è
å§åï¼ä½¿ç¨ç¬¬ä¸æ¡æææ°æ®ï¼ |
| | | const patientName = this.borninfooptions[0]?.name || "æªç¥"; |
| | | |
| | | // åå§åå¾è¡¨ |
| | | const myxyChart = echarts.init(this.tzechartdom); |
| | | const option = { |
| | | title: { |
| | | text: `${patientName}çé¿åè²ææ å¾`, |
| | | text: "æ°çå¿çé¿åè²è¶å¿å¾", |
| | | left: "center", |
| | | textStyle: { |
| | | fontSize: 16, |
| | | fontWeight: "bold", |
| | | }, |
| | | }, |
| | | tooltip: { |
| | | trigger: "axis", |
| | | formatter: function (params) { |
| | | let result = params[0].axisValue + "<br/>"; |
| | | let result = `${params[0].name}<br/>`; |
| | | params.forEach((item) => { |
| | | const value = item.value !== null ? item.value : "ææ æ°æ®"; |
| | | result += `${item.marker} ${item.seriesName}: ${value}<br/>`; |
| | | if (item.value && item.value[1] !== null) { |
| | | const unit = |
| | | item.seriesName.includes("身é¿") || |
| | | item.seriesName.includes("头å´") |
| | | ? "cm" |
| | | : item.seriesName.includes("ä½é") |
| | | ? "kg" |
| | | : ""; |
| | | result += `${item.marker} ${item.seriesName}: ${item.value[1]} ${unit}<br/>`; |
| | | } |
| | | }); |
| | | return result; |
| | | }, |
| | | }, |
| | | legend: { |
| | | data: ["身é«(cm)", "头å´(cm)"], |
| | | data: ["身é¿", "头å´", "ä½é"], |
| | | bottom: 10, |
| | | }, |
| | | grid: { |
| | | left: "3%", |
| | | right: "4%", |
| | | bottom: "15%", // 为å¾ä¾çåºç©ºé´ |
| | | bottom: "15%", |
| | | top: "15%", |
| | | containLabel: true, |
| | | }, |
| | | toolbox: { |
| | |
| | | dataView: { |
| | | title: "æ°æ®è§å¾", |
| | | readOnly: true, |
| | | lang: ["æ°æ®è§å¾", "å
³é", "å·æ°"], |
| | | }, |
| | | dataZoom: { |
| | | yAxisIndex: "none", |
| | | title: { |
| | | zoom: "åºå缩æ¾", |
| | | back: "åºå缩æ¾è¿å", |
| | | }, |
| | | }, |
| | | }, |
| | | right: 20, |
| | | top: 10, |
| | | }, |
| | | dataZoom: [ |
| | | { |
| | | type: "inside", |
| | | xAxisIndex: [0], |
| | | start: 0, |
| | | end: 100, |
| | | }, |
| | | { |
| | | type: "slider", |
| | | xAxisIndex: [0], |
| | | start: 0, |
| | | end: 100, |
| | | bottom: 0, |
| | | height: 20, |
| | | }, |
| | | ], |
| | | xAxis: { |
| | | type: "category", |
| | | boundaryGap: false, |
| | | data: xAxisData, |
| | | type: "time", // ä½¿ç¨æ¶é´è½´[1,3](@ref) |
| | | name: "è®°å½æ¶é´", |
| | | nameLocation: "middle", |
| | | nameGap: 30, |
| | | axisLabel: { |
| | | interval: 0, // æ¾ç¤ºæææ ç¾ |
| | | rotate: 30, // æ ç¾æè½¬é²æ¢éå |
| | | formatter: { |
| | | year: "{yyyy}", |
| | | month: "{MM}/{dd}", |
| | | day: "{MM}/{dd}", |
| | | hour: "{MM}/{dd}", |
| | | }, |
| | | rotate: 45, |
| | | }, |
| | | splitLine: { |
| | | show: true, |
| | | lineStyle: { |
| | | type: "dashed", |
| | | }, |
| | | }, |
| | | yAxis: { |
| | | }, |
| | | yAxis: [ |
| | | { |
| | | type: "value", |
| | | name: "身é¿/头å´(cm)", |
| | | position: "left", |
| | | axisLabel: { |
| | | formatter: "{value} cm", |
| | | }, |
| | | splitLine: { |
| | | show: true, |
| | | lineStyle: { |
| | | type: "dashed", |
| | | }, |
| | | }, |
| | | }, |
| | | { |
| | | type: "value", |
| | | name: "ä½é(kg)", |
| | | position: "right", |
| | | axisLabel: { |
| | | formatter: "{value} kg", |
| | | }, |
| | | splitLine: { |
| | | show: false, |
| | | }, |
| | | }, |
| | | ], |
| | | series: [ |
| | | { |
| | | name: "身é«", |
| | | name: "身é¿", |
| | | type: "line", |
| | | yAxisIndex: 0, |
| | | data: heightData, |
| | | smooth: true, // å¹³æ»æ²çº¿[1](@ref) |
| | | symbol: "circle", |
| | | symbolSize: 8, |
| | | symbolSize: 6, |
| | | itemStyle: { |
| | | color: "#5470C6", |
| | | }, |
| | | lineStyle: { |
| | | width: 3, |
| | | }, |
| | | connectNulls: true, // è¿æ¥ç©ºå¼ |
| | | markPoint: { |
| | | data: [ |
| | | { type: "max", name: "æå¤§å¼" }, |
| | | { type: "min", name: "æå°å¼" }, |
| | | ], |
| | | }, |
| | | connectNulls: true, |
| | | }, |
| | | { |
| | | name: "头å´", |
| | | type: "line", |
| | | yAxisIndex: 0, |
| | | data: headCirData, |
| | | smooth: true, |
| | | symbol: "circle", |
| | | symbolSize: 8, |
| | | symbolSize: 6, |
| | | itemStyle: { |
| | | color: "#91CC75", |
| | | }, |
| | | lineStyle: { |
| | | width: 3, |
| | | }, |
| | | connectNulls: true, // è¿æ¥ç©ºå¼ |
| | | markPoint: { |
| | | data: [ |
| | | { type: "max", name: "æå¤§å¼" }, |
| | | { type: "min", name: "æå°å¼" }, |
| | | ], |
| | | }, |
| | | connectNulls: true, |
| | | }, |
| | | { |
| | | name: "ä½é", |
| | | type: "line", |
| | | yAxisIndex: 1, |
| | | data: weightData, |
| | | smooth: true, |
| | | symbol: "circle", |
| | | symbolSize: 6, |
| | | itemStyle: { |
| | | color: "#EE6666", |
| | | }, |
| | | lineStyle: { |
| | | width: 3, |
| | | }, |
| | | markPoint: { |
| | | data: [ |
| | | { type: "max", name: "æå¤§å¼" }, |
| | | { type: "min", name: "æå°å¼" }, |
| | | ], |
| | | }, |
| | | connectNulls: true, |
| | | }, |
| | | ], |
| | | animationDuration: 1000, // å¨ç»æ¶é¿ |
| | | animationDuration: 1000, |
| | | }; |
| | | |
| | | // 使ç¨é
置项æ¾ç¤ºå¾è¡¨ |
| | | myxyChart.setOption(option); |
| | | myChart.setOption(option); |
| | | |
| | | // çªå£å¤§å°ååæ¶éæ°è°æ´å¾è¡¨å¤§å° |
| | | const resizeHandler = () => myxyChart.resize(); |
| | | const resizeHandler = () => myChart.resize(); |
| | | window.addEventListener("resize", resizeHandler); |
| | | |
| | | // å¨ç»ä»¶éæ¯æ¶ç§»é¤äºä»¶çå¬ï¼å¦ææ¯Vue/Reactç»ä»¶ï¼ |
| | | // å¨ç»ä»¶éæ¯æ¶ç§»é¤äºä»¶çå¬ |
| | | this.$once("hook:beforeDestroy", () => { |
| | | window.removeEventListener("resize", resizeHandler); |
| | | myxyChart.dispose(); |
| | | myChart.dispose(); |
| | | }); |
| | | }) |
| | | .catch((error) => { |
| | | console.error("å è½½æ°æ®å¤±è´¥:", error); |
| | | }); |
| | | } catch (error) { |
| | | console.error("å è½½å¾è¡¨å¤±è´¥:", error); |
| | | } |
| | | }, |
| | | |
| | | // è·åæ°çå¿æ°æ® |
| | | newbornList() { |
| | | newborninfolist({ patId: this.id }) |
| | | .then((response) => { |
| | | this.borninfooptions = response.rows || []; |
| | | // this.newcharts(); |
| | | async newbornList() { |
| | | try { |
| | | const response = await newborninfolist({ patId: this.id }); |
| | | this.borninfooptions = (response.rows || []).map((item) => ({ |
| | | ...item, |
| | | // ç¡®ä¿æ¶é´æ ¼å¼æ£ç¡® |
| | | generatedTime: item.generatedTime || item.createTime, |
| | | editing: false, |
| | | })); |
| | | console.log("å è½½çæ°çå¿æ°æ®:", this.borninfooptions); |
| | | // return Promise.resolve(); |
| | | }) |
| | | .catch((error) => { |
| | | } catch (error) { |
| | | console.error("è¯·æ±æ°æ®å¤±è´¥:", error); |
| | | this.borninfooptions = []; |
| | | // return Promise.reject(error); |
| | | }); |
| | | } |
| | | }, |
| | | // å¿ç |
| | | xlechartsInit() { |
| | |
| | | // 使ç¨åæå®çé
ç½®é¡¹åæ°æ®æ¾ç¤ºå¾è¡¨ã |
| | | myxyChart.setOption(option); |
| | | }, |
| | | // æ°çå¿æ°æ®ç¼è¾ |
| | | // ç¼è¾è¡ |
| | | handleEdit(row) { |
| | | this.$set(row, "editing", true); |
| | | // å¤ä»½åå§æ°æ®ç¨äºåæ¶æä½ |
| | | this.$set(row, "originalData", { ...row }); |
| | | }, |
| | | |
| | | // ä¿åè¡ |
| | | handleSave(row) { |
| | | this.$set(row, "editing", false); |
| | | // è°ç¨APIä¿åæ°æ® |
| | | this.saveNewbornData(row); |
| | | }, |
| | | |
| | | // åæ¶ç¼è¾ |
| | | handleCancel(row) { |
| | | this.$set(row, "editing", false); |
| | | // æ¢å¤åå§æ°æ® |
| | | if (row.originalData) { |
| | | Object.assign(row, row.originalData); |
| | | delete row.originalData; |
| | | } |
| | | }, |
| | | |
| | | // å é¤è¡ |
| | | handleDelete(index, row) { |
| | | this.$confirm("ç¡®å®è¦å é¤è¿æ¡è®°å½åï¼", "æç¤º", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | // è°ç¨APIå 餿°æ® |
| | | newborninforemove(row.id).then(() => { |
| | | this.borninfooptions.splice(index, 1); |
| | | this.$message.success("å 餿å"); |
| | | // éæ°æ¸²æå¾è¡¨ |
| | | this.tzechartsInit(); |
| | | }); |
| | | }) |
| | | .catch(() => {}); |
| | | }, |
| | | |
| | | // ä¿åæ°æ®å°å端 |
| | | async saveNewbornData(data) { |
| | | try { |
| | | const response = await newborninfoedit(data); |
| | | if (response.code === 200) { |
| | | this.$message.success("ä¿åæå"); |
| | | // éæ°å è½½æ°æ®å¹¶å·æ°å¾è¡¨ |
| | | await this.newbornList(); |
| | | this.tzechartsInit(); |
| | | } else { |
| | | this.$message.error("ä¿å失败"); |
| | | } |
| | | } catch (error) { |
| | | console.error("ä¿åæ°æ®å¤±è´¥:", error); |
| | | this.$message.error("ä¿å失败"); |
| | | } |
| | | }, |
| | | |
| | | // å 餿°æ® |
| | | async deleteNewbornData(id) { |
| | | // å®ç°å é¤APIè°ç¨ |
| | | // è¿ééè¦æ ¹æ®ä½ çå端æ¥å£å®ç° |
| | | return Promise.resolve(); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |