From 7fb0a8f0ab16c149484bf043754cd10cfa94de2f Mon Sep 17 00:00:00 2001
From: wangyi <2946747746@qq.com>
Date: 星期一, 19 一月 2026 14:48:05 +0800
Subject: [PATCH] 增加了业务员,保管员和验收员的对应的显示

---
 src/views/basic/gyWarehouse/gyWarehouse.vue |  192 ++++++++++++++++++++++++++++-------------------
 1 files changed, 115 insertions(+), 77 deletions(-)

diff --git a/src/views/basic/gyWarehouse/gyWarehouse.vue b/src/views/basic/gyWarehouse/gyWarehouse.vue
index 9e575b8..05403a7 100644
--- a/src/views/basic/gyWarehouse/gyWarehouse.vue
+++ b/src/views/basic/gyWarehouse/gyWarehouse.vue
@@ -1,5 +1,5 @@
 <template>
-  <div style="padding: 10px">
+  <div style="padding: 10px; position: relative">
     <el-form
       :model="queryParams"
       ref="queryForm"
@@ -26,7 +26,7 @@
         </el-form-item>
         <el-form-item label="缁勭粐">
           <el-select
-            v-model="queryParams.HOrgName"
+            v-model="queryParams.HOrgID"
             placeholder="璇烽�夋嫨"
             class="ForFilteringSchemes"
           >
@@ -34,7 +34,7 @@
               v-for="(item, index) in organizationList"
               :key="index"
               :label="item.Name"
-              :value="item.Name"
+              :value="item.ID.toString()"
             >
             </el-option>
           </el-select>
@@ -62,8 +62,8 @@
           <el-card class="box-card">
             <div slot="header" class="clearfix"><span>杩囨护</span></div>
             <div>
-              <el-form-item label-width="0">
-                <el-row>
+              <el-row>
+                <el-form-item label-width="0">
                   <el-col :span="7">
                     <el-select
                       v-model="queryParams.ColName1"
@@ -104,10 +104,10 @@
                       class="ForFilteringSchemes"
                     />
                   </el-col>
-                </el-row>
-              </el-form-item>
-              <el-form-item label-width="0">
-                <el-row>
+                </el-form-item>
+              </el-row>
+              <el-row>
+                <el-form-item label-width="0">
                   <el-col :span="7">
                     <el-select
                       v-model="queryParams.ColName2"
@@ -149,10 +149,10 @@
                       class="ForFilteringSchemes"
                     />
                   </el-col>
-                </el-row>
-              </el-form-item>
-              <el-form-item label-width="0">
-                <el-row>
+                </el-form-item>
+              </el-row>
+              <el-row>
+                <el-form-item label-width="0">
                   <el-col :span="7">
                     <el-select
                       v-model="queryParams.ColName"
@@ -192,8 +192,8 @@
                       class="ForFilteringSchemes"
                     />
                   </el-col>
-                </el-row>
-              </el-form-item>
+                </el-form-item>
+              </el-row>
             </div>
           </el-card>
         </el-collapse-item>
@@ -308,12 +308,12 @@
           >闅愯棌鍒楄缃�</el-button
         >
       </el-col>
-      <el-col :span="1.5">
+      <el-col :span="1.5" class="zy-hidden">
         <el-button type="primary" icon="el-icon-help" size="mini" @click="handleSearch"
           >鎼� 绱�</el-button
         >
       </el-col>
-      <el-col :span="1.5">
+      <el-col :span="1.5" class="zy-hidden">
         <el-button type="primary" icon="el-icon-refresh" size="mini" @click="resetQuery"
           >閲� 缃�</el-button
         >
@@ -360,11 +360,12 @@
                 <span v-if="column.property.includes('鏃ユ湡')">{{
                   parseTime(row[column.property], "{y}-{m}-{d}")
                 }}</span>
+
                 <el-button
                   type="text"
-                  @click="handleEdit(row, (OperationType = 3))"
-                  v-else-if="column.property == '鍗曟嵁鍙�'"
-                  >{{ row.鍗曟嵁鍙� }}</el-button
+                  @click.stop="handleEdit(row, (OperationType = 3))"
+                  v-else-if="column.property == '浠撳簱浠g爜'"
+                  >{{ row.浠撳簱浠g爜 }}</el-button
                 >
                 <span v-else>{{ row[column.label] }}</span>
               </div>
