From 84a9297d616a8db97330e3daa6b92974bb738fa5 Mon Sep 17 00:00:00 2001 From: lkk <364857242@qq.com> Date: 星期一, 28 七月 2025 16:38:30 +0800 Subject: [PATCH] 1 --- src/views/system/tijian/index.vue | 330 +++++++++++++++++++++++++++++------------------------- 1 files changed, 178 insertions(+), 152 deletions(-) diff --git a/src/views/system/tijian/index.vue b/src/views/system/tijian/index.vue index 51025ed..01c0f03 100644 --- a/src/views/system/tijian/index.vue +++ b/src/views/system/tijian/index.vue @@ -248,7 +248,7 @@ <el-button v-show="lishi" type="primary" @click="cope" size="mini">涓�閿鍒�</el-button> <el-button type="primary" @click="inputChanges" v-show="lishi" size="mini" :disabled="confirm">鍘嗗彶浣撴璁板綍</el-button> - <el-button :disabled="isDisabled" type="primary" size="mini" @click="submitForm">鐧昏</el-button> + <el-button :disabled="butopen" type="primary" size="mini" @click="submitForm">鐧昏</el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery" @queryTable="getList">閲嶇疆</el-button> </div> </el-col> @@ -284,7 +284,7 @@ <el-dialog title="閫夋嫨濂楅" :visible.sync="taocan" width="70%" height="700px" :close-on-click-modal="false"> <el-tabs type="border-card" style="height: 560px; margin: 0 10px; width: 100%" v-model="activeNames" @tab-click="handleClick"> - <el-tab-pane label="濂楅" name="first"> + <el-tab-pane label="濂楅" name="first" :disabled ="form.sftj == 'Y'|| form.sftj == 'y'"> <el-form :model="queryParam" ref="queryForm" size="small" :inline="true" v-if="showSearch" label-width="auto" @submit.native.prevent="handle"> <el-form-item label="濂楅鍚嶇О" prop="pacName"> @@ -306,7 +306,7 @@ </div> </div> </el-tab-pane> - <el-tab-pane label="缁勫悎" name="third"> + <el-tab-pane label="缁勫悎" name="third" :disabled ="form.sftj == 'Y'|| form.sftj == 'y'"> <el-row :gutter="20" style="width: 100%"> <el-col :span="6" style="min-width: 200px"> <div style="text-align: center; margin-bottom: 10px; margin-top: 10px;"> @@ -367,7 +367,7 @@ </el-col> </el-row> </el-tab-pane> - <el-tab-pane label="鍗曢」" name="second"> + <el-tab-pane label="鍗曢」" name="second" :disabled ="form.sftj == 'Y'|| form.sftj == 'y'"> <el-row :gutter="20" style="width: 100%"> <el-col :span="6" style="min-width: 200px"> <div style="text-align: center; margin-bottom: 10px; margin-top: 10px;"> @@ -421,13 +421,13 @@ </el-col> </el-row> </el-tab-pane> - <el-tab-pane label="浜插睘濂楅" name="four"> + <el-tab-pane label="浜插睘濂楅" name="four" :disabled ="form.sftj == 'N'|| form.sftj == 'n'"> <el-form :model="queryParam" ref="queryForm" size="small" :inline="true" v-if="showSearch" label-width="auto" @submit.native.prevent="handle"> <el-form-item label="濮撳悕" prop="pacName"> <el-input v-model="queryParam.pacName" placeholder="璇疯緭鍏ュ鍚�" clearable @keyup.enter.native="handle" /> </el-form-item> - <el-form-item label="韬唤璇�" prop="pacName"> + <el-form-item label="韬唤璇�" prop="pacName"> <el-input v-model="queryParam.pacName" placeholder="璇疯緭鍏ヨ韩浠借瘉" clearable @keyup.enter.native="handle" /> </el-form-item> <el-form-item> @@ -452,7 +452,6 @@ <el-button type="primary" @click="submit">纭� 瀹�</el-button> </span> </el-dialog> - <!-- --> <el-row v-if="tcShow"> <el-col :span="15"> <div class="grid-content bg-purple"> @@ -508,7 +507,11 @@ @blur="numberChangeXianPrice(discount, discount)" /> </el-form-item> <el-form-item label="鏄惁鏇挎" v-if="tjtype"> - <el-input placeholder="鏄惁鏇挎" v-model="sftj" style="width: 150px"></el-input> + <!-- <el-input placeholder="鏄惁鏇挎" v-model="sftj" style="width: 150px"></el-input> --> + <el-select v-model="form.sftj" placeholder="鏄惁鏇挎" style="width: 150px"> + <el-option v-for="dict in dict.type.sys_yes_no" :key="dict.value" :label="dict.label" + :value="dict.value"></el-option> + </el-select> </el-form-item> <br /> @@ -940,6 +943,7 @@ // 闈炲崟涓鐢� single: true, cardreader: false, + butopen:false, // 闈炲涓鐢� multiple: true, nodeobj: {}, @@ -952,7 +956,7 @@ // 鏄剧ず鎼滅储鏉′欢 showSearch: true, tjtype: false, - sftj:null, + sftj: null, activeNames: "first", // 鏍戠姸褰㈢姸 Treedata: [], @@ -984,12 +988,10 @@ pacName: null, pacRemark: null, }, - // valueUrl: "ws://127.0.0.1:18890", - // valueUrl: "ws://192.168.1.3:6789/websocket", valueUrl: "ws://127.0.0.1:6789/websocket", valueUrls: "ws://127.0.0.1:6789/websocket", - - // valueUrls: "ws://"+getIp() +":6789/websocket", + // valueUrl: "ws://192.168.1.244:6789/websocket", + // valueUrls: "ws://192.168.1.244:6789/websocket", webSocket: null, // 韬唤璇侀渶瑕� // socket: null, @@ -1742,57 +1744,60 @@ }, /** 鐧昏鎻愪氦鎸夐挳 */ /** 鐧昏鎻愪氦鎸夐挳 */ - submitForm() { - let _this = this; - if (!this.form.cusPhone || !this.form.cusName) { - this.$message.warning("璇峰~閫夊繀濉」"); - return; - } - - 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, '') : ''; - // 娣诲姞 sfzImg 瀛楁 - formData.sfzImg = this.imageUrl || ''; // 浣跨敤 base64 鏍煎紡鐨勫ご鍍忔暟鎹紝鑻ヤ负绌哄垯浼犵┖瀛楃涓� - - // 澶勭悊鎬у埆鍊� - 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; + submitForm() { + let _this = this; + _this.butopen = true; + if (!this.form.cusPhone || !this.form.cusName) { + this.$message.warning("璇峰~閫夊繀濉」"); + return; } - // 鍙�夛細妫�鏌� sfzImg 鏄惁瀛樺湪 - // if (!formData.sfzImg) { - // this.$message.warning("璇峰厛鑾峰彇韬唤璇佸ご鍍�"); - // return; - // } + 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, '') : ''; + // 娣诲姞 sfzImg 瀛楁 + formData.sfzImg = this.imageUrl || ''; // 浣跨敤 base64 鏍煎紡鐨勫ご鍍忔暟鎹紝鑻ヤ负绌哄垯浼犵┖瀛楃涓� - 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; - }).catch((error) => { - this.$modal.msgError("鐧昏澶辫触锛岃妫�鏌ユ暟鎹�"); - console.error("Error in addCustomer:", error); + // 澶勭悊鎬у埆鍊� + 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; + } + + // 鍙�夛細妫�鏌� sfzImg 鏄惁瀛樺湪 + // if (!formData.sfzImg) { + // this.$message.warning("璇峰厛鑾峰彇韬唤璇佸ご鍍�"); + // return; + // } + + addCustomer(formData).then((response) => { + _this.butopen = false; + 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; + }).catch((error) => { + _this.butopen = false; + this.$modal.msgError("鐧昏澶辫触锛岃妫�鏌ユ暟鎹�"); + console.error("Error in addCustomer:", error); + }); + } }); - } - }); -}, + }, getmailType() { if (this.getType == "2") { @@ -1977,7 +1982,7 @@ if (isChineseChar(resultObj.data.sex)) { _this.form.cusSex = resultObj.data.sex == "濂�" ? 1 : 0 } else { - _this.form.cusSex = resultObj.data.sex; + _this.form.cusSex = resultObj.data.sex == "1" ? 0 : 1; } _this.form.cusNational = resultObj.data.mz; _this.form.cusBrithday = resultObj.data.csrq; @@ -2125,7 +2130,13 @@ websocket.onmessage = function (event) { var resultObj = JSON.parse(event.data); _this.form.cusName = resultObj.data.name; - _this.form.cusSex = resultObj.data.sex; + const isChineseChar = (char) => /[\u4E00-\u9FA5]/.test(char) + // _this.form.cusSex = resultObj.data.sex; + if (isChineseChar(resultObj.data.sex)) { + _this.form.cusSex = resultObj.data.sex == "濂�" ? 1 : 0 + } else { + _this.form.cusSex = resultObj.data.sex == "1" ? 0 : 1; + } _this.form.cusNational = resultObj.data.mz; _this.form.cusBrithday = resultObj.data.csrq; if (_this.form.cusBrithday) { @@ -2410,6 +2421,11 @@ }); } else if (!this.form.firmId && this.form.firmName) { this.taocan = true; + if(this.form.sftj == "Y" || this.form.sftj == "y"){ + this.activeNames = "four" + }else{ + this.activeNames = "first" + } this.loading = true; deptTreeSelect(cusSex).then((response) => { this.newpacName = response.rows; @@ -2435,6 +2451,11 @@ else { this.taocan = true; + if(this.form.sftj == "Y" || this.form.sftj == "y"){ + this.activeNames = "four" + }else{ + this.activeNames = "first" + } this.loading = true; tuantiSelect(param).then((res) => { this.newpacName = res.data; @@ -2459,6 +2480,11 @@ } } else { this.taocan = true; + if(this.form.sftj == "Y" || this.form.sftj == "y"){ + this.activeNames = "four" + }else{ + this.activeNames = "first" + } this.loading = true; deptTreeSelect(cusSex).then((response) => { this.newpacName = response.rows; @@ -2978,7 +3004,7 @@ // 澶勭悊璁㈠崟椤圭洰 processOrderItems(cusId) { getTransitionList1(cusId).then((response) => { - this.tableData1 = response.data; + this.tableData1 = response.data; // if (response.data.tjCategory != null) { // this.tjCategory = response.data.tjCategory; // } @@ -3288,100 +3314,100 @@ }, // 鏈�鍚庢彁浜ゆ寜閽� - submitPrice() { - let _this = this; - this.loadingSubmit = true; - 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; - } - - // tjOrderList 澶勭悊 - 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, - }); - } - }); - - let copeWith = this.TotalPrice1; - let paidIn = this.TotalPrice.toString(); - let discount = this.discount; - this.tjFlowingWater = { copeWith, paidIn, discount }; - - const newArray = this.tableData1 - .filter((item) => item.discount < 10) - .map((item) => ({ - discount: item.discount, - parentProId: item.parentProId, - cusIdCard: item.cusId, - yhj: item.nowPrice, - })); - - gaibianzhekou(newArray).then((res) => { - this.loadingSubmit = false; - if (res.code === 200) { - let data; - - if (pacId || this.tjOrderList.length > 0) { - data = { - photo: this.srcUrl, // 淇濈暀鍘熸湁 photo 瀛楁锛堝鏋滃悗绔粛闇�瑕侊級 - sfzImg: this.imageUrl, // 娣诲姞 sfzImg 瀛楁锛屼紭鍏堜娇鐢ㄦ湇鍔″櫒URL锛岃嫢鏃犲垯浣跨敤base64 - pacId, - tjOrderList: this.tjOrderList, - tjFlowingWater: this.tjFlowingWater, - userId, - tjType, - tjCategory: this.tjCategory, - firmId: this.form.firmId, - firmName: this.form.firmName, - firmDeptName: this.form.firmDeptName, - }; - - this.listgetOrder(data); + submitPrice() { + let _this = this; + this.loadingSubmit = true; + if (_this.tjCategory !== "") { + let List = _this.tableData1; // 鍗曚釜椤圭洰淇℃伅 + if (this.responseList.cusId) { + var userId = this.responseList.cusId; } else { - this.loadingSubmit = false; - this.$message({ - type: "warning", - message: "璇烽�夋嫨濂楅!", - }); + var userId = _this.form.cusId; } + let tjType = _this.form.tjType; + if (this.tableData[0]) { + var pacId = this.tableData[0].pacId; + } + + // tjOrderList 澶勭悊 + 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, + }); + } + }); + + let copeWith = this.TotalPrice1; + let paidIn = this.TotalPrice.toString(); + let discount = this.discount; + this.tjFlowingWater = { copeWith, paidIn, discount }; + + const newArray = this.tableData1 + .filter((item) => item.discount < 10) + .map((item) => ({ + discount: item.discount, + parentProId: item.parentProId, + cusIdCard: item.cusId, + yhj: item.nowPrice, + })); + + gaibianzhekou(newArray).then((res) => { + this.loadingSubmit = false; + if (res.code === 200) { + let data; + + if (pacId || this.tjOrderList.length > 0) { + data = { + photo: this.srcUrl, // 淇濈暀鍘熸湁 photo 瀛楁锛堝鏋滃悗绔粛闇�瑕侊級 + sfzImg: this.imageUrl, // 娣诲姞 sfzImg 瀛楁锛屼紭鍏堜娇鐢ㄦ湇鍔″櫒URL锛岃嫢鏃犲垯浣跨敤base64 + pacId, + tjOrderList: this.tjOrderList, + tjFlowingWater: this.tjFlowingWater, + userId, + tjType, + tjCategory: this.tjCategory, + firmId: this.form.firmId, + firmName: this.form.firmName, + firmDeptName: this.form.firmDeptName, + }; + + this.listgetOrder(data); + } else { + this.loadingSubmit = false; + this.$message({ + type: "warning", + message: "璇烽�夋嫨濂楅!", + }); + } + } else { + this.loadingSubmit = false; + this.$modal.msgError("鏀瑰彉鎶樻墸閿欒"); + } + }); } else { this.loadingSubmit = false; - this.$modal.msgError("鏀瑰彉鎶樻墸閿欒"); + this.$modal.msgError("璇烽�夋嫨浣撴绫诲埆"); } - }); - } else { - this.loadingSubmit = false; - this.$modal.msgError("璇烽�夋嫨浣撴绫诲埆"); - } -}, + }, }, }; </script> -- Gitblit v1.8.0