wangyi
2025-11-27 fdccbcb18a3216ec53b47e0f04cd71a1605c8e58
销售退货单:条码明细
2个文件已修改
175 ■■■■■ 已修改文件
src/views/sell/Kf_ICStockBillMainList/Kf_ICStockBillMainList.vue 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/sell/Kf_ICStockBillMainList/Kf_ICStockBillMainListEdit.vue 139 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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", //过滤条件的class类
      HClassTag: "ForFilteringSchemes",                     //过滤条件的class类
      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;
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("复制失败:接口地址未配置");
        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,
              "物料代码": result.data[i].物料代码,
              "物料名称": 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() {