@@ -401,6 +402,7 @@
         append-to-body
         class="xsckdBox"
         :before-close="close"
+        @close="editBeforeCloseHandle"
       >
         <edit
           :OperationType="OperationType"
@@ -409,6 +411,7 @@
           :copyType="copyType"
           @editCloseGy="editGyClose"
           v-if="editShow"
+          ref="editRef"
         />
       </el-dialog>
       <el-dialog
@@ -441,7 +444,7 @@
           height="550"
         >
           <el-table-column type="index" label="搴忓彿" width="55" align="center" />
-          <el-table-column label="浠撳簱浠g爜" prop="浠撳簱浠g爜" align="center" width="120" />
+          <el-table-column label="浠撳簱浠g爜" align="center" width="120" />
           <el-table-column label="浠撳簱鍚嶇О" prop="浠撳簱鍚嶇О" align="center" width="120" />
           <el-table-column label="鑱旂郴鐢佃瘽" prop="鑱旂郴鐢佃瘽" align="center" width="120" />
           <el-table-column label="鑱屽憳浠g爜" prop="鑱屽憳浠g爜" align="center" width="120" />
@@ -486,7 +489,10 @@
   },
   data() {
     return {
+      editRef: null,
+      activeSeach: "",
       HModName: "Gy_Warehouse",
+      activeSeach: "",
       editShow: false,
       openEdit: false,
       totalNameList: [],
@@ -539,12 +545,11 @@
       openData: false, //鏁版嵁寮圭獥
       dialogTitle: "",
       zuzhiId: "",
-      organizationList: [], //缁勭粐鍒楄〃
+      organizationList: JSON.parse(sessionStorage["organizationList"]), //缁勭粐鍒楄〃
       subDisabled: false, //缂栬緫椤甸潰淇濆瓨鎸夐挳鏄惁绂佺敤(true绂佺敤锛宖alse鍙敤)
       OperationType: null, //淇濆瓨绫诲瀷锛堟柊澧�1淇敼3锛�
       HInterID: null,
       baseURL: process.env.VUE_APP_BASE_API,
-      user: "admin",
       currentRow: [],
       lastSelectedRowIndex: null, // 鐢ㄤ簬璁板綍涓婃鐐瑰嚮鐨勮绱㈠紩
       lastSelectedRow: null, // 涓婁竴娆¢�変腑鐨勮
@@ -563,7 +568,7 @@
       dateRange: [],
       // 鏌ヨ鍙傛暟
       queryParams: {
-        HOrgID: null,
+        HOrgID: sessionStorage["OrganizationID"],
         HName: null,
         HNumber: null,
         Comparator1: "",
@@ -626,14 +631,17 @@
     };
   },
   created() {
-    this.getList();
+    this.handleQuery();
     this.riqiChange();
   },
   methods: {
+    editBeforeCloseHandle() {
+      this.$refs.editRef.close();
+    },
     // 浠撳簱鍚屾
     async handleSync() {
       try {
-        let res = await axios.get(this.baseURL + "/Gy_Warehouse/Gy_WarehouseViewApi", {
+        let res = await axios.get(this.$baseUrl + "/Gy_Warehouse/Gy_WarehouseViewApi", {
           params: {
             Number: this.queryParams.HSyncNumber,
             Type: "CK",
@@ -683,7 +691,7 @@
     defaintOperationByCompanyName() {
       var result = false;
       axios
-        .get(this.baseURL + "/Xt_getInfo/getCompanyName")
+        .get(this.$baseUrl + "/Xt_getInfo/getCompanyName")
         .then((response) => {
           var data1 = response.data;
           if (data1.count == 1) {
@@ -762,33 +770,6 @@
       this.dbEmitData(this.deptform, this.dialogTypeNum);
       this.deptform = {};
     },
-    fetchData() {
-      //鐧诲綍鐢ㄦ埛淇℃伅
-      axios
-        .get(
-          "http://47.96.97.237/API/Web/GetUser?UserName=001&PassWord=123456&HOrgName=100038"
-        )
-        .then((response) => {
-          let data = response.data.data[0];
-          this.zuzhiId = data.HUSEORGID; //鏍规嵁鐧诲綍鐢ㄦ埛鑾峰彇榛樿鐨勭粍缁嘔D
-          this.queryParams.HOrgID = data.HUSEORGID;
-          this.user = data.Czymc;
-          axios
-            .get(this.baseURL + "/Web/GetOrganizations", {})
-            .then((response) => {
-              if (response.data.count == 1) {
-                this.organizationList = response.data.data; //缁勭粐鍒楄〃
-              }
-              this.getList();
-            })
-            .catch((error) => {
-              this.$modal.msgError("鎺ュ彛璇锋眰澶辫触!");
-            });
-        })
-        .catch((error) => {
-          this.$modal.msgError("鎺ュ彛璇锋眰澶辫触!");
-        });
-    },
     getList() {
       this.tableShow = false;
       this.loading = true;
@@ -799,10 +780,10 @@
       this.sWhere += "";
       //鐢熶骇璧勬枡鍒楄〃
       axios
-        .get(this.baseURL + "/Gy_WareHouse/listpage", {
+        .get(this.$baseUrl + "/Gy_WareHouse/listpage", {
           params: {
             sWhere: `${this.sWhere}`,
-            user: this.user,
+            user: sessionStorage["HUserName"],
             Organization: "娴欐睙鏅轰簯杩堟��",
             page: this.page,
             size: this.pageSize,
@@ -892,7 +873,12 @@
               }
             }
             option.data = result;
-            this.DisPlay_HideColumn(this.HModName, this.user, option, this.dataList);
+            this.DisPlay_HideColumn(
+              this.HModName,
+              sessionStorage["HUserName"],
+              option,
+              this.dataList
+            );
           }
         })
         .catch((error) => {
@@ -902,7 +888,7 @@
     DisPlay_HideColumn(HModName, user, option, dataOption) {
       this.totalNameList = [];
       axios
-        .get(this.baseURL + "/Xt_grdAlignment_WMES/grdAlignmentWMESList", {
+        .get(this.$baseUrl + "/Xt_grdAlignment_WMES/grdAlignmentWMESList", {
           params: {
             HModName: HModName,
             user: user,
@@ -1048,8 +1034,15 @@
     handleRowClick(row, column, event) {
       this.lastSelectedRow = this.selectedRow; // 璁板綍涓婁竴娆¢�変腑鐨勮
       this.selectedRow = row; // 璁板綍褰撳墠閫変腑鐨勮
+      if (this.checkIsIframe()) {
+        // 灏嗗綋鍓嶉�変腑鐨勬暟鎹毚闇插埌window涓�
+        window.selectedRow = row;
+      }
       this.lastSelectedRowIndex = this.tableData.indexOf(row);
       this.$refs.tableData.toggleRowSelection(row);
+      if (this.openPage) {
+        this.$emit("deptEmit", row, 2);
+      }
     },
     //閫変腑琛岄珮浜牱寮�
     rowStyle({ row, rowIndex }) {
@@ -1057,19 +1050,45 @@
         return { background: "#ecf5ff" };
       }
     },
+    checkIsIframe() {
+      if (window.self == window.top) {
+        return false;
+      }
+      return true;
+    },
     //鍙屽嚮琛�
     handleDblclick(row, column, cell, event) {
+      if (this.checkIsIframe()) {
+        // IFrame 鍙屽嚮 杩斿洖褰撳墠鍙屽嚮鐨勬暟鎹�
+        window.parent.iframeWareHouseCallBack(row);
+        return;
+      }
       this.OperationType = 3;
-      this.handleEdit();
+      if (this.openPage) {
+        this.$emit("deptEmitDb", row, 2);
+      } else {
+        this.handleEdit(row);
+      }
     },
     // 澶氶�夋閫変腑鏁版嵁
     handleSelectionChange(selection) {
       // this.rowForm = {}
-      this.ids = selection.map((item) => item.HItemID);
-      this.single = selection.length != 1;
-      this.multiple = !selection.length;
-      if (!this.single) {
+      if (this.openPage) {
+        //鍒楄〃鍗曢��
+        if (selection.length > 1) {
+          const del_row = selection.shift();
+          this.$refs.tableData.toggleRowSelection(del_row, false); //璁剧疆杩欎竴琛屽彇娑堥�変腑
+        }
+        this.rowForm = {};
+        this.ids = selection.map((item) => item.HItemID);
         this.rowForm = selection[0];
+      } else {
+        this.ids = selection.map((item) => item.HItemID);
+        this.single = selection.length != 1;
+        this.multiple = !selection.length;
+        if (!this.single) {
+          this.rowForm = selection[0];
+        }
       }
     },
     //鎵撳紑渚ц竟鎼滅储寮圭獥
@@ -1155,8 +1174,10 @@
       if (this.queryParams.HName) {
         this.sWhere += " and 浠撳簱鍚嶇О like '%" + this.queryParams.HName + "%'";
       }
-      if (this.queryParams.HOrgName) {
-        this.sWhere += " and 缁勭粐鍚嶇О = '" + this.queryParams.HOrgName + "'";
+      if (this.queryParams.HOrgID) {
+        let OrgName = this.organizationList.find((e) => e.ID == this.queryParams.HOrgID)
+          ?.Name;
+        this.sWhere += " and 缁勭粐鍚嶇О = '" + OrgName + "'";
       }
       // this.sWhere += this.addSWhereByOpenType()
       // this.sWhere += this.getOrgIDByUser()
@@ -1178,10 +1199,10 @@
     getOrgIDByUser() {
       var res = "";
       axios
-        .get(this.baseURL + "/Xt_User/getOrgIDListByUser", {
+        .get(this.$baseUrl + "/Xt_User/getOrgIDListByUser", {
           params: {
             HModName: this.HModName,
-            user: this.user,
+            user: sessionStorage["HUserName"],
             HOrgID: this.zuzhiId,
           },
         })
@@ -1230,7 +1251,7 @@
 
     //閫�鍑�
     close() {
-      this.tableShow = true;
+      this.tableShow = false;
       this.openEdit = false;
       this.getList();
     },
@@ -1243,7 +1264,9 @@
       });
     },
     //鎵撳紑淇敼缁勪欢寮圭獥
-    handleEdit() {
+
+    handleEdit(row) {
+      this.rowForm = row
       this.$nextTick(() => {
         this.openEdit = true;
         this.editShow = true;
@@ -1262,8 +1285,11 @@
         .then(() => {
           if (!this.rowForm.瀹℃牳浜�) {
             axios
-              .get(this.baseURL + "/DeltetGy_Warehouse", {
-                params: { HItemID: this.rowForm.HItemID.toString(), user: this.user },
+              .get(this.$baseUrl + "/DeltetGy_Warehouse", {
+                params: {
+                  HItemID: this.rowForm.HItemID.toString(),
+                  user: sessionStorage["HUserName"],
+                },
               })
               .then((response) => {
                 if (response.data.count == 1) {
@@ -1287,8 +1313,12 @@
       var InterID = form.HItemID || form.HInterID;
       //閫昏緫瀹℃牳鏂规硶
       axios
-        .get(this.baseURL + "/Gy_Warehouse/AuditGy_Warehouse", {
-          params: { HInterID: InterID, IsAudit: num, CurUserName: this.user },
+        .get(this.$baseUrl + "/Gy_Warehouse/AuditGy_Warehouse", {
+          params: {
+            HInterID: InterID,
+            IsAudit: num,
+            CurUserName: sessionStorage["HUserName"],
+          },
         })
         .then((response) => {
           let result = response.data;
@@ -1308,8 +1338,12 @@
       var InterID = form.HItemID || form.HInterID;
       //閫昏緫瀹℃牳鏂规硶
       axios
-        .get(this.baseURL + "/Gy_Warehouse/StopGy_Warehouse", {
-          params: { HInterID: InterID, IsStop: num, CurUserName: this.user },
+        .get(this.$baseUrl + "/Gy_Warehouse/StopGy_Warehouse", {
+          params: {
+            HInterID: InterID,
+            IsStop: num,
+            CurUserName: sessionStorage["HUserName"],
+          },
         })
         .then((response) => {
           let result = response.data;
@@ -1375,10 +1409,10 @@
         }
       }
       var sSubStr = JSON.stringify(num);
-      var sMainSub = sSubStr + "&鍜�" + this.user;
+      var sMainSub = sSubStr + "&鍜�" + sessionStorage["HUserName"];
       axios({
         method: "post",
-        url: this.baseURL + "/Gy_Warehouse/Gy_Process_Excel",
+        url: this.$baseUrl + "/Gy_Warehouse/Gy_Process_Excel",
         data: {
           sMainSub: sMainSub,
         },
@@ -1438,4 +1472,8 @@
   display: flex;
   flex-direction: row;
 }
+
+.zy-hidden {
+  display: none;
+}
 </style>

--
Gitblit v1.9.1