From fdccbcb18a3216ec53b47e0f04cd71a1605c8e58 Mon Sep 17 00:00:00 2001
From: wangyi <2946747746@qq.com>
Date: 星期四, 27 十一月 2025 08:25:54 +0800
Subject: [PATCH] 销售退货单:条码明细

---
 src/views/sell/Kf_ICStockBillMainList/Kf_ICStockBillMainListEdit.vue |  139 ++++++++++++++++++++++++++++++++++++++++++++++
 src/views/sell/Kf_ICStockBillMainList/Kf_ICStockBillMainList.vue     |   36 +++++++++--
 2 files changed, 168 insertions(+), 7 deletions(-)

diff --git a/src/views/sell/Kf_ICStockBillMainList/Kf_ICStockBillMainList.vue b/src/views/sell/Kf_ICStockBillMainList/Kf_ICStockBillMainList.vue
index 6e9bc8b..d38f1fc 100644
--- a/src/views/sell/Kf_ICStockBillMainList/Kf_ICStockBillMainList.vue
+++ b/src/views/sell/Kf_ICStockBillMainList/Kf_ICStockBillMainList.vue
@@ -402,6 +402,9 @@
         >
       </el-col>
       <!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> -->
+       <el-col :span="1.5">
+        <el-button type="primary" icon="el-icon-printer" size="mini" :disabled="single" @click="get_BarCodeDetail">鏉$爜鏄庣粏</el-button>
+      </el-col>
     </el-row>
     <div class="tableBox" v-loading="loading">
       <el-table
@@ -582,6 +585,8 @@
           @pagination="currentPage"
         />
       </el-dialog>
+      <!-- 鏉$爜鏄庣粏 -->
+      <BarCodeDetail :visible.sync="barCodeDetailShow" ref="barcodeDetail"/>
     </div>
   </div>
 </template>
@@ -590,11 +595,12 @@
 import axios from "axios";
 import RowSettings from "@/views/component/rowSettings";
 import Edit from '@/views/sell/Kf_ICStockBillMainList/Kf_ICStockBillMainListEdit'
