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/gy/gyDepartmentEdit.vue |  151 ++++++++++++++++++++------------------------------
 1 files changed, 60 insertions(+), 91 deletions(-)

diff --git a/src/views/basic/gy/gyDepartmentEdit.vue b/src/views/basic/gy/gyDepartmentEdit.vue
index 2997dd5..62ec808 100644
--- a/src/views/basic/gy/gyDepartmentEdit.vue
+++ b/src/views/basic/gy/gyDepartmentEdit.vue
@@ -173,13 +173,12 @@
       openData: false, //鏁版嵁寮圭獥
       dialogTitle: "",
       zuzhiId: 0,
-      organizationList: [], //缁勭粐鍒楄〃
+      organizationList: JSON.parse(sessionStorage.getItem('organizationList')), //缁勭粐鍒楄〃
       subDisabled: false, //缂栬緫椤甸潰淇濆瓨鎸夐挳鏄惁绂佺敤(true绂佺敤锛宖alse鍙敤)
       CheckBillDisabled: true,
       // OperationType: this.$route.query.OperationType,//淇濆瓨绫诲瀷锛堟柊澧�1淇敼3锛�
       HInterID: null,
       baseURL: process.env.VUE_APP_BASE_API || "http://47.96.97.237/API/",
-      user: "admin",
       currentRow: [],
       lastSelectedRowIndex: null, // 鐢ㄤ簬璁板綍涓婃鐐瑰嚮鐨勮绱㈠紩
       lastSelectedRow: null, // 涓婁竴娆¢�変腑鐨勮
