From e6223f3130a1431098c15ef4b9174f2b751a2e66 Mon Sep 17 00:00:00 2001 From: qx <1084500556@qq.com> Date: 星期四, 10 四月 2025 10:01:27 +0800 Subject: [PATCH] qx --- src/views/system/tijian/index.vue | 23 ++++- src/api/system/comp.js | 6 - src/views/system/comp/index.vue | 183 +++++++++++++++++++++++++-------------------- 3 files changed, 120 insertions(+), 92 deletions(-) diff --git a/src/api/system/comp.js b/src/api/system/comp.js index 164eacd..318c8c2 100644 --- a/src/api/system/comp.js +++ b/src/api/system/comp.js @@ -92,13 +92,11 @@ } // 鑾峰彇浣撴鍗曢」椤圭洰淇℃伅 -export function getProjectList(proName) { +export function getProjectList(query) { return request({ url: '/hosp/dwgrouping/getTjParentProjectList', method: 'get', - params:{ - proName:proName - } + params: query }) } diff --git a/src/views/system/comp/index.vue b/src/views/system/comp/index.vue index 5d2295e..4902c6e 100644 --- a/src/views/system/comp/index.vue +++ b/src/views/system/comp/index.vue @@ -199,7 +199,7 @@ <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleGroup">淇濆瓨</el-button> </el-col> <el-col :span="1.5"> - <el-button type="primary" icon="el-icon-edit" size="mini" @click="xiangmuWh" >椤圭洰缁存姢</el-button> + <el-button type="primary" icon="el-icon-edit" size="mini" @click="xiangmuWh">椤圭洰缁存姢</el-button> </el-col> <el-col :span="1.5"> <el-button type="primary" icon="el-icon-edit" size="mini" :disabled="singlegg" @@ -289,8 +289,10 @@ </template> </el-table-column> </el-table> - <div style="font-size: 16px;margin-top: 10px;">褰撳墠椤圭洰鏉℃暟锛�<span style="font-weight: 700;">{{ OnenewpacName.length }}</span>鏉�</div> - + <div style="font-size: 16px;margin-top: 10px;">褰撳墠椤圭洰鏉℃暟锛�<span style="font-weight: 700;">{{ + OnenewpacName.length + }}</span>鏉�</div> + </el-col> <el-col :span="2" :xs="24"> <div style="margin: 240% 16%"> @@ -298,10 +300,10 @@ </div> </el-col> <el-col :span="8" :xs="24"> - <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" + <el-form :model="queryParams1" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px" @submit.native.prevent> <el-form-item label="椤圭洰鍚嶇О" prop="proName"> - <el-input ref="inputName" v-model="queryParams.proName" placeholder="璇疯緭鍏ラ」鐩悕绉�" clearable + <el-input ref="inputName" v-model="queryParams1.proName" placeholder="璇疯緭鍏ラ」鐩悕绉�" clearable @keyup.enter.native="handleSearchFor" style="width: 140px" /> </el-form-item> <el-form-item> @@ -324,7 +326,7 @@ </div> <div> - <el-dialog :title="title" :visible.sync="openOne" width="1400px" append-to-body :close-on-click-modal="false" > + <el-dialog :title="title" :visible.sync="openOne" width="1400px" append-to-body :close-on-click-modal="false"> <el-row :gutter="24" v-if="!isTableVisible"> <el-col :span="15" :xs="24"> @@ -345,7 +347,8 @@ <el-button icon="el-icon-refresh" size="mini" @click="resetQuerys">閲嶇疆</el-button> </el-form-item> </el-form> - <el-table border v-loading="loading" :data="OnenewpacName" :row-class-name="tableRowClassName" height="478" :cell-style="{ padding: '5px 0' }"> + <el-table border v-loading="loading" :data="OnenewpacName" :row-class-name="tableRowClassName" height="478" + :cell-style="{ padding: '5px 0' }"> <el-table-column label="椤圭洰鍚嶇О" align="center" prop="proName" width="410"> <template slot-scope="scope"> @@ -356,9 +359,8 @@ <el-table-column label="鎶樻墸" width="151"> <template slot-scope="scope"> <!-- 鍙緭鍏ョ函鏁板瓧鎶樻墸 @input="validateDiscount(scope.row)"--> - <el-input-number v-model="scope.row.limits" - @change="handleManualChange(scope.row)" placeholder="杈撳叆鎶樻墸" size="mini" type="number" :min="0" - :step="0.1" :precision="1" :max="10"> + <el-input-number v-model="scope.row.limits" @change="handleManualChange(scope.row)" placeholder="杈撳叆鎶樻墸" + size="mini" type="number" :min="0" :step="0.1" :precision="1" :max="10"> </el-input-number> </template> </el-table-column> @@ -370,8 +372,10 @@ </template> </el-table-column> </el-table> - <div style="font-size: 16px;margin-top: 10px;">褰撳墠椤圭洰鏉℃暟锛�<span style="font-weight: 700;">{{ OnenewpacName.length }}</span>鏉�</div> - + <div style="font-size: 16px;margin-top: 10px;">褰撳墠椤圭洰鏉℃暟锛�<span style="font-weight: 700;">{{ + OnenewpacName.length + }}</span>鏉�</div> + </el-col> <!-- <el-col :span="2" :xs="24"> <div style="margin: 240% 16%" class="btntoleft"> @@ -384,10 +388,10 @@ </div> </el-col> --> <el-col :span="7" :xs="24"> - <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" + <el-form :model="queryParams1" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px" @submit.native.prevent> <el-form-item label="椤圭洰鍚嶇О" prop="proName"> - <el-input ref="inputName" v-model="queryParams.proName" placeholder="璇疯緭鍏ラ」鐩悕绉�" clearable + <el-input ref="inputName" v-model="queryParams1.proName" placeholder="璇疯緭鍏ラ」鐩悕绉�" clearable @keyup.enter.native="handleSearchFor" style="width: 140px" /> </el-form-item> <el-form-item> @@ -444,7 +448,8 @@ <el-button icon="el-icon-refresh" size="mini" @click="resetQuerys">閲嶇疆</el-button> </el-form-item> </el-form> - <el-table border v-loading="loading" :data="OnenewpacName" :row-class-name="tableRowClassName" height="478" :cell-style="{ padding: '5px 0' }"> + <el-table border v-loading="loading" :data="OnenewpacName" :row-class-name="tableRowClassName" height="478" + :cell-style="{ padding: '5px 0' }"> <el-table-column label="椤圭洰鍚嶇О" align="center" prop="proName" width="170"> <template slot-scope="scope"> @@ -459,8 +464,10 @@ </template> </el-table-column> </el-table> - <div style="font-size: 16px;margin-top: 10px;">褰撳墠椤圭洰鏉℃暟锛�<span style="font-weight: 700;">{{ OnenewpacName.length }}</span>鏉�</div> - + <div style="font-size: 16px;margin-top: 10px;">褰撳墠椤圭洰鏉℃暟锛�<span style="font-weight: 700;">{{ + OnenewpacName.length + }}</span>鏉�</div> + </el-col> <!-- <el-col :span="2" :xs="24"> <div style="margin: 240% 16%"> @@ -470,10 +477,10 @@ </div> </el-col> --> <el-col :span="8" :xs="24"> - <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" + <el-form :model="queryParams1" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px" @submit.native.prevent> <el-form-item label="椤圭洰鍚嶇О" prop="proName"> - <el-input ref="inputName" v-model="queryParams.proName" placeholder="璇疯緭鍏ラ」鐩悕绉�" clearable + <el-input ref="inputName" v-model="queryParams1.proName" placeholder="璇疯緭鍏ラ」鐩悕绉�" clearable @keyup.enter.native="handleSearchFor" style="width: 140px" /> </el-form-item> <el-form-item> @@ -644,6 +651,10 @@ opens: false, openss: false, openOne: false, + queryParams1: { + proName: null, + pym: null, + }, // 鏌ヨ鍙傛暟 queryParams: { pageNum: 1, @@ -655,6 +666,8 @@ xianprice: null, limits: null }, + + id: "", // 琛ㄥ崟鍙傛暟 form: {}, @@ -763,7 +776,7 @@ updateProPrice1(row) { const proPrice = new Big(row.proPrice); const limits = new Big(row.limits); - const result = proPrice.times(limits.div(10)).toNumber(); // ordPrice * (discount / 10) + const result = proPrice.times(limits.div(10)).toNumber(); // ordPrice * (discount / 10) row.ysPrice = result.toFixed(2); const totalYsPrice = this.OnenewpacName.reduce((sum, item) => { return sum.plus(new Big(item.ysPrice || '0')); @@ -780,7 +793,7 @@ } // Update youhui calculation - + if (this.queryParams.price !== 0 && this.queryParams.xianprice !== 0) { this.youhui = (Math.floor((this.queryParams.xianprice / this.queryParams.price) * 100) / 100) * 10; } else { @@ -984,49 +997,49 @@ }, numberChangeXianPrice(currentValue, oldValue) { - // 濡傛灉鐜颁环娌℃湁鍙樺寲锛岀洿鎺ヨ繑鍥� - if (this.queryParams.xianprice === this.lastXianPrice || !this.queryParams.xianprice) { - return; - } - - this.$confirm("纭畾淇敼鎵�鏈夊瓙椤圭殑鎶樻墸鍚楋紵", "鎻愮ず", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning", - }) - .then(() => { - // 纭繚淇敼鎶樻墸鐨勫�� - this.youhui = currentValue; - - let totalYsprice = new Big(0); // 鍒濆鍖栨�� ysprice - // 閬嶅巻姣忎釜椤圭洰锛屾洿鏂版瘡涓瓙椤圭殑浠锋牸 - this.OnenewpacName.forEach((item) => { - item.limits = this.youhui; - const proPrice = new Big(item.proPrice); - const limits = new Big(item.limits); - const result = proPrice.times(limits.div(10)); // ordPrice * (discount / 10) - item.ysPrice = result.toNumber(); - totalYsprice = totalYsprice.plus(new Big(item.ysPrice)); - }); - // 濡傛灉鎬荤殑 ysPrice 鍜屾煡璇㈠弬鏁颁腑鐨� xianprice 涓嶄竴鑷达紝杩涜璋冩暣 - if (!totalYsprice.eq(this.queryParams.xianprice)) { - const diff = new Big(this.queryParams.xianprice).minus(totalYsprice); - // 濡傛灉 OnenewpacName 鏁扮粍涓嶄负绌猴紝璋冩暣鏈�鍚庝竴椤圭殑 ysPrice - if (this.OnenewpacName.length > 0) { - const lastItem = this.OnenewpacName[this.OnenewpacName.length - 1]; - const newYsPrice = new Big(lastItem.ysPrice).plus(diff).toNumber(); - // 浣跨敤 $set 纭繚鍝嶅簲鎬ф洿鏂� - this.$set(this.OnenewpacName[this.OnenewpacName.length - 1], 'ysPrice', newYsPrice); - } + // 濡傛灉鐜颁环娌℃湁鍙樺寲锛岀洿鎺ヨ繑鍥� + if (this.queryParams.xianprice === this.lastXianPrice || !this.queryParams.xianprice) { + return; } - // 鏇存柊 lastXianPrice 浠ヤ究涓嬫姣旇緝 - this.lastXianPrice = this.queryParams.xianprice; - }) - .catch(() => { - // 濡傛灉鍙栨秷淇敼锛屾仮澶嶅師鏈夌殑浼樻儬鍊� - this.youhui = oldValue; - }); -}, + + this.$confirm("纭畾淇敼鎵�鏈夊瓙椤圭殑鎶樻墸鍚楋紵", "鎻愮ず", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning", + }) + .then(() => { + // 纭繚淇敼鎶樻墸鐨勫�� + this.youhui = currentValue; + + let totalYsprice = new Big(0); // 鍒濆鍖栨�� ysprice + // 閬嶅巻姣忎釜椤圭洰锛屾洿鏂版瘡涓瓙椤圭殑浠锋牸 + this.OnenewpacName.forEach((item) => { + item.limits = this.youhui; + const proPrice = new Big(item.proPrice); + const limits = new Big(item.limits); + const result = proPrice.times(limits.div(10)); // ordPrice * (discount / 10) + item.ysPrice = result.toNumber(); + totalYsprice = totalYsprice.plus(new Big(item.ysPrice)); + }); + // 濡傛灉鎬荤殑 ysPrice 鍜屾煡璇㈠弬鏁颁腑鐨� xianprice 涓嶄竴鑷达紝杩涜璋冩暣 + if (!totalYsprice.eq(this.queryParams.xianprice)) { + const diff = new Big(this.queryParams.xianprice).minus(totalYsprice); + // 濡傛灉 OnenewpacName 鏁扮粍涓嶄负绌猴紝璋冩暣鏈�鍚庝竴椤圭殑 ysPrice + if (this.OnenewpacName.length > 0) { + const lastItem = this.OnenewpacName[this.OnenewpacName.length - 1]; + const newYsPrice = new Big(lastItem.ysPrice).plus(diff).toNumber(); + // 浣跨敤 $set 纭繚鍝嶅簲鎬ф洿鏂� + this.$set(this.OnenewpacName[this.OnenewpacName.length - 1], 'ysPrice', newYsPrice); + } + } + // 鏇存柊 lastXianPrice 浠ヤ究涓嬫姣旇緝 + this.lastXianPrice = this.queryParams.xianprice; + }) + .catch(() => { + // 濡傛灉鍙栨秷淇敼锛屾仮澶嶅師鏈夌殑浼樻儬鍊� + this.youhui = oldValue; + }); + }, changegroupingName() { @@ -1106,16 +1119,20 @@ } }, handleSearchFor() { - getProjectList(this.queryParams.proName).then((response) => { - - response.data.forEach((item, index) => { - item.newID = - (this.queryParams.pageNum - 1) * this.queryParams.pageSize + - index + - 1; + // 鍒ゆ柇鏄惁涓烘眽瀛� + const isChineseChar = (char) => /[\u4E00-\u9FA5]/.test(char) + if (isChineseChar(this.queryParams1.proName)) { + this.queryParams1.pym = null + getProjectList(this.queryParams1).then((response) => { + this.Treedata = response.data; }); - this.Treedata = response.data; - }); + } else { + this.queryParams1.pym = this.queryParams1.proName + this.queryParams1.proName = null + getProjectList(this.queryParams1).then((response) => { + this.Treedata = response.data; + }); + } }, // 鍗曢」鏁版嵁鑾峰彇 handleChangesingle(selection) { @@ -1168,9 +1185,9 @@ //this.queryParams.xianprice += item.ysPrice || 0; 绱姞鐜颁环锛屽鏋測sPrice涓簎ndefined鍒欑疮鍔�0 }); this.queryParams.xianprice = this.OnenewpacName.reduce((sum, item) => { - return sum.plus(new Big(item.ysPrice || '0')); - }, new Big(0)).toNumber(); - this.youhui = (Math.floor((this.queryParams.xianprice / this.queryParams.price) * 100) / 100) * 10 + return sum.plus(new Big(item.ysPrice || '0')); + }, new Big(0)).toNumber(); + this.youhui = (Math.floor((this.queryParams.xianprice / this.queryParams.price) * 100) / 100) * 10 } }, handledbelete(row) { @@ -1184,9 +1201,9 @@ // 鐒跺悗鏇存柊鎬讳环鍜岀幇浠� this.OnenewpacName.forEach((item) => { this.queryParams.price += item.proPrice; - this.queryParams.xianprice =this.OnenewpacName.reduce((sum, item) => { - return sum.plus(new Big(item.ysPrice || "0")); - }, new Big(0)).toNumber(); + this.queryParams.xianprice = this.OnenewpacName.reduce((sum, item) => { + return sum.plus(new Big(item.ysPrice || "0")); + }, new Big(0)).toNumber(); }); // 璁$畻浼樻儬 @@ -1310,7 +1327,7 @@ this.forms.groupingName = item.groupingName; this.forms.gtAge = item.gtAge; this.forms.limits = item.limits; - this.youhui =item.limits + this.youhui = item.limits this.forms.ltAge = item.ltAge; this.forms.pacName = item.pacName; this.forms.payType = item.payType; @@ -1351,16 +1368,16 @@ // this.queryParams.xianprice = this.OnenewpacName.reduce((sum, item) => { // return sum.plus(new Big(item.ysPrice || '0')); // }, new Big(0)).toNumber(); - + // this.OnenewpacName.forEach((item, index) => { // this.queryParams.price += item.proPrice; // }); // - + // this.youhui = (Math.floor((this.queryParams.xianprice / this.queryParams.price) * 100) / 100) * 10 this.queryParams.xianprice = res.data.ysPrice - this.queryParams.price= res.data.price - this.youhui= res.data.limits + this.queryParams.price = res.data.price + this.youhui = res.data.limits }); } // console.log(this.groupList[0].id, 9966); diff --git a/src/views/system/tijian/index.vue b/src/views/system/tijian/index.vue index cb456aa..56b7c7a 100644 --- a/src/views/system/tijian/index.vue +++ b/src/views/system/tijian/index.vue @@ -558,7 +558,7 @@ this.tableData1[0].pacName || "" }}</span> 宸查�夐」鐩潯鏁帮細<span style="font-weight: 700; color: red; margin-right: 5px">{{ this.tableData1.length || 0 - }}</span>鏉� + }}</span>鏉� </div> 宸查�夐」鐩垪琛� </div> @@ -1347,7 +1347,20 @@ if (data.zhmc.indexOf(value) !== -1) { return data.zhmc.indexOf(value) !== -1; } else { - return data.pym.indexOf(value) !== -1; + console.log(55555) + if (/[A-Z]/.test(data.pym)) { // 妫�鏌ユ槸鍚﹀寘鍚ぇ鍐欏瓧姣� + let pym = data.pym.toLowerCase() + console.log(pym,11111) + return pym.indexOf(value) !== -1; + } else if (/[a-z]/.test(data.pym)) { // 妫�鏌ユ槸鍚﹀寘鍚皬鍐欏瓧姣� + console.log(pym,22222) + let pym = data.pym.toLowerCase() + return pym.indexOf(value) !== -1; + } else { + console.log(66666) + return data.pym.indexOf(value) !== -1; + } + } }, beforeDestroy() { @@ -2980,9 +2993,9 @@ let Price = 0; if (this.tableData1) { this.tableData1.forEach((item) => { - if (typeof item.nowPrice === 'number') { - item.nowPrice = Number(item.nowPrice.toFixed(2)); - } + if (typeof item.nowPrice === 'number') { + item.nowPrice = Number(item.nowPrice.toFixed(2)); + } if (item.tjCategory != null) { this.tjCategory = item.tjCategory; } -- Gitblit v1.8.0