From b0d733958a618b9fc5ce0ee2fee5d2b146a7a748 Mon Sep 17 00:00:00 2001
From: su1124 <1583764726@qq.com>
Date: 星期二, 30 一月 2024 17:52:49 +0800
Subject: [PATCH] su

---
 src/views/system/tijian/index.vue |  332 ++++++++++++++++++++++++++++++++-----------------------
 1 files changed, 194 insertions(+), 138 deletions(-)

diff --git a/src/views/system/tijian/index.vue b/src/views/system/tijian/index.vue
index 04bc27f..18e79dd 100644
--- a/src/views/system/tijian/index.vue
+++ b/src/views/system/tijian/index.vue
@@ -14,12 +14,12 @@
               </el-form-item>
             </el-col>
             <el-col :span="7">
-              <el-form-item label="濮撳悕" prop="cusName" style="display: flex"  :rules="[
+              <el-form-item label="濮撳悕" prop="cusName" style="display: flex" :rules="[
                 {
                   required: true, validator: (rule, value, callback) => {
                     if (!form.cusName) {
                       callback('')
-                    } else if(form.cusName){
+                    } else if (form.cusName) {
                       callback()
                     }
 
@@ -50,15 +50,14 @@
               </el-form-item>
             </el-col>
             <el-col :span="7">
-              <el-form-item label="鎬у埆" prop="cusSex" 
-              :rules="[
+              <el-form-item label="鎬у埆" prop="cusSex" :rules="[
                 {
                   required: true, validator: (rule, value, callback) => {
                     if (!form.cusSex && showHidden.has_sex === 'Y') {
                       callback('')
-                    } else  if (showHidden.has_sex === 'N'){
+                    } else if (showHidden.has_sex === 'N') {
                       callback()
-                    }else if(form.cusSex && showHidden.has_sex === 'Y'){
+                    } else if (form.cusSex && showHidden.has_sex === 'Y') {
                       callback()
                     }
 
@@ -72,21 +71,19 @@
             </el-col>
 
             <el-col :span="9">
-              <el-form-item label="璇佷欢鍙�" prop="cusIdcard"
-                :rules="[
+              <el-form-item label="璇佷欢鍙�" prop="cusIdcard" :rules="[
                 {
                   required: true, validator: (rule, value, callback) => {
                     if (!form.cusIdcard && showHidden.has_idcard === 'Y') {
                       callback('')
-                    } else  if (showHidden.has_idcard === 'N'){
+                    } else if (showHidden.has_idcard === 'N') {
                       callback()
-                    }else if(form.cusIdcard && showHidden.has_idcard === 'Y'){
+                    } else if (form.cusIdcard && showHidden.has_idcard === 'Y') {
                       callback()
                     }
 
                   }, trigger: 'blur'
-                }]"
-                style="display: flex">
+                }]" style="display: flex">
                 <span slot="label" style="display:inline-block;border-bottom: 2px solid blue;" @click="handleQuery">
                   璇佷欢鍙�
                 </span>
@@ -119,9 +116,9 @@
                   required: true, validator: (rule, value, callback) => {
                     if (!form.cusPhone && showHidden.is_phone === 'Y') {
                       callback('')
-                    } else  if (showHidden.is_phone === 'N'){
+                    } else if (showHidden.is_phone === 'N') {
                       callback()
-                    }else if(form.cusPhone && showHidden.is_phone === 'Y'){
+                    } else if (form.cusPhone && showHidden.is_phone === 'Y') {
                       callback()
                     }
 
@@ -202,6 +199,11 @@
             <el-col :span="7">
               <el-form-item label="宸ヤ綔鍗曚綅" prop="company" style="display: flex">
                 <el-input style="width: 100%" :disabled="isDisabled" v-model="form.company" placeholder="璇疯緭鍏ュ伐浣滃崟浣�" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="7">
+              <el-form-item label="鏂囧寲绋嬪害" prop="wenHua" style="display: flex">
+                <el-input style="width: 100%" :disabled="isDisabled" v-model="form.wenHua" placeholder="璇疯緭鍏ユ枃鍖栫▼搴�" />
               </el-form-item>
             </el-col>
             <el-col :span="7">
@@ -656,6 +658,7 @@
         <el-button type="primary" @click="copes">纭� 瀹�</el-button>
       </span>
     </el-dialog>
+    <Packages ref="aaa" @add="handleChanges" />
   </div>
 </template>
 
@@ -680,9 +683,10 @@
   getTransitionList,
   getByTeamNo,
   getLoadFile,
-  getIsRequired,
+  getIsRequired, getconfigKey,
   getHistryTjOrderProByCusIdCard,
 } from "@/api/system/tijian";
+import Packages from "@/components/Packages";
 import { MessageBox } from "element-ui";
 import VTreeTransfer from "./TreeTransfer.vue";
 import historyTj from "@/components/historyTj/index";
@@ -704,6 +708,7 @@
   components: {
     VTreeTransfer,
     historyTj,
+    Packages
   },
   data() {
     return {
@@ -894,6 +899,9 @@
         address: [{ required: true, message: "", trigger: "blur" }],
         phone: [{ required: true, message: "", trigger: "blur" }],
         cusPhone: [
+          { required: true, message: "", trigger: "change" },
+        ],
+         cusBrithday: [
           { required: true, message: "", trigger: "change" },
         ],
         // cusNational: [
@@ -1210,7 +1218,6 @@
 
     /** 鏌ヨ淇℃伅鍒楄〃 */
     getList() {
-      this.loading = true;
       // listCustomer(this.queryParams).then((response) => {
       //   this.customerList = response.rows;
       //   this.total = response.total;
@@ -1442,102 +1449,126 @@
         //   this.$message.error("姝ょ敤鎴蜂笉瀛樺湪");
         // });
       } else {
-        var websocket = null;
-        var url = this.valueUrl;
-        if ("WebSocket" in window) {
-          websocket = new WebSocket(url);
-        } else if ("MozWebSocket" in window) {
-          websocket = new MozWebSocket(url);
-        } else {
-          // console.log("SockJS");
-        }
-
-        if (websocket == null) {
-          alert("鍒涘缓WebSocket瀵硅薄澶辫触");
-        }
-
-        //杩炴帴鍙戠敓閿欒鐨勫洖璋冩柟娉�
-        websocket.onerror = function () {
-          alert("璇锋鏌ヨ鍗″櫒杩炴帴鏄惁姝e父");
-        };
-
-        //杩炴帴鎴愬姛寤虹珛鐨勫洖璋冩柟娉�
-        websocket.onopen = function () {
-          this.websocket = websocket;
-          // 杩炴帴璁惧
-          var jsonObj = {
-            name: "connect",
-          };
-          var jStr = JSON.stringify(jsonObj);
-          this.websocket.send(jStr);
-          alert("璇锋斁韬唤璇佸啀鐐圭‘璁�");
-          var jsonObj = {
-            name: "readCert",
-          };
-          var jStr = JSON.stringify(jsonObj);
-          this.websocket.send(jStr);
-          this.dialogVisible = false;
-        };
-
-        //鎺ユ敹鍒版秷鎭殑鍥炶皟鏂规硶
-        websocket.onmessage = function (event) {
-          var resultObj = eval("(" + event.data + ")");
-          //resultFlag涓�0浠h〃璇诲崱鎴愬姛
-          if (
-            resultObj.name == "readCard" ||
-            resultObj.name == "readCert" ||
-            resultObj.name == "PushWithImg" ||
-            resultObj.name == "PushWithOutImg"
-          ) {
-            if (resultObj.resultFlag == "0") {
-              //鍥炴樉鐩稿叧鏁版嵁
-              _this.form.cusName = resultObj.resultContent.partyName;
-              _this.form.cusSex =
-                resultObj.resultContent.gender == "0" ? "濂�" : "鐢�";
-              _this.form.cusNational = resultObj.resultContent.nation;
-              _this.form.cusBrithday = resultObj.resultContent.bornDay;
-              if (_this.form.cusBrithday) {
-                _this.form.cusBrithday = _this.form.cusBrithday.replace(
-                  /^(\d{4})(\d{2})(\d{2})$/,
-                  "$1-$2-$3"
-                );
-              }
-              _this.form.cusAddr = resultObj.resultContent.certAddress;
-              _this.form.cusIdcard = resultObj.resultContent.certNumber;
-              _this.imageUrl =
-                "data:image/jpeg;base64," + resultObj.resultContent.identityPic;
-              if (
-                resultObj.name == "readCert" ||
-                resultObj.name == "PushWithImg"
-              ) {
-                this.imageUrl =
-                  "data:image/jpeg;base64," +
-                  resultObj.resultContent.identityPrintPic;
-              }
-            } else if (resultObj.resultFlag == "-1") {
-              if (resultObj.errorMsg == "绔彛鎵撳紑澶辫触") {
-                //alert("璇诲崱鍣ㄦ湭杩炴帴");
+        let configKey = "getInfoFromSqlData"
+        getconfigKey(configKey).then(res => {
+          if (res.code == 200) {
+            if (res.msg == "N") {
+              var websocket = null;
+              var url = this.valueUrl;
+              if ("WebSocket" in window) {
+                websocket = new WebSocket(url);
+              } else if ("MozWebSocket" in window) {
+                websocket = new MozWebSocket(url);
               } else {
-                //alert(resultObj.errorMsg);
+                // console.log("SockJS");
               }
-            } else if (resultObj.resultFlag == "-2") {
-              //alert(resultObj.errorMsg);
-            }
-          } else if (resultObj.name == "getStatus") {
-            if (resultObj.resultFlag == "0") {
-              if (resultObj.status == "0") {
-              } else {
-                alert("璁惧杩炴帴宸叉柇寮�锛岃妫�鏌ヨ鍗″櫒杩炴帴");
+
+              if (websocket == null) {
+                alert("鍒涘缓WebSocket瀵硅薄澶辫触");
               }
+
+              //杩炴帴鍙戠敓閿欒鐨勫洖璋冩柟娉�
+              websocket.onerror = function () {
+                alert("璇锋鏌ヨ鍗″櫒杩炴帴鏄惁姝e父");
+              };
+
+              //杩炴帴鎴愬姛寤虹珛鐨勫洖璋冩柟娉�
+              websocket.onopen = function () {
+                this.websocket = websocket;
+                // 杩炴帴璁惧
+                var jsonObj = {
+                  name: "connect",
+                };
+                var jStr = JSON.stringify(jsonObj);
+                this.websocket.send(jStr);
+                alert("璇锋斁韬唤璇佸啀鐐圭‘璁�");
+                var jsonObj = {
+                  name: "readCert",
+                };
+                var jStr = JSON.stringify(jsonObj);
+                this.websocket.send(jStr);
+                this.dialogVisible = false;
+              };
+
+              //鎺ユ敹鍒版秷鎭殑鍥炶皟鏂规硶
+              websocket.onmessage = function (event) {
+                var resultObj = eval("(" + event.data + ")");
+                //resultFlag涓�0浠h〃璇诲崱鎴愬姛
+                if (
+                  resultObj.name == "readCard" ||
+                  resultObj.name == "readCert" ||
+                  resultObj.name == "PushWithImg" ||
+                  resultObj.name == "PushWithOutImg"
+                ) {
+                  if (resultObj.resultFlag == "0") {
+                    //鍥炴樉鐩稿叧鏁版嵁
+                    _this.form.cusName = resultObj.resultContent.partyName;
+                    _this.form.cusSex =
+                      resultObj.resultContent.gender == "0" ? "濂�" : "鐢�";
+                    _this.form.cusNational = resultObj.resultContent.nation;
+                    _this.form.cusBrithday = resultObj.resultContent.bornDay;
+                    if (_this.form.cusBrithday) {
+                      _this.form.cusBrithday = _this.form.cusBrithday.replace(
+                        /^(\d{4})(\d{2})(\d{2})$/,
+                        "$1-$2-$3"
+                      );
+                    }
+                    _this.form.cusAddr = resultObj.resultContent.certAddress;
+                    _this.form.cusIdcard = resultObj.resultContent.certNumber;
+                    _this.imageUrl =
+                      "data:image/jpeg;base64," + resultObj.resultContent.identityPic;
+                    if (
+                      resultObj.name == "readCert" ||
+                      resultObj.name == "PushWithImg"
+                    ) {
+                      this.imageUrl =
+                        "data:image/jpeg;base64," +
+                        resultObj.resultContent.identityPrintPic;
+                    }
+                  } else if (resultObj.resultFlag == "-1") {
+                    if (resultObj.errorMsg == "绔彛鎵撳紑澶辫触") {
+                      //alert("璇诲崱鍣ㄦ湭杩炴帴");
+                    } else {
+                      //alert(resultObj.errorMsg);
+                    }
+                  } else if (resultObj.resultFlag == "-2") {
+                    //alert(resultObj.errorMsg);
+                  }
+                } else if (resultObj.name == "getStatus") {
+                  if (resultObj.resultFlag == "0") {
+                    if (resultObj.status == "0") {
+                    } else {
+                      alert("璁惧杩炴帴宸叉柇寮�锛岃妫�鏌ヨ鍗″櫒杩炴帴");
+                    }
+                  }
+                }
+              };
+
+              //杩炴帴鍏抽棴鐨勫洖璋冩柟娉�
+              websocket.onclose = function () {
+                alert("璇诲崱鍣ㄨ繛鎺ュ叧闂�");
+              };
+            } else  if (res.msg == "Y"){
+              this.$refs.aaa.open = true;
+              this.$refs.aaa.getAllList();
+              this.$refs.aaa.title = "璇佷欢瀛楀吀";
             }
           }
-        };
+        })
 
-        //杩炴帴鍏抽棴鐨勫洖璋冩柟娉�
-        websocket.onclose = function () {
-          alert("璇诲崱鍣ㄨ繛鎺ュ叧闂�");
-        };
       }
+    },
+
+    handleChanges(param1) {
+      if(this.form.pacCode == "涓嶈"){
+        this.form.cusIdcard = param1[0].xh;
+      }else{
+        this.form.cusIdcard = param1[0].pacCode;
+      }
+      
+      // this.form.cusName = param1[0].pacName;
+      // this.form.cusPhone = param1[0].pacRemark;
+     
     },
 
     // selected(row, index) {
@@ -1619,33 +1650,37 @@
       // this.tableData.forEach((item) => {
       //   this.fData = item.tjProjectList;
       // });
+      console.log(this.treedataList)
+      console.log(selection)
       if (selection[0]) {
         this.DataList = [];
         // this.data = JSON.parse(JSON.stringify(this.dXData));
-        selection[0].tjProjectList.forEach((selectionitem) => {
-          this.treedataList.forEach((item) => {
-            if (selectionitem.proName == item.proName) {
-              item.disabled = true;
-              item.tjProjectList = [];
-            }
-            if (item.tjProjectList) {
-              item.tjProjectList.forEach((item1) => {
-                if (selectionitem.proName == item1.proName) {
-                  item1.disabled = true;
-                  item1.tjProjectList = [];
-                }
-                if (item1.tjProjectList) {
-                  item1.tjProjectList.forEach((item2) => {
-                    if (selectionitem.proName == item2.proName) {
-                      item2.disabled = true;
-                      item2.tjProjectList = [];
-                    }
-                  });
-                }
-              });
-            }
+        if (selection[0].tjProjectList) {
+          selection[0].tjProjectList.forEach((selectionitem) => {
+            this.treedataList.forEach((item) => {
+              if (selectionitem.proName == item.proName) {
+                item.disabled = true;
+                item.tjProjectList = [];
+              }
+              if (item.tjProjectList) {
+                item.tjProjectList.forEach((item1) => {
+                  if (selectionitem.proName == item1.proName) {
+                    item1.disabled = true;
+                    item1.tjProjectList = [];
+                  }
+                  if (item1.tjProjectList) {
+                    item1.tjProjectList.forEach((item2) => {
+                      if (selectionitem.proName == item2.proName) {
+                        item2.disabled = true;
+                        item2.tjProjectList = [];
+                      }
+                    });
+                  }
+                });
+              }
+            });
           });
-        });
+        }
       } else {
         this.treedataList = JSON.parse(JSON.stringify(this.dXData));
         return;
@@ -1657,21 +1692,27 @@
       let cusSex = this.form.cusSex;
       this.datekey = Date.now();
       //鍏ㄩ儴濂楅
+      this.loading = true;
       deptTreeSelect(cusSex).then((response) => {
         this.newpacName = response.rows;
+        console.log(this.newpacName)
+        console.log(this.tableData1)
         try {
-          this.newpacName.forEach((item3) => {
-            this.tableData1.forEach((item4) => {
-              item4.list.forEach((item6) => {
-                if (item6.pacName === item3.pacName) {
-                  this.$nextTick(() => {
-                    this.$refs.tb.toggleRowSelection(item3, true);
-                  });
-                  throw Error();
-                }
+          if (this.tableData1.length >= 1) {
+            this.newpacName.forEach((item3) => {
+              this.tableData1.forEach((item4) => {
+                item4.list.forEach((item6) => {
+                  if (item6.pacName === item3.pacName) {
+                    this.$nextTick(() => {
+                      this.$refs.tb.toggleRowSelection(item3, true);
+                    });
+                    throw Error();
+                  }
+                });
               });
             });
-          });
+          }
+
         } catch (error) { }
         this.loading = false;
       });
@@ -1869,6 +1910,16 @@
         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 = [];
@@ -2076,6 +2127,7 @@
           tjFlowingWater: this.tjFlowingWater,
           userId,
           tjType,
+          tjCategory:this.tjCategory
         };
       } else {
         data = {
@@ -2084,6 +2136,7 @@
           tjFlowingWater: this.tjFlowingWater,
           userId,
           tjType,
+          tjCategory:this.tjCategory
         };
       }
       getOrder(data).then((res) => {
@@ -2105,6 +2158,9 @@
 
 
 <style >
+.el-form-item__error {
+    	display: none;
+	}
 .el-table__header-wrapper .el-checkbox {
   display: none;
 }

--
Gitblit v1.8.0