@@ -224,96 +223,66 @@
   },
   created() {
     this.reset();
-    this.fetchData();
+    this.getdata();
   },
   activated() {
     this.reset();
-    this.fetchData();
+    this.getdata();
   },
   methods: {
-    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.user = data.Czymc;
-          axios
-            .get(this.baseURL + "/Web/GetOrganizations", {})
-            .then((response) => {
-              if (response.data.count == 1) {
-                this.organizationList = response.data.data; //缁勭粐鍒楄〃
-                this.getdata();
-              }
-            })
-            .catch((error) => {
-              this.$modal.msgError("鎺ュ彛璇锋眰澶辫触!");
-            });
-        })
-        .catch((error) => {
-          this.$modal.msgError("鎺ュ彛璇锋眰澶辫触!");
-        });
-    },
     getdata() {
       this.reset();
-      console.log(this.OperationType);
+      console.log(this.OperationType,this.copyType);
       if (this.OperationType != 1) {
         this.zzSelDis = true;
-        axios
-          .get(this.baseURL + "/Gy_Department/cx", {
-            params: {
-              HInterID: this.linterid,
-            },
-          })
-          .then((response) => {
-            console.log(response);
-            let result = response.data;
-            if (result.code == 1) {
-              // 璇存槑楠岃瘉鎴愬姛浜嗭紝
-              var data = result.data[0];
-              Object.assign(this.form, {
-                HNumber: data.閮ㄩ棬浠g爜,
-                HItemID: data.HItemID,
-                HName: data.閮ㄩ棬鍚嶇О,
-                HHelpCode: data.HHelpCode,
-                HEmpID: data.HEmpID,
-                HEmpName: data.HEmpName,
-                HBarCode: data.鏉″舰鐮�,
-                HStopflag: data.绂佺敤鏍囪,
-                HRemark: data.HRemark,
-                HUSEORGID: data.HUSEORGID,
-                HRemark: data.澶囨敞,
-                HMakeEmp: data["鍒涘缓浜�"],
-                HMakeDate:
-                  data["鍒涘缓鏃ユ湡"] == null
-                    ? ""
-                    : dayjs(new Date(data["鍒涘缓鏃ユ湡"])).format("yyyy-MM-dd"),
-                HCheckEmp: data["瀹℃牳浜�"],
-                HCheckDate:
-                  data["瀹℃牳鏃ユ湡"] == null
-                    ? ""
-                    : dayjs(new Date(data["瀹℃牳鏃ユ湡"])).format("yyyy-MM-dd"),
-                HStopEmp: data["绂佺敤浜�"],
-                HStopDate:
-                  data["绂佺敤鏃ユ湡"] == null
-                    ? ""
-                    : dayjs(new Date(data["绂佺敤鏃ユ湡"])).format("yyyy-MM-dd"),
-              });
-              if (!data.HCheckEmp) {
-                this.CheckBillDisabled = false;
-              }
-            }
-            this.$nextTick(() => {
-              this.formShow = true;
-              this.formLoading = false;
+        axios.get(this.$baseUrl + "/Gy_Department/cx", {
+          params: {
+            HInterID: this.linterid,
+          },
+        }).then((response) => {
+          let result = response.data;
+          if (result.code == 1) {
+            // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+            var data = result.data[0];
+            Object.assign(this.form, {
+              HNumber: data.閮ㄩ棬浠g爜,
+              HItemID: data.HItemID,
+              HName: data.閮ㄩ棬鍚嶇О,
+              HHelpCode: data.HHelpCode,
+              HEmpID: data.HEmpID,
+              HEmpName: data.HEmpName,
+              HBarCode: data.鏉″舰鐮�,
+              HStopflag: data.绂佺敤鏍囪,
+              HRemark: data.HRemark,
+              HUSEORGID: data.HUSEORGID,
+              HRemark: data.澶囨敞,
+              HMakeEmp: data["鍒涘缓浜�"],
+              HMakeDate: data["鍒涘缓鏃ユ湡"] == null ? "" : dayjs(new Date(data["鍒涘缓鏃ユ湡"])).format("yyyy-MM-dd"),
+              HCheckEmp: data["瀹℃牳浜�"],
+              HCheckDate: data["瀹℃牳鏃ユ湡"] == null ? "" : dayjs(new Date(data["瀹℃牳鏃ユ湡"])).format("yyyy-MM-dd"),
+              HStopEmp: data["绂佺敤浜�"],
+              HStopDate: data["绂佺敤鏃ユ湡"] == null ? "" : dayjs(new Date(data["绂佺敤鏃ユ湡"])).format("yyyy-MM-dd"),
             });
-          })
-          .catch((error) => {
-            this.$modal.msgError("鎺ュ彛璇锋眰澶辫触!");
+            if (!data.HCheckEmp) {
+              this.CheckBillDisabled = false;
+            }
+            if (this.copyType == 1) {
+              this.form.HItemID = 0
+              this.form.HMakeEmp = sessionStorage["HUserName"]
+              this.form.HMakeDate = moment(new Date()).format("YYYY-MM-DDTHH:mm:ss")
+              this.form.HCheckEmp = ''
+              this.form.HCheckDate = ''
+              this.form.HStopEmp = ''
+              this.form.HStopDate = ''
+            }
+          }
+          this.$nextTick(() => {
+            this.formShow = true;
+            this.formLoading = false;
           });
+        }).catch((error) => {
+          this.$modal.msgError("鎺ュ彛璇锋眰澶辫触!");
+        });
       } else if (this.OperationType == 1) {
         let date = new Date();
         this.form.HMakeDate = moment(date).format("YYYY-MM-DDTHH:mm:ss");
@@ -361,17 +330,17 @@
     reset() {
       this.form = {
         HNumber: '',
-        HItemID:0,
+        HItemID: 0,
         HName: '',
         HHelpCode: '',
         HEmpID: 0,
         HEmpName: '',
         HBarCode: '',
         HStopflag: false,
-        HRemark:'',
-        HUSEORGID:sessionStorage["OrganizationID"],
         HRemark: '',
-        HMakeEmp:sessionStorage["HUserName"],
+        HUSEORGID: sessionStorage["OrganizationID"] - 0,
+        HRemark: '',
+        HMakeEmp: sessionStorage["HUserName"],
         HMakeTime: null,
         HStopEmp: null,
         HStopTime: null,
@@ -410,7 +379,7 @@
               var sMainStr = JSON.stringify(this.form);
               axios({
                 method: "post",
-                url: this.baseURL + "/Gy_Department/AddBill1",
+                url: this.$baseUrl + "/Gy_Department/AddBill1",
                 data: {
                   oMain: sMainStr + ';' + sessionStorage["HUserName"] + ';' + sessionStorage["OrganizationID"],
                 },
@@ -443,8 +412,8 @@
         .then(() => {
           if (this.rowForm.鐘舵�� == "鍒涘缓") {
             axios
-              .get(this.baseURL + "/Kf_SellOutBill/DeltetSellOutBill", {
-                params: { HInterID: this.rowForm.hmainid.toString(), user: this.user },
+              .get(this.$baseUrl + "/Kf_SellOutBill/DeltetSellOutBill", {
+                params: { HInterID: this.rowForm.hmainid.toString(), user: sessionStorage["HUserName"] },
               })
               .then((response) => {
                 if (response.data.count == 1) {
@@ -464,11 +433,11 @@
     },
     // 鍙嶅鏍�/瀹℃牳鏁版嵁
     set_CheckBill(num, form) {
-      var InterID = form.HItemID || form.HInterID;
+      var InterID = this.form.HItemID.toString();
       //閫昏緫瀹℃牳鏂规硶
       axios
-        .get(this.baseURL + "/Gy_Department/StopGy_Department", {
-          params: { HInterID: InterID, IsAudit: num, CurUserName: this.user },
+        .get(this.$baseUrl + "/Gy_Department/AuditGy_Department", {
+          params: { HInterID: InterID, IsAudit: num, CurUserName: sessionStorage["HUserName"] },
         })
         .then((response) => {
           let result = response.data;

--
Gitblit v1.9.1