小小儁爺
2024-06-04 c735107881df314cc60235f099447da82147bbae
src/views/workOrder/workOrderList.vue
@@ -206,7 +206,7 @@
          </el-table-column>
          <el-table-column
            prop="saleOrderCode"
            label="销售订单"
            label="销售订单/预测单"
            sortable="custom"
            show-tooltip-when-overflow
            min-width="160"
@@ -252,6 +252,30 @@
          >
            <template slot-scope="{row}">
              <div v-if="row.partspec">{{ row.partspec }}</div>
              <div v-else>/</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="TopInventoryCode"
            label="顶级物料编码"
            sortable="custom"
            show-tooltip-when-overflow
            min-width="130"
          >
            <template slot-scope="{row}">
              <div v-if="row.TopInventoryCode">{{ row.TopInventoryCode }}</div>
              <div v-else>/</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="TopInventoryName"
            label="顶级物料名称"
            sortable="custom"
            show-tooltip-when-overflow
            min-width="130"
          >
            <template slot-scope="{row}">
              <div v-if="row.TopInventoryName">{{ row.TopInventoryName }}</div>
              <div v-else>/</div>
            </template>
          </el-table-column>
@@ -336,7 +360,7 @@
                    :style="{color:$store.state.settings.theme}"
                    class="el-icon-printer"
                    style="cursor: pointer;margin-right: 15px"
                    @click.stop="handlePrint(row.wo_code,row.saleOrderCode)"
                    @click.stop="handlePrint(row.wo_code,row.saleOrderCode,row.TopInventoryName)"
                  />
                </el-tooltip>
@@ -613,6 +637,15 @@
        <el-form-item label="产品规格" prop="partspec">
          <el-input v-model="dialogForm.partspec" disabled style="width: 200px" />
        </el-form-item>
        <el-form-item v-if="operation!=='add'" label="顶级物料编码" prop="TopInventoryCode">
          <el-input v-model="dialogForm.TopInventoryCode" disabled style="width: 200px" />
        </el-form-item>
        <el-form-item v-if="operation!=='add'" label="顶级物料名称" prop="TopInventoryName">
          <el-input v-model="dialogForm.TopInventoryName" disabled style="width: 200px" />
        </el-form-item>
        <!--        :disabled="dialogForm.partcode===''"-->
        <el-form-item label="所属车间" prop="wkshopcode">
          <el-select
@@ -1099,6 +1132,7 @@
              <div v-else>/</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="plan_qty"
            label="任务数量"
@@ -1270,6 +1304,9 @@
                <el-form-item label="产品规格:" class="formContent">
                  {{ formApprove.partspec }}
                </el-form-item>
                <el-form-item label="顶级物料:" class="formContent">
                  {{ formApprove.TopInventoryName }}
                </el-form-item>
                <el-form-item label="工单数量:" class="formContent">
                  {{ formApprove.plan_qty }}
                </el-form-item>
@@ -1347,22 +1384,29 @@
          <el-table-column
            id="column4"
            prop="good_qty"
            width="100"
            width="60"
            align="center"
            label="合格数量"
            label="合格"
          />
          <el-table-column
            id="column5"
            width="100"
            width="60"
            prop="ng_qty"
            align="center"
            label="不良数量"
            label="不良"
          />
          <el-table-column
            id="column6"
            prop="desc"
            align="center"
            width="120"
            width="100"
            label="检验员"
          />
          <el-table-column
            id="column6"
            prop="desc"
            align="center"
            width="100"
            label="备注"
          />
        </el-table>
@@ -1372,7 +1416,7 @@
          <el-button v-waves @click="dialogVisibleBackPreview">返 回</el-button>
          <!--            <el-button v-waves v-if="operation==='add'" type="primary" @click="dialogVisibleConfirm">确 定</el-button>-->
          <!--            <el-button v-waves type="primary" @click="dialogVisibleConfirm">确 定/打 印</el-button>-->
          <el-button v-waves v-print="printObj" type="primary">打 印</el-button>
          <el-button v-waves v-print="printObj" type="primary" @click="sendMesOrderDistribution">打 印</el-button>
        </div>
      </span>
    </el-dialog>
@@ -2056,6 +2100,10 @@
        deliverydate: '', // 交付时间
        data_sources: '', // 数据来源
        idTopInventory: '', // 顶级物料id
        TopInventoryCode: '', // 顶级物料编码
        TopInventoryName: '', // 顶级物料名称
        mesmaxqty: 0// 工单的最大值
      },
      ordertypeArr: [// 工单类型
@@ -2134,7 +2182,7 @@
          console.log('执行了打印')
        }
      },
      sendMesOrderWoCode: '',
      formApprove: {
        m_po: '', // 源单单号
        mesordercode: '',
@@ -2143,6 +2191,7 @@
        partname: '',
        partspec: '',
        plan_qty: '',
        TopInventoryName: '',
        routename: '',
        lm_date: ''
      },
@@ -2278,6 +2327,16 @@
    // })
  },
  methods: {
    // 打印的时候执行派发事件
    sendMesOrderDistribution() {
      MesOrderDistribution([this.sendMesOrderWoCode]).then(res => {
        if (res.code === '200') {
          this.$notify.success('派发成功!')
          this.getMesOrderSearch()
        }
      })
    },
    setSort() {
      const el = this.$refs.stepTableDataRef.$el.querySelectorAll('.el-table__body-wrapper > table > tbody')[0]
      this.sortable = Sortable.create(el, {
@@ -2507,6 +2566,10 @@
      this.dialogForm.deliverydate = row.saleOrderDeliveryDate.substring(0, 11)
      this.dialogForm.mesqty = row.plan_qty
      this.dialogForm.TopInventoryCode = row.TopInventoryCode
      this.dialogForm.TopInventoryName = row.TopInventoryName
      this.dialogForm.idTopInventory = row.idTopInventory
      const data = {
        sourceid: this.dialogForm.sourceorderid,
        sourcewo: this.dialogForm.sourceorder,
@@ -2602,6 +2665,10 @@
        mesqty: '', // 工单数量
        wkshopcode: '', // 生产车间编码
        wkshopname: '', // 生产车间名称
        idTopInventory: '', // 顶级物料id
        TopInventoryCode: '', // 顶级物料编码
        TopInventoryName: '', // 顶级物料名称
        deliverydate: '', // 交付时间
        data_sources: '' // 数据来源
@@ -2721,15 +2788,19 @@
      this.dialogVisibleSearch = false
    },
    // 处理打印
    handlePrint(wo_code, saleOrderCode) {
    handlePrint(wo_code, saleOrderCode, TopInventoryName) {
      // const number = Math.random() * Math.random()
      // this.number = number === 0 ? (10 + Math.random()) : number
      // console.log(number)
      this.formApprove.saleOrderCode = this.formApprove.saleOrderCode !== '' ? this.formApprove.saleOrderCode : saleOrderCode
      this.formApprove.TopInventoryName = TopInventoryName || '/'
      const data2 = {
        mesordercode: wo_code || this.dialogForm.mesordercode
      }
      this.sendMesOrderWoCode = wo_code || this.dialogForm.mesordercode
      MesOrderPrintSearch(data2).then(res2 => {
        if (res2.code === '200') {
          const res3 = res2.data.recordset
@@ -2822,6 +2893,7 @@
      this.formApprove.plan_qty = ''
      this.formApprove.routename = ''
      this.formApprove.lm_date = ''
      this.formApprove.TopInventoryName = ''
      // this.$refs.qrCodeDiv0.title = ''