From eb5ed8e534632b23987214759cb4b27f80b147a4 Mon Sep 17 00:00:00 2001 From: qx <1084500556@qq.com> Date: 星期一, 17 三月 2025 14:42:39 +0800 Subject: [PATCH] qx --- src/views/system/tijian/index.vue | 378 ++++++++++++++++++++++++++++------------------------- 1 files changed, 198 insertions(+), 180 deletions(-) diff --git a/src/views/system/tijian/index.vue b/src/views/system/tijian/index.vue index 4728be4..4b51460 100644 --- a/src/views/system/tijian/index.vue +++ b/src/views/system/tijian/index.vue @@ -89,7 +89,8 @@ <span slot="label" style="display: inline-block; border-bottom: 2px solid blue" @click="openname"> 濮撳悕 </span> - <el-input v-model="form.cusName" placeholder="璇疯緭鍏ュ鍚�" :disabled="isDisabled" @input="form.cusName = $event.replace(/\s/g, '')" /> + <el-input v-model="form.cusName" placeholder="璇疯緭鍏ュ鍚�" :disabled="isDisabled" + @input="form.cusName = $event.replace(/\s/g, '')" /> </el-form-item> <el-form-item label="璇佷欢绫诲瀷" prop="idType"> @@ -147,7 +148,8 @@ <span slot="label" style="display: inline-block; border-bottom: 2px solid blue" @click="handleQuery"> 璇佷欢鍙风爜 </span> - <el-input :disabled="isDisabled" v-model="form.cusIdcard" placeholder="璇疯緭鍏ヨ韩浠借瘉鍙�" @input="handleIdCardInput"/> + <el-input :disabled="isDisabled" v-model="form.cusIdcard" placeholder="璇疯緭鍏ヨ韩浠借瘉鍙�" + @input="handleIdCardInput" /> <!-- <i style=" font-size: 1rem; position: absolute; @@ -179,7 +181,8 @@ trigger: 'blur', }, ]"> - <el-input v-model="form.cusPhone" placeholder="璇疯緭鍏ヨ仈绯荤數璇�" :disabled="isDisabled" @input="form.cusPhone = $event.replace(/\s/g, '')"/> + <el-input v-model="form.cusPhone" placeholder="璇疯緭鍏ヨ仈绯荤數璇�" :disabled="isDisabled" + @input="form.cusPhone = $event.replace(/\s/g, '')" /> </el-form-item> <el-form-item label="鍑虹敓鏃ユ湡" prop="cusBrithday"> @@ -336,7 +339,7 @@ margin-top: 10px; "> 宸查�夐」鐩垪琛� - + </div> <el-table :data="DataLists" border style="width: 100%" height="400" :span-method="objectspanmethod"> <el-table-column prop="propinName" label="妫�鏌ラ」鐩�"> @@ -529,7 +532,7 @@ this.tableData1[0].pacName || "" }}</span> 宸查�夐」鐩潯鏁帮細<span style="font-weight: 700; color: red; margin-right: 5px">{{ this.tableData1.length || 0 - }}</span>鏉� + }}</span>鏉� </div> 宸查�夐」鐩垪琛� </div> @@ -565,6 +568,10 @@ </template> </el-table-column> <el-table-column prop="nowPrice" label="瀹炴敹閲戦"> + <template slot-scope="scope"> + {{ scope.row.nowPrice.toFixed(2) }} + </template> + </el-table-column> <el-table-column prop="proCheckMethod" label="鏄惁绌鸿吂"> <template slot-scope="scope"> @@ -1074,9 +1081,9 @@ }, methods: { handleIdCardInput(value) { - this.form.cusIdcard = value.replace(/\s/g, ''); - this.inputChange(); // 淇濈暀鍘熸湁鐨勮韩浠借瘉杈撳叆澶勭悊閫昏緫 -}, + this.form.cusIdcard = value.replace(/\s/g, ''); + this.inputChange(); // 淇濈暀鍘熸湁鐨勮韩浠借瘉杈撳叆澶勭悊閫昏緫 + }, debounceNumberChange(currentValue, oldValue) { clearTimeout(this.debounceTimer); this.debounceTimer = setTimeout(() => { @@ -1225,11 +1232,9 @@ this.open1 = true; this.title = "娣诲姞浣撴鍗曚綅淇℃伅缁存姢"; }, - idFn1(value) { - if (value) { - // console.log(value); + idFn1() { + if (this.form.firmName) { const originalCompId = this.form.firmId; - this.form.firmName = value; this.CompanyList.forEach((item) => { if (item.cnName == this.form.firmName) { this.form.firmId = item.drugManufacturerId; @@ -1239,10 +1244,15 @@ if (this.form.firmId === originalCompId) { this.form.firmId = ""; } - if (this.form.firmId) { - this.form.tjType = this.dict.type.dict_team[2].value; - } + } + + if (this.form.firmName) { + this.form.tjType = this.dict.type.dict_team[1].value; + }else{ + this.form.tjType = this.dict.type.dict_team[0].value; + } + }, getCurrentDateTime() { const currentDate = new Date(); @@ -1282,25 +1292,25 @@ // return data.proEngName.indexOf(value) !== -1; // } if (!value) return true; - if (data.proName.indexOf(value) !== -1) return true; - if (data.proEngName.indexOf(value) !== -1) return true; - // 鍖归厤灏忓啓 - let arr = data.proName.spell('low', 'array'); - let spell = arr.join(''); - let lengths = [0]; - for (var i = 0; i < arr.length - 1; i++) { - lengths.push(lengths[i] + arr[i].length); - }; - //鍒ゆ柇label瀹屾暣鎷奸煶 涓� 杈撳叆鍊肩殑 index 鏄笉鏄瓑浜庢煇涓眽瀛楃涓�涓嫾闊冲瓧姣嶇殑index鍊� - if(lengths.indexOf(spell.indexOf(value)) !== -1) return true - // 澶у啓 - let arrUp = data.proName.spell('up', 'array'); - let spellUp = arrUp.join(''); - let lengthsUp = [0]; - for (var i = 0; i < arrUp.length - 1; i++) { - lengthsUp.push(lengthsUp[i] + arrUp[i].length); - }; - return lengthsUp.indexOf(spellUp.indexOf(value)) !== -1; + if (data.proName.indexOf(value) !== -1) return true; + if (data.proEngName.indexOf(value) !== -1) return true; + // 鍖归厤灏忓啓 + let arr = data.proName.spell('low', 'array'); + let spell = arr.join(''); + let lengths = [0]; + for (var i = 0; i < arr.length - 1; i++) { + lengths.push(lengths[i] + arr[i].length); + }; + //鍒ゆ柇label瀹屾暣鎷奸煶 涓� 杈撳叆鍊肩殑 index 鏄笉鏄瓑浜庢煇涓眽瀛楃涓�涓嫾闊冲瓧姣嶇殑index鍊� + if (lengths.indexOf(spell.indexOf(value)) !== -1) return true + // 澶у啓 + let arrUp = data.proName.spell('up', 'array'); + let spellUp = arrUp.join(''); + let lengthsUp = [0]; + for (var i = 0; i < arrUp.length - 1; i++) { + lengthsUp.push(lengthsUp[i] + arrUp[i].length); + }; + return lengthsUp.indexOf(spellUp.indexOf(value)) !== -1; }, filterpackage(value, data) { if (!value) return true; @@ -1424,6 +1434,8 @@ this.TotalPrice1 = 0; if (this.tableData1) { this.tableData1.forEach((item) => { + // parseFloat(item.nowPrice.toFixed(2)) + this.TotalPrice1 += item.ordPrice; this.TotalPrice += item.nowPrice; if (item.pacName === null) { @@ -1701,41 +1713,41 @@ }, /** 鐧昏鎻愪氦鎸夐挳 */ /** 鐧昏鎻愪氦鎸夐挳 */ -submitForm() { - let _this = this; - this.$refs["form"].validate((valid) => { - if (valid) { - // 鍒涘缓琛ㄥ崟鏁版嵁鐨勫壇鏈苟鍘婚櫎绌烘牸 - const formData = { ...this.form }; - formData.cusName = formData.cusName ? formData.cusName.replace(/\s/g, '') : ''; - formData.cusPhone = formData.cusPhone ? formData.cusPhone.replace(/\s/g, '') : ''; - formData.cusIdcard = formData.cusIdcard ? formData.cusIdcard.replace(/\s/g, '') : ''; + submitForm() { + let _this = this; + this.$refs["form"].validate((valid) => { + if (valid) { + // 鍒涘缓琛ㄥ崟鏁版嵁鐨勫壇鏈苟鍘婚櫎绌烘牸 + const formData = { ...this.form }; + formData.cusName = formData.cusName ? formData.cusName.replace(/\s/g, '') : ''; + formData.cusPhone = formData.cusPhone ? formData.cusPhone.replace(/\s/g, '') : ''; + formData.cusIdcard = formData.cusIdcard ? formData.cusIdcard.replace(/\s/g, '') : ''; - // 澶勭悊鎬у埆鍊� - if (formData.cusSex === "濂�") { - formData.cusSex = 1; - } - if (formData.cusSex === "鐢�") { - formData.cusSex = 0; - } - if (formData.cusSex === "鏈煡") { - formData.cusSex = 2; - } - if (formData.tjType === "") { - formData.tjType = this.dict.type.dict_team[0].value; - } + // 澶勭悊鎬у埆鍊� + if (formData.cusSex === "濂�") { + formData.cusSex = 1; + } + if (formData.cusSex === "鐢�") { + formData.cusSex = 0; + } + if (formData.cusSex === "鏈煡") { + formData.cusSex = 2; + } + if (formData.tjType === "") { + formData.tjType = this.dict.type.dict_team[0].value; + } - addCustomer(formData).then((response) => { - this.responseList = response.data; - this.form.tjType = this.dict.type.dict_team[0].value; - this.$modal.msgSuccess("鏂板鎴愬姛"); - _this.tcShow = true; - _this.isDisabled = true; - _this.top = false; + addCustomer(formData).then((response) => { + this.responseList = response.data; + this.form.tjType = this.dict.type.dict_team[0].value; + this.$modal.msgSuccess("鏂板鎴愬姛"); + _this.tcShow = true; + _this.isDisabled = true; + _this.top = false; + }); + } }); - } - }); -}, + }, getmailType() { if (this.getType == "2") { @@ -1773,7 +1785,7 @@ if (this.form.reservationId != null) { if (this.form.groupingId) { this.form.firmName = this.form.compName; - this.form.tjType = this.dict.type.dict_team[2].value; + this.form.tjType = this.dict.type.dict_team[1].value; this.CompanyList.forEach((item) => { if (item.cnName == this.form.firmName) { this.form.firmId = item.drugManufacturerId; @@ -2244,7 +2256,7 @@ this.malldisble = false; this.defaultKeys = []; this.DataLists = []; - + }, cancell() { @@ -2912,6 +2924,7 @@ processOrderItems(cusId) { getTransitionList1(cusId).then((response) => { this.tableData1 = response.data; + let Price = 0; if (this.tableData1) { this.tableData1.forEach((item) => { if (item.tjCategory != null) { @@ -2923,8 +2936,10 @@ }); } this.TotalPrice1 += item.ordPrice || 0; // 绱姞搴旀敹閲戦 - this.TotalPrice += item.nowPrice || 0; // 绱姞瀹炴敹閲戦 + Price += item.nowPrice || 0; // 绱姞瀹炴敹閲戦 + this.TotalPrice = Price.toFixed(2) }); + console.log(this.TotalPrice1, this.TotalPrice) // 璁$畻鎶樻墸 this.discount = this.TotalPrice1 > 0 ? (Math.floor((this.TotalPrice / this.TotalPrice1) * 100) / 100) * 10 : 0; @@ -2939,122 +2954,122 @@ }); }, submitCheckinfee() { - let _this = this; - if (_this.tjCategory !== "") { - let List = _this.tableData1; - if (this.responseList.cusId) { - var userId = this.responseList.cusId; - } else { - var userId = _this.form.cusId; - } - let tjType = _this.form.tjType; - if (this.tableData[0]) { - var pacId = this.tableData[0].pacId; - } + let _this = this; + if (_this.tjCategory !== "") { + let List = _this.tableData1; + if (this.responseList.cusId) { + var userId = this.responseList.cusId; + } else { + var userId = _this.form.cusId; + } + let tjType = _this.form.tjType; + if (this.tableData[0]) { + var pacId = this.tableData[0].pacId; + } - // 鍘荤┖鏍煎鐞� - const processedForm = { - ...this.form, - cusName: this.form.cusName ? this.form.cusName.replace(/\s/g, '') : '', - cusPhone: this.form.cusPhone ? this.form.cusPhone.replace(/\s/g, '') : '', - cusIdcard: this.form.cusIdcard ? this.form.cusIdcard.replace(/\s/g, '') : '' - }; + // 鍘荤┖鏍煎鐞� + const processedForm = { + ...this.form, + cusName: this.form.cusName ? this.form.cusName.replace(/\s/g, '') : '', + cusPhone: this.form.cusPhone ? this.form.cusPhone.replace(/\s/g, '') : '', + cusIdcard: this.form.cusIdcard ? this.form.cusIdcard.replace(/\s/g, '') : '' + }; - List.forEach((item) => { - if (item.list) { - item.list.forEach((item1) => { - this.tjOrderList.push({ - proName: item1.proName, - proPrice: item1.nowPrice, - proId: item1.proId, - }); + List.forEach((item) => { + if (item.list) { + item.list.forEach((item1) => { + this.tjOrderList.push({ + proName: item1.proName, + proPrice: item1.nowPrice, + proId: item1.proId, + }); + }); + } else if (item.tjProjectList) { + item.tjProjectList.forEach((item1) => { + this.tjOrderList.push({ + proName: item1.proName, + proPrice: item1.priceNow, + proId: item1.proId, + }); + }); + } else { + this.tjOrderList.push({ + proName: item.proName, + proPrice: item.ysPrice, + proId: item.proId, + }); + } }); - } else if (item.tjProjectList) { - item.tjProjectList.forEach((item1) => { - this.tjOrderList.push({ - proName: item1.proName, - proPrice: item1.priceNow, - proId: item1.proId, + + let copeWith = this.TotalPrice1; + let paidIn = this.TotalPrice.toString(); + let discount = this.discount; + this.tjFlowingWater = { copeWith, paidIn, discount }; + + let data; + if (pacId || this.getType == "2") { + data = { + photo: this.srcUrl, + pacId, + tjOrderList: this.tjOrderList, + tjFlowingWater: this.tjFlowingWater, + userId, + tjType, + getType: this.getType, + addAddress: this.addAddress, + tjCategory: this.tjCategory, + // 浣跨敤鍘绘帀绌烘牸鍚庣殑鏁版嵁 + cusName: processedForm.cusName, + cusPhone: processedForm.cusPhone, + cusIdcard: processedForm.cusIdcard + }; + } else { + data = { + photo: this.srcUrl, + tjOrderList: this.tjOrderList, + tjFlowingWater: this.tjFlowingWater, + userId, + tjType, + getType: this.getType, + tjCategory: this.tjCategory, + // 浣跨敤鍘绘帀绌烘牸鍚庣殑鏁版嵁 + cusName: processedForm.cusName, + cusPhone: processedForm.cusPhone, + cusIdcard: processedForm.cusIdcard + }; + } + + getOrder(data).then((res) => { + this.$modal.msgSuccess("鎻愪氦鎴愬姛"); + this.tjNumbers = res.msg; + this.charge = true; + let data = { + tjNum: res.msg, + }; + getfindTj(data).then((response) => { + if (response.data) { + this.feeitems = response.data; + if (this.feeitems.length != 0) { + this.$nextTick(() => { + this.$refs.multipleTable.toggleRowSelection( + this.feeitems[0], + true + ); + }); + } else { + this.$refs.multipleTable.clearSelection(); + } + this.loading = false; + } else { + this.feeitems = []; + this.loading = false; + } }); }); } else { - this.tjOrderList.push({ - proName: item.proName, - proPrice: item.ysPrice, - proId: item.proId, - }); + this.$modal.msgError("璇烽�夋嫨浣撴绫诲埆"); } - }); - - let copeWith = this.TotalPrice1; - let paidIn = this.TotalPrice.toString(); - let discount = this.discount; - this.tjFlowingWater = { copeWith, paidIn, discount }; - - let data; - if (pacId || this.getType == "2") { - data = { - photo: this.srcUrl, - pacId, - tjOrderList: this.tjOrderList, - tjFlowingWater: this.tjFlowingWater, - userId, - tjType, - getType: this.getType, - addAddress: this.addAddress, - tjCategory: this.tjCategory, - // 浣跨敤鍘绘帀绌烘牸鍚庣殑鏁版嵁 - cusName: processedForm.cusName, - cusPhone: processedForm.cusPhone, - cusIdcard: processedForm.cusIdcard - }; - } else { - data = { - photo: this.srcUrl, - tjOrderList: this.tjOrderList, - tjFlowingWater: this.tjFlowingWater, - userId, - tjType, - getType: this.getType, - tjCategory: this.tjCategory, - // 浣跨敤鍘绘帀绌烘牸鍚庣殑鏁版嵁 - cusName: processedForm.cusName, - cusPhone: processedForm.cusPhone, - cusIdcard: processedForm.cusIdcard - }; - } - - getOrder(data).then((res) => { - this.$modal.msgSuccess("鎻愪氦鎴愬姛"); - this.tjNumbers = res.msg; - this.charge = true; - let data = { - tjNum: res.msg, - }; - getfindTj(data).then((response) => { - if (response.data) { - this.feeitems = response.data; - if (this.feeitems.length != 0) { - this.$nextTick(() => { - this.$refs.multipleTable.toggleRowSelection( - this.feeitems[0], - true - ); - }); - } else { - this.$refs.multipleTable.clearSelection(); - } - this.loading = false; - } else { - this.feeitems = []; - this.loading = false; - } - }); - }); - } else { - this.$modal.msgError("璇烽�夋嫨浣撴绫诲埆"); - } -}, + }, // 琛ㄦ牸鍗曢�� handleSelect(selection, val) { @@ -3369,8 +3384,10 @@ } .filter-tree { - overflow-y: auto; /* 淇濈暀绾靛悜婊氬姩鏉� */ - overflow-x: hidden; /* 闅愯棌妯悜婊氬姩鏉� */ + overflow-y: auto; + /* 淇濈暀绾靛悜婊氬姩鏉� */ + overflow-x: hidden; + /* 闅愯棌妯悜婊氬姩鏉� */ height: 350px; } @@ -3481,6 +3498,7 @@ width: 100%; display: flex; } + /* .tab3 { overflow-y: auto; } -- Gitblit v1.8.0