From 74b6e2cd66725fcf9911d59fdff41a99b56756cc Mon Sep 17 00:00:00 2001 From: qx <1084500556@qq.com> Date: 星期四, 31 七月 2025 17:56:33 +0800 Subject: [PATCH] :qx --- src/views/hosp/order/index.vue | 222 +++++++++++++++++++++++++++++-------------------------- 1 files changed, 116 insertions(+), 106 deletions(-) diff --git a/src/views/hosp/order/index.vue b/src/views/hosp/order/index.vue index 412f016..148f26b 100644 --- a/src/views/hosp/order/index.vue +++ b/src/views/hosp/order/index.vue @@ -2,7 +2,7 @@ <div v-loading="isLoading" element-loading-text="姝e湪鎻愪氦锛岃绋嶅��..." element-loading-spinner="el-icon-loading" element-loading-background="rgba(255, 255, 255, 0.8)" style="height: 100%; padding: 20px; position: relative;"> <div class="app-container"> - <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> + <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form-item label="濮撳悕" prop="name"> <el-input ref="inputName" v-model="queryParams.name" placeholder="璇疯緭鍏ュ鍚�" style="width: 150px" clearable @keyup.enter.native="handleQuery" /> @@ -15,7 +15,7 @@ <el-input ref="inputName" v-model="queryParams.xmmc" placeholder="璇疯緭鍏ヤ綋妫�椤圭洰" style="width: 150px" clearable @keyup.enter.native="handleQuery" /> </el-form-item> - <el-form-item label="鍗曚綅鍚嶇О" prop="tjCompName" > + <el-form-item label="鍗曚綅鍚嶇О" prop="tjCompName"> <el-select :remote-method="getRemoteData" v-model="queryParams.tjCompName" value-key="drugManufacturerId" style="width: 200px" remote filterable placeholder="璇烽�夋嫨鍗曚綅鍚嶇О" clearable @change="searchSelect"> <el-option v-for="dict in CompanyList" :key="dict.drugManufacturerId" :label="dict.cnName" :value="dict" /> @@ -89,8 +89,8 @@ <el-button type="primary" size="mini" @click="handleProject1" :disabled="single" v-hasPermi="['hosp:order:export']">琛ュ綍椤圭洰</el-button> </el-col> - <el-col :span="1.5"> - <el-button type="primary" size="mini" @click="revokeProject" :disabled="single" + <el-col :span="1.5"> + <el-button type="primary" size="mini" @click="revokeProject" :disabled="single" v-hasPermi="['hosp:order:export']">鎾ら攢琛ュ綍</el-button> </el-col> @@ -106,8 +106,8 @@ <el-button type="primary" size="mini" @click="budadzd" :disabled="single" v-hasPermi="['hosp:order:export']">鎵撳嵃琛ュ綍鍗�</el-button> </el-col> - <el-col :span="1.5"> - <el-button style="background-color:#E6A23C;color:#fff" size="mini" @click="handleRevoke" + <el-col :span="1.5"> + <el-button style="background-color:#E6A23C;color:#fff" size="mini" @click="handleRevoke" :disabled="singles">鎾ら攢绛惧埌</el-button> </el-col> <el-col :span="1.5"> @@ -544,90 +544,94 @@ </el-dialog> <!-- 娣诲姞琛ュ綍椤圭洰 --> - <el-dialog :title="title" :visible.sync="Projectopen1" width="1100px" style="height: 860px" append-to-body + <el-dialog :title="title" :visible.sync="Projectopen1" width="1100px" style="height: 880px" append-to-body :close-on-click-modal="false"> <div class="box"> - <div class="box1"> - <div style="text-align: center; margin-bottom: 10px; margin-top: 10px"> - 椤圭洰閫夋嫨 - </div> - <el-tabs type="border-card" style="height: 560px; margin: 0 10px; width: 100%" @tab-click="handleClick" - v-model="activeNames"> - <el-tab-pane label="缁勫悎" name="first"> - <div class="tab8"> - <el-row :gutter="20" style="width: 100%"> - <el-col :span="22"> - <el-input placeholder="杈撳叆鍏抽敭瀛楄繘琛岃繃婊�" v-model="filterage"> - </el-input> - <div class="tab3"> - <el-tree class="filter-tree" v-loading="loading" :data="packageList" :props="defaultProp" - show-checkbox node-key="id" @check-change="handlepackage" :default-checked-keys="checkedkeys" - :filter-node-method="filterpackage" ref="treas" :render-content="renderContents"> - </el-tree> - </div> - </el-col> - </el-row> + <el-row :gutter="20"> + <el-col :span="8"> + <div class="grid-content bg-purple"> + <div style="text-align: center; margin-bottom: 10px; margin-top: 10px"> + 椤圭洰閫夋嫨 </div> - </el-tab-pane> - <el-tab-pane label="鍗曢」" name="third"> - <div class="tab8"> - <el-row type="flex" class="row-bg" justify="space-around"> - <el-col :span="22"> - <el-input placeholder="杈撳叆鍏抽敭瀛楄繘琛岃繃婊�" v-model="filterText"> - </el-input> - <div class="tab3"> - <el-tree class="filter-tree" v-loading="loading" :data="Treedata" :props="defaultProps" - show-checkbox node-key="proId" @check-change="handleCurrentChecked" - :default-checked-keys="checkedkey" :filter-node-method="filterNode" ref="tree" - :render-content="renderContent"> - </el-tree> - </div> - </el-col> - </el-row> + <el-tabs type="border-card" style="height: 560px; margin: 0 10px; width: 100%" @tab-click="handleClick" + v-model="activeNames"> + <el-tab-pane label="缁勫悎" name="first"> + <div class="tab8"> + <el-row :gutter="20" style="width: 100%"> + <el-col :span="22"> + <el-input placeholder="杈撳叆鍏抽敭瀛楄繘琛岃繃婊�" v-model="filterage"> + </el-input> + <div class="tab3"> + <el-tree class="filter-tree" v-loading="loading" :data="packageList" :props="defaultProp" + show-checkbox node-key="id" @check-change="handlepackage" + :default-checked-keys="checkedkeys" :filter-node-method="filterpackage" ref="treas" + :render-content="renderContents"> + </el-tree> + </div> + </el-col> + </el-row> + </div> + </el-tab-pane> + <el-tab-pane label="鍗曢」" name="third"> + <div class="tab8"> + <el-row type="flex" class="row-bg" justify="space-around"> + <el-col :span="22"> + <el-input placeholder="杈撳叆鍏抽敭瀛楄繘琛岃繃婊�" v-model="filterText"> + </el-input> + <div class="tab3"> + <el-tree class="filter-tree" v-loading="loading" :data="Treedata" :props="defaultProps" + show-checkbox node-key="proId" @check-change="handleCurrentChecked" + :default-checked-keys="checkedkey" :filter-node-method="filterNode" ref="tree" + :render-content="renderContent"> + </el-tree> + </div> + </el-col> + </el-row> + </div> + </el-tab-pane> + </el-tabs> + </div> + </el-col> + <el-col :span="16"> + <div class="grid-content bg-purple"> + <div style="text-align: center; margin-bottom: 10px; margin-top: 9px"> + 宸查�夐」鐩垪琛� </div> - </el-tab-pane> - </el-tabs> - </div> + <el-table :data="DataList3" border style="width: 100%; table-layout: fixed" height="560" + :span-method="objectspanmethod"> + <el-table-column prop="propinName" label="妫�鏌ラ」鐩�" width="160px" :show-overflow-tooltip="true"> + </el-table-column> + <el-table-column prop="proName" label="鏄庣粏椤圭洰" width="160px" :show-overflow-tooltip="true"> + </el-table-column> + <el-table-column prop="sl" label="鏁伴噺" width="56px"> + </el-table-column> + <el-table-column prop="proPrice" label="鍘熶环" width="56px"> + </el-table-column> + <el-table-column label="鎶樻墸" width="150px"> + <template slot-scope="scope"> + <!-- @input="validateDiscount(scope.row)" --> + <el-input-number v-model.number="scope.row.discount" @change="handleManualChange(scope.row)" + placeholder="杈撳叆鎶樻墸" size="small" type="number" :precision="1" :step="0.1" :max="10" :min="0"> + </el-input-number> + </template> + </el-table-column> + <el-table-column prop="nowPrice" label="鐜颁环"> + <template slot-scope="scope"> + {{ scope.row.nowPrice ? scope.row.nowPrice.toFixed(2) : scope.row.nowPrice }} + </template> + </el-table-column> - - <div class="grid-content bg-purple"> - <div style="text-align: center; margin-bottom: 10px; margin-top: 9px"> - 宸查�夐」鐩垪琛� - </div> - <el-table :data="DataList3" border style="width: 100%; table-layout: fixed" height="560" - :span-method="objectspanmethod"> - <el-table-column prop="propinName" label="妫�鏌ラ」鐩�" width="160px" :show-overflow-tooltip="true"> - </el-table-column> - <el-table-column prop="proName" label="鏄庣粏椤圭洰" width="160px" :show-overflow-tooltip="true"> - </el-table-column> - <el-table-column prop="sl" label="鏁伴噺" width="56px"> - </el-table-column> - <el-table-column prop="proPrice" label="鍘熶环" width="56px"> - </el-table-column> - <el-table-column label="鎶樻墸" width="150px"> - <template slot-scope="scope"> - <!-- @input="validateDiscount(scope.row)" --> - <el-input-number v-model.number="scope.row.discount" @change="handleManualChange(scope.row)" - placeholder="杈撳叆鎶樻墸" size="small" type="number" :precision="1" :step="0.1" :max="10" :min="0"> - </el-input-number> - </template> - </el-table-column> - <el-table-column prop="nowPrice" label="鐜颁环"> - <template slot-scope="scope"> - {{ scope.row.nowPrice ? scope.row.nowPrice.toFixed(2) : scope.row.nowPrice }} - </template> - </el-table-column> - - <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width" width="50px"> - <template slot-scope="scope"> - <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDel(scope.row)" - title="鍒犻櫎"></el-button> - </template> - </el-table-column> - </el-table> - - <!-- <h3 style="font-weight: 600">鍚堣锛歿{ marryalls }}鍏�</h3> --> - </div> + <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width" width="50px"> + <template slot-scope="scope"> + <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDel(scope.row)" + title="鍒犻櫎"></el-button> + </template> + </el-table-column> + </el-table> + <!-- <h3 style="font-weight: 600">鍚堣锛歿{ marryalls }}鍏�</h3> --> + </div> + </el-col> + </el-row> </div> <el-form :model="form" inline style="display: flex; justify-content: space-between; margin-top: 20px"> @@ -643,14 +647,14 @@ <el-input placeholder="鍘熶环" :value="TotalPrice1" disabled style="width: 90px"></el-input> </el-form-item> - <!-- 鎶樻墸璁惧畾 --> + <!-- 鎶樻墸璁惧畾 --> <!-- <el-form-item label="鎶樻墸" style="display: flex"> <el-input style="width: 90px" type="number" v-model="discount" :value="discount"></el-input> </el-form-item> --> <el-form-item label="鎶樻墸"> <!-- {{ discount }} --> - <el-input-number ref="inputNumber" style="width: 150px" v-model="discount" :precision="1" :step="0.1" + <el-input-number ref="inputNumber" style="width: 140px" v-model="discount" :precision="1" :step="0.1" :max="10" :min="0" @change="debounceNumberChange"></el-input-number> </el-form-item> @@ -659,7 +663,7 @@ <el-input placeholder="搴斾粯閲戦" :value="TotalPrice1 * (discount / 10)" style="width: 90px"></el-input> </el-form-item> --> <el-form-item label="搴斾粯"> - <el-input placeholder="搴斾粯閲戦" v-model="TotalPrice" style="width: 206px" @input="changeXianjia" + <el-input placeholder="搴斾粯閲戦" v-model="TotalPrice" style="width: 90px" @input="changeXianjia" @blur="numberChangeXianPrice(discount, discount)" /> </el-form-item> @@ -673,7 +677,7 @@ <!-- 缁撶畻鏂瑰紡 --> <el-form-item label="缁撶畻鏂瑰紡" prop="jsType" style="display: flex"> - <el-select v-model="jsType" placeholder="璇烽�夋嫨缁撶畻鏂瑰紡" style="width: 130px" clearable> + <el-select v-model="jsType" placeholder="璇烽�夋嫨缁撶畻鏂瑰紡" style="width: 120px" clearable> <el-option v-for="dict in dict.type.reservation_pay_type" :key="dict.value" :label="dict.label" :value="dict.value" /> </el-select> @@ -934,6 +938,7 @@ import { getwater } from "@/api/hosp/customer"; import { getInfo } from "@/api/login"; import ViewPdf from "@/components/ViewPdf"; +import Big from "big.js"; import { shijianzhou, getaddtTransition, @@ -1983,8 +1988,8 @@ this.DataList3 = []; this.Datalists = []; this.filterText = "", - this.filterage = "", - this.TotalPrice1 = 0; + this.filterage = "", + this.TotalPrice1 = 0; this.orderId = row.orderId; this.cusId = row.tjCusIdCard; this.userId = row.userId; @@ -2061,7 +2066,9 @@ this.DataList3 = []; this.Datalists = []; this.filterText = "", - this.filterage = "", + this.filterage = "", + this.TotalPrice = 0; + this.discount = 10; this.TotalPrice1 = 0; this.orderId = this.ids; this.cusId = this.cusIds; @@ -2173,6 +2180,9 @@ this.TotalPrice1 = 0; this.DataList3.forEach((item) => { this.TotalPrice1 += item.proPrice * item.sl; + let TotalPrice = this.TotalPrice1 * (this.discount / 10) + this.TotalPrice = TotalPrice.toFixed(2); + this.lastXianPrice = this.TotalPrice; }); }); } else if (checked === false) { @@ -2201,6 +2211,9 @@ this.TotalPrice1 = 0; this.DataList3.forEach((item) => { this.TotalPrice1 += item.proPrice * item.sl; + let TotalPrice = this.TotalPrice1 * (this.discount / 10) + this.TotalPrice = TotalPrice.toFixed(2); + this.lastXianPrice = this.TotalPrice; }); }); } @@ -2244,9 +2257,6 @@ this.spliceData(); this.TotalPrice1 = 0; this.DataList.forEach((item1) => { - console.log(item1.proPrice, 3322); - console.log(this.TotalPrice1, 1122); - this.TotalPrice1 = item1.proPrice + this.TotalPrice1; }); if (this.marryalls != 0) { @@ -2254,10 +2264,10 @@ } } }, - handleManualChange(row) { + handleManualChange(row) { this.updateProPrice(row); }, - + updateProPrice(row) { if (row.proPrice == 0) { row.discount = 10 @@ -2267,21 +2277,22 @@ const discount = new Big(row.discount); const result = ordPrice.times(discount.div(10)); // ordPrice * (discount / 10) row.nowPrice = result.toNumber(); - this.TotalPrice = this.DataList3.reduce((sum, item) => { + let TotalPrice= this.DataList3.reduce((sum, item) => { return sum.plus(new Big(item.nowPrice || "0")); - }, new Big(0)); + }, new Big(0)) + this.TotalPrice = TotalPrice.toFixed(2); this.discount = (Math.floor((this.TotalPrice / this.TotalPrice1) * 100) / 100) * 10; } }, - debounceNumberChange(currentValue, oldValue) { + debounceNumberChange(currentValue, oldValue) { clearTimeout(this.debounceTimer); this.debounceTimer = setTimeout(() => { this.numberChange(currentValue, oldValue); }, 300); }, - // 鎶樻墸 + // 鎶樻墸 numberChange(currentValue, oldValue) { this.$confirm("纭畾淇敼鎵�鏈夊瓙椤圭殑鎶樻墸鍚楋紵", "鎻愮ず", { confirmButtonText: "纭畾", @@ -2299,7 +2310,8 @@ // this.TotalPrice = this.DataList3.reduce((sum, item) => { // return sum.plus(new Big(item.nowPrice || "0")); // }, new Big(0)); - this.TotalPrice = new Big(this.TotalPrice1 * (this.discount / 10)).toFixed(2) + let TotalPrice = new Big(this.TotalPrice1 * (this.discount / 10)) + this.TotalPrice = TotalPrice.toFixed(2); }); }) .catch(() => { @@ -2317,7 +2329,6 @@ numberChangeXianPrice(currentValue, oldValue) { // 濡傛灉鐜颁环娌℃湁鍙樺寲锛岀洿鎺ヨ繑鍥� if (this.TotalPrice === this.lastXianPrice || !this.TotalPrice) { - console.log(2222333) return; } this.$confirm("纭畾淇敼鎵�鏈夊瓙椤圭殑鎶樻墸鍚楋紵", "鎻愮ず", { @@ -2331,7 +2342,6 @@ // this.discount = this.getInfodis; // } let totalYsprice = new Big(0); - console.log(this.DataList3, 11111) this.DataList3.forEach((item) => { item.discount = this.discount; const ordPrice = new Big(item.proPrice); @@ -2366,7 +2376,7 @@ }); }, - handleDel(row) { + handleDel(row) { this.Datalists.forEach((item, index) => { if (item.proId == row.proId) { this.Datalists.splice(index, 1); @@ -2839,7 +2849,7 @@ } .box1 { - width: 50%; + width: 35%; display: flex; flex-direction: column; } -- Gitblit v1.8.0