小小儁爺
2024-10-29 642ae743bc6009e4ae95e6e47831396ba54bcde7
1.生产入库实现18%
已修改2个文件
118 ■■■■ 文件已修改
src/views/produce/productWarehouse.vue 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/produce/stepReport.vue 83 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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,14 @@
        ]
      }
      console.log(JSON.stringify(data))
      const res = await ProductInHouseOrderSeave(data)
      console.log(res)
      if (res.code === '200') {
        this.multipleSelection = []
        this.form.deptno = ''
        this.form.stockcode = ''
        await this.getProductInHouseOrderSearch()
        await this.getProductInHouseOrderCodeSearch()
      }
    },
    // 重置
    reset() {
src/views/produce/stepReport.vue
@@ -883,8 +883,14 @@
  EditOrderNgStepSeave,
  MesOrderNgStepSearch,
  MesOrderNgSubStepSearch,
  MesOrderStepSearch, MesOrderStepStart,
  MesOrderWxStepSearch, SavaMesOrderStepIn, SavaMesOrderStepOut, SavaMesOrderStepReport
  MesOrderStepSearch,
  MesOrderStepStart,
  MesOrderWxStepSearch,
  ProductInHouseOrderCodeSearch,
  ProductInHouseOrderSeave,
  SavaMesOrderStepIn,
  SavaMesOrderStepOut,
  SavaMesOrderStepReport
} from '@/api/WorkOrder'
import {
  CustomerPermissions,
@@ -897,8 +903,9 @@
import { nanoid } from 'nanoid'
import { LabelBarCode } from '@/api/systemSetting'
import { getCookie } from '@/utils/auth'
import { handleDatetime2 } from '@/utils/global'
import { handleDatetime, handleDatetime2 } from '@/utils/global'
import QRCode from 'qrcodejs2'
export default {
  name: 'StepReport',
  components: {
@@ -1050,10 +1057,14 @@
          console.log('执行了打印')
        }
      },
      xx: ''
      rowData: {}
    }
  },
  activated() {   window.addEventListener('resize', this.getHeight)   this.getHeight() }, created() {
  activated() {
    window.addEventListener('resize', this.getHeight)
    this.getHeight()
  },
  created() {
  },
  mounted() {
@@ -1169,9 +1180,11 @@
    // 报工
    report(row) {
      if (row) {
        this.rowData = row
        this.getMesOrderStepStart('ZZ', '', row.wo_code, row.stepcode)
      } else {
        const temp = this.tableData.find(i => i.id === this.radioSelected)
        this.rowData = temp
        this.getMesOrderStepStart('ZZ', '', temp.wo_code, temp.stepcode)
      }
    },
@@ -1187,9 +1200,11 @@
    // 收料
    takeIn(row) {
      if (row) {
        this.rowData = row
        this.getMesOrderStepStart('WX', 'IN', row.wo_code, row.stepcode)
      } else {
        const temp = this.tableData.find(i => i.id === this.radioSelected)
        this.rowData = temp
        this.getMesOrderStepStart('WX', 'IN', temp.wo_code, temp.stepcode)
      }
    },
@@ -1394,6 +1409,11 @@
            const res = await SavaMesOrderStepReport(data)
            if (res.code === '200') {
              this.$notify.success('报工成功!')
              if (this.rowData.isend === 'Y') {
                await this.handleProductInHouseOrderSeave('B', inbarcode)
              }
              // await this.search()
              await this.tabClick()
              this.$store.state.app.buttonIsDisabled = false
@@ -1503,6 +1523,9 @@
            const res = await SavaMesOrderStepIn(data)
            if (res.code === '200') {
              this.$notify.success('收料成功!')
              if (this.rowData.isend === 'Y') {
                await this.handleProductInHouseOrderSeave('S', inbarcode)
              }
              // await this.search()
              await this.tabClick()
              this.$store.state.app.buttonIsDisabled = false
@@ -1553,6 +1576,56 @@
      // this.$refs.qrCodeDiv2 = ''
    },
    async handleProductInHouseOrderSeave(type, inbarcode) {
      const { data: res2 } = await ProductInHouseOrderCodeSearch({ rightcode: '0604' })
      const TableDetailData = []
      TableDetailData.push({
        'hbillno': res2[0], // 入库单号
        'rownumber': this.rowData.sbid.toString(), // 行号
        'inbarcode': inbarcode, // 入库条码
        'mo_id': this.rowData.sbid.toString(), // 订单id(行号)
        'mo_no': this.rowData.m_po, // 订单号
        'wocode': this.rowData.wo_code, // 工单号
        'partcode': this.rowData.partcode, // 产品编码
        'unitcode': this.rowData.unitcode, // 单位编码
        'unit_rate': '1', // 单位换算率
        'stockcode': this.rowData.stockcode, // 仓库编码
        'qty': type === 'B' ? this.dialogForm.startqty.toString() : this.dialogForm.sqty.toString(), // 入库数量
        'price': '0', // 入库单价
        'saleid': this.rowData.saleOrderDetailId.toString(), // 销售单id(行号)
        'salecode': this.rowData.saleOrderCode, // 销售单号
        'status': '0', // 入库单状态:0(未审核) 1(已审核)
        'stepcode': this.rowData.stepcode, // 工序编码
        'style': type// 报工类型:B(自制) S(外协)
      })
      const data = {
        'rightcode': '0604', // 功能编号
        'incbit': res2[1], // 流水号
        'TableData': [
          [
            {
              'hbillno': res2[0], // 入库单号
              'hbdate': handleDatetime(new Date()),
              'deptno': this.rowData.dept_code, // 入库部门
              'storehouse_code': this.rowData.stockcode, // 仓库编码
              'status': '0', // 入库单状态:0(未审核) 1(已审核)
              'remark': '', // 备注
              'create_user': localStorage.getItem('username'), // 创建人员
              'create_date': handleDatetime2(new Date()),
              'check_user': '', // 审核人员
              'check_date': ''// 审核时间
            }
          ],
          TableDetailData// 表体
        ]
      }
      await ProductInHouseOrderSeave(data)
    },
    ZZprint2(username) {
      if (this.dialogForm.nextstepcode !== '') {
        this.qrForm.qrvalue = this.dialogForm.wo_code + ';' + this.dialogForm.nextstepcode