小小儁爺
2024-10-30 c411ff4e29b1b3f6d61dd0bae092d56358f06922
src/views/produce/productWarehouse.vue
@@ -130,10 +130,11 @@
            <el-form-item label="单据编号" style=" display: flex;">
              <el-input
                v-model="form.hbillno"
                readonly
                placeholder="请输入"
                style="width: 200px"
              />
              <!--              readonly-->
            </el-form-item>
            <el-form-item label="入库仓库" required style=" display: flex;">
@@ -675,18 +676,29 @@
    },
    // 复选框切换
    handleSelectionChange() {
    handleSelectionChange(val) {
      this.multipleSelection = val
    },
    // 递交
    async  submit() {
      // usercode
      // console.log(localStorage.getItem('username'))
      if (this.multipleSelection.length === 0) {
        return this.$message.info('请先勾选单据!')
      }
      if (this.form.stockcode === '') {
        return this.$message.info('入库仓库不能为空!')
      }
      if (this.form.deptno === '') {
        return this.$message.info('入库部门不能为空!')
      }
      const TableDetailData = []
      this.tableDataDetail.forEach((i, index) => {
      this.multipleSelection.forEach((i, index) => {
        TableDetailData.push({
          'hbillno': this.form.hbillno, // 入库单号
          'rownumber': i.sbid.toString(), // 行号
          'rownumber': (index + 1).toString(), // 行号
          'inbarcode': i.inbarcode, // 入库条码
          'mo_id': i.sbid.toString(), // 订单id(行号)
          'mo_no': i.m_po, // 订单号
@@ -695,7 +707,8 @@
          'unitcode': i.unitcode, // 单位编码
          'unit_rate': '1', // 单位换算率
          'stockcode': i.stockcode, // 仓库编码
          'qty': i.qty.toString(), // 入库数量
          // 'qty': i.qty.toString(), // 入库数量
          'qty': i.good_qty.toString(), // 入库数量
          'price': '0', // 入库单价
          'saleid': i.saleOrderDetailId.toString(), // 销售单id(行号)
          'salecode': i.saleOrderCode, // 销售单号
@@ -726,10 +739,15 @@
        ]
      }
      console.log(JSON.stringify(data))
      const res = await ProductInHouseOrderSeave(data)
      console.log(res)
      if (res.code === '200') {
        this.$message.success('入库成功!')
        this.multipleSelection = []
        this.form.deptno = ''
        this.form.stockcode = ''
        await this.getProductInHouseOrderSearch()
        await this.getProductInHouseOrderCodeSearch()
      }
    },
    // 重置
    reset() {