-import dayjs from "dayjs";
+import BarCodeDetail from '@/views/component/BarCodeDetail'               //鏉$爜鏄庣粏缁勪欢
+import dayjs from "dayjs";                                                //鏃ユ湡澶勭悊搴�
 
 export default {
   name: "GySource",
-  components: { RowSettings,Edit},
+  components: { RowSettings,Edit,BarCodeDetail},
   props: {
     openPage: { type: String },
   },
@@ -609,7 +615,8 @@
       tableShow: true,
       openPrintList: false,
       printListShow: false,
-      HClassTag: "ForFilteringSchemes", //杩囨护鏉′欢鐨刢lass绫�
+      HClassTag: "ForFilteringSchemes",                     //杩囨护鏉′欢鐨刢lass绫�
+      barCodeDetailShow: false,                             //鏉$爜鏄庣粏缁勪欢瀹瑰櫒鏄剧ず鏍囪
       HBillType: "1202",
       openBtnHide: false,
       btnHideShow: false,
@@ -752,7 +759,7 @@
     this.getList();
   },
   methods: {
-    handleDblclick1(){
+    handleDblclick1(){     //寤舵椂浼犻�掑鍏ユ暟鎹�
       // 寤惰繜鎵ц绗竴涓嚱鏁�
       setTimeout(() => {
         this.handleRowClick();
@@ -918,7 +925,7 @@
       }
 
       try {
-        let res = await axios.get(this.baseURL + "/Kf_ICStockBillMain/GetCStockBillList", {
+        let res = await axios.get(this.baseURL + "/Kf_ICStockBackBill/GetKf_ICStockBackBillList", {
           params: {
             sWhere: this.sWhere,
             user: this.user,
@@ -1352,7 +1359,11 @@
     close() {
       this.tableShow = true;
       this.editShow = false;
-      this.openEdit = false;
+      this.openEdit = false;    //褰撻�氳繃瓒呴摼鎺ヨ繘鍏ョ紪杈戦〉闈㈠苟閫�鍑哄悗锛岄�変腑璁板綍鏁颁负绌猴紝浣嗙紪杈戞寜閽彲鎿嶄綔銆傜偣鍑荤紪杈戞寜閽紝鍐嶆湭閫変腑璁板綍鐨勬儏鍐典笅浠嶈兘杩涘叆鏈�鍚庝竴娆¢�変腑鐨勮褰曠殑缂栬緫椤甸潰銆�
+      this.rowForm = {};        // 鍏抽棴鏃堕噸缃繖涓暟鎹氨鑳借В鍐充笂闈㈢殑闂娓呯┖琛屾暟鎹�
+      this.ids = [];            // 娓呯┖閫変腑ID鏁扮粍
+      this.single = true;       // 閲嶇疆鍗曢�夌姸鎬�
+      this.multiple = true;     // 閲嶇疆澶氶�夌姸鎬�
       this.getList();
     },
     //鎵撳紑鏂板缁勪欢寮圭獥
@@ -1376,7 +1387,18 @@
       });
     },
     // 鎵撳紑淇敼缁勪欢寮圭獥
-   
+    //#region 鏉$爜鏄庣粏
+    get_BarCodeDetail() {
+      // if (this.selectedRow.length !== 1) {
+      //   this.$message.warning('璇烽�夋嫨涓�琛屾暟鎹煡鐪嬫潯鐮佹槑缁嗭紒')
+      //   return
+      // }
+      this.barCodeDetailShow = true
+      this.$nextTick(() => {
+        this.$refs.barcodeDetail.open(this.rowForm)
+      })
+		},
+    //#endregion
     //鍏抽棴缂栬緫椤甸潰
     editGyClose(val) {
       this.editShow = false;
diff --git a/src/views/sell/Kf_ICStockBillMainList/Kf_ICStockBillMainListEdit.vue b/src/views/sell/Kf_ICStockBillMainList/Kf_ICStockBillMainListEdit.vue
index 34bd751..7e2ff79 100644
--- a/src/views/sell/Kf_ICStockBillMainList/Kf_ICStockBillMainListEdit.vue
+++ b/src/views/sell/Kf_ICStockBillMainList/Kf_ICStockBillMainListEdit.vue
@@ -352,6 +352,7 @@
 import Dept from '@/views/component/dept'
 import Warehouse from '@/views/component/warehouse'
 import Material from '@/views/component/material'
+import dayjs from 'dayjs'
 
 export default {
   name: 'SellOutBill',
@@ -461,6 +462,9 @@
       } 
       else if (this.OperationType == 3 || this.copyType == 1) { 
         this.handleUpdate()
+      }
+      else if(this.OperationType == 2){
+        this.handleCopy()
       }
       else if (this.OperationType == 4) {
         this.zzSelDis = true
@@ -768,6 +772,141 @@
       });
     },
     //#endregion
+     //#region 澶嶅埗椤甸潰鍒濆鍖�
+    handleCopy() {
+      // 妫�鏌ュ繀瑕佸弬鏁�
+      if (!this.linterid) {
+        this.$modal.msgError("澶嶅埗澶辫触锛氱己灏戞簮鏁版嵁ID");
+        this.formShow = true;
+        this.formLoading = false;
+        return;
+      }
+      
+      if (!this.baseURL) {
+        this.$modal.msgError("澶嶅埗澶辫触锛氭帴鍙e湴鍧�鏈厤缃�");
+        this.formShow = true;
+        this.formLoading = false;
+        return;
+      }
+      
+      this.reset()
+      let rowHmainid = this.linterid
+      console.log("寮�濮嬪鍒讹紝鍙傛暟:", { HInterID: rowHmainid })
+      
+      // 娣诲姞璇锋眰瓒呮椂璁剧疆
+      axios.get(this.baseURL + "Kf_ICStockBackBill/getEditInitData", {
+        params: { 'HInterID': rowHmainid },
+        timeout: 10000 // 10绉掕秴鏃�
+      }).then(response => {
+        console.log("澶嶅埗鎺ュ彛瀹屾暣鍝嶅簲:", response)
+        
+        if (!response.data) {
+          throw new Error("鍝嶅簲鏁版嵁涓虹┖")
+        }
+        
+        if (response.data.count == 1) {
+          // 鍘熸湁鐨勫鍒堕�昏緫
+          var result = response.data
+          var data = response.data.data[0]
+          console.log("澶嶅埗鑾峰彇鐨勬暟鎹�:", data)
+          
+          // 鑾峰彇鏂板崟鍙�
+          this.getHBillNo()
+          
+          // 澶嶅埗涓昏〃鏁版嵁
+          this.form.BillType = data.HSourceBillType
+          this.form.HInterID = 0
+          this.form.HDate = dayjs(new Date()).format("YYYY-MM-DD")
+          this.form.HMaker = sessionStorage["HUserName"] || "褰撳墠鐢ㄦ埛"
+          this.form.HChecker = ""
+          this.form.HMakeDate = dayjs(new Date()).format("YYYY-MM-DD")
+          this.form.HCheckDate = ""
+          this.form.HCloseMan = ""
+          this.form.HDeleteMan = ""
+          this.form.HCloseDate = ""
+          this.form.HDeleteDate = ""
+
+          // 澶嶅埗涓氬姟鏁版嵁...
+          this.form.HEmpID = data.HEmpID
+          this.form.HEmpName = data.涓氬姟鍛�
+          this.form.HDeptID = data.HDeptID
+          this.form.HDeptName = data.閮ㄩ棬
+          this.form.HSupID = data.HSupID
+          this.form.HSupName = data.渚涘簲鍟�
+          this.form.HInvoiceBillNo = (data.鍙戠エ缂栧彿 || "") + "_COPY"
+          this.form.HWHID = data.涓昏〃浠撳簱ID
+          this.form.HWHName = data.涓昏〃浠撳簱
+          this.form.HSecManagerID = data.HSecManagerID
+          this.form.HSecManagerName = data.楠屾敹鍛�
+          this.form.HRemark = (data.琛ㄥご澶囨敞 || "") + " (澶嶅埗)"
+          this.form.HOrgID = data.HOrgID
+          this.form.HSTOCKORGID = data.HOrgID
+          this.form.HOWNERID = data.HOrgID
+
+          // 澶嶅埗瀛愯〃鏁版嵁...
+          this.editData = [] // 娓呯┖鍘熸湁鏁版嵁
+          for (var i = 0; i < result.data.length; i++) {
+            this.editData.push({
+              "HMaterID": result.data[i].HMaterID,
+              "鐗╂枡浠g爜": result.data[i].鐗╂枡浠g爜,
+              "鐗╂枡鍚嶇О": result.data[i].鐗╂枡鍚嶇О,
+              "瑙勬牸鍨嬪彿": result.data[i].瑙勬牸鍨嬪彿,
+              "HUnitID": result.data[i].HUnitID,
+              "璁¢噺鍗曚綅": result.data[i].璁¢噺鍗曚綅,
+              "HQtyMust": result.data[i].搴旀敹鏁伴噺,
+              "HQty": result.data[i].瀹炴敹鏁伴噺,
+              "HRemark": (result.data[i].琛ㄤ綋澶囨敞 || "") + " (澶嶅埗)",
+              "HPrice": result.data[i].鍗曚环,
+              "HMoney": result.data[i].閲戦,
+              "HOrderPrice": result.data[i].閲囪喘閲戦,
+              "HWHID": result.data[i].HWHID,
+              "鏀舵枡浠撳簱": result.data[i].鏀舵枡浠撳簱,
+              "HSPID": result.data[i].HSPID,
+              "浠撲綅鍚嶇О": result.data[i].浠撲綅鍚嶇О,
+              "HBatchNo": result.data[i].鎵规,
+              "HSourceBillNo": result.data[i].婧愬崟鍗曞彿,
+              "HSourceBillType": result.data[i].婧愬崟绫诲瀷,
+              "HSourceInterID": result.data[i].婧愬崟涓诲唴鐮�,
+              "HSourceEntryID": result.data[i].婧愬崟瀛愬唴鐮�,
+              "HTaxRate": result.data[i].绋庣巼,
+              "HTaxPrice": result.data[i].鍚◣鍗曚环,
+              "HlineTotal": result.data[i].鍚◣閲戦,
+              "HStatus": "鍒涘缓"
+            })
+          }
+
+          this.subDisabled = false
+          this.$modal.msgSuccess("鏁版嵁澶嶅埗鎴愬姛锛�")
+          this.formShow = true
+          this.formLoading = false
+
+        } else {
+          this.$modal.msgError("澶嶅埗澶辫触锛氭湭鎵惧埌瀵瑰簲鐨勬簮鏁版嵁")
+          this.formShow = true
+          this.formLoading = false
+        }
+      }).catch(error => {
+        let errorMsg = "澶嶅埗鏁版嵁澶辫触! ";
+        if (error.response) {
+          // 鏈嶅姟鍣ㄥ搷搴旈敊璇�
+          errorMsg += `鏈嶅姟鍣ㄩ敊璇�: ${error.response.status} - ${error.response.data || ''}`;
+        } else if (error.request) {
+          // 璇锋眰鍙戦�佸け璐�
+          errorMsg += "缃戠粶閿欒锛岃妫�鏌ョ綉缁滆繛鎺�";
+        } else {
+          // 鍏朵粬閿欒
+          errorMsg += error.message;
+        }
+        
+        console.error("澶嶅埗璇︾粏閿欒:", error)
+        this.$modal.msgError(errorMsg)
+        this.$nextTick(() => {
+          this.formShow = true
+          this.formLoading = false
+        })
+      })
+    },
+    //#endregion
 
     //#region 鍒楄缃�
     handleRowHide() {

--
Gitblit v1.9.1