loulijun2021
2023-03-07 406539dc819bfa5e98dda354006c6f55cc808b14
1. MES工单新增报废补单工单查询
已修改4个文件
298 ■■■■■ 文件已修改
src/api/scgl.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/myEcharts.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/kb/ckgl.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/scgl/gd.vue 279 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/scgl.js
@@ -261,3 +261,12 @@
    params: data
  })
}
// MES报废补单工单查询
export function MesBadOrderSearch(data) {
  return request({
    url: 'ProductionManagement/MesBadOrderSearch',
    method: 'get',
    params: data
  })
}
src/utils/myEcharts.js
@@ -394,8 +394,8 @@
      }
    },
    grid: {
      left: '10%',
      right: '5%',
      left: '5%',
      right: '10%',
      bottom: '0%',
      top: '10%',
      containLabel: true
src/views/kb/ckgl.vue
@@ -302,7 +302,8 @@
              半成品、产品库存量排行Top5
            </div>
            <div class="lineContent horn" style="height: 435px">
              <div id="bar03" style="width: 100%;height:100%;margin-left: -25px;margin-top: -10px" />
              <div id="bar03" style="width: 100%;height:100%; " />
              <!--/*              <div id="bar03" style="width: 100%;height:100%;margin-left: -25px;margin-top: -10px" />*/-->
            </div>
          </div>
          <div style="height: 470px;">
@@ -311,7 +312,8 @@
              原材料库存量排行Top5
            </div>
            <div class="lineContent horn" style="height: 435px">
              <div id="bar04" style="width: 100%;height:100%;margin-left: -25px;margin-top: -10px" />
              <div id="bar04" style="width: 100%;height:100%;" />
              <!--              <div id="bar04" style="width: 100%;height:100%;margin-left: -25px;margin-top: -10px" />-->
            </div>
          </div>
        </div>
src/views/scgl/gd.vue
@@ -20,7 +20,7 @@
          style="display: flex;justify-content: space-between"
        >
          <div class="elForm">
            <el-form-item label-width="70px" label="订单状态" style=" display: flex;">
            <el-form-item label-width="70px" label="工单状态" style=" display: flex;">
              <el-select
                v-model="form.mesorderstus"
                :popper-append-to-body="false"
@@ -158,7 +158,7 @@
          />
          <el-table-column
            prop="status"
            label="订单状态"
            label="工单状态"
            sortable="custom"
            width="110"
          >
@@ -448,7 +448,7 @@
        label-width="110px"
      >
        <el-form-item
          label="订单状态"
          label="工单状态"
          prop="mesorderstus"
        >
          <el-select
@@ -691,7 +691,7 @@
          <!--          <el-button v-if="operation==='add'" type="primary" @click="dialogVisibleConfirmPreview('add')">预览</el-button>-->
          <el-button
            v-if="!sumbitBottonIsDisabled"
            v-waves
            type="primary"
            :loading="$store.state.app.buttonIsDisabled"
            :disabled="$store.state.app.buttonIsDisabled"
@@ -700,7 +700,7 @@
          <el-button
            v-if="sumbitBottonIsDisabled"
            v-waves
            type="primary"
            disabled
            @click="dialogVisibleConfirm"
@@ -816,13 +816,83 @@
          style="display: flex;justify-content: space-between"
        >
          <div class="elForm" style="justify-content: flex-start">
            <!--            <el-form-item-->
            <!--              label="预计开工时间"-->
            <!--              label-width="100px"-->
            <!--              style=" display: flex;font-size: 14px;margin-top: 3px"-->
            <!--            >-->
            <!--              <el-date-picker-->
            <!--                v-model="sourceForm.paystartdate"-->
            <!--                type="daterange"-->
            <!--                range-separator="~"-->
            <!--                class="timeMini"-->
            <!--                size="mini"-->
            <!--                style="width: 200px;display: flex;line-height: 34px;height: 34px;font-size: 14px!important;"-->
            <!--                :clearable="false"-->
            <!--                start-placeholder="开始日期"-->
            <!--                end-placeholder="结束日期"-->
            <!--              />-->
            <!--              &lt;!&ndash;              :picker-options="expireTimeOption"&ndash;&gt;-->
            <!--            </el-form-item>-->
            <!--            <el-form-item-->
            <!--              label="预计完工时间"-->
            <!--              label-width="100px"-->
            <!--              style=" display: flex;font-size: 14px;margin-top: 3px"-->
            <!--            >-->
            <!--              <el-date-picker-->
            <!--                v-model="sourceForm.payenddate"-->
            <!--                type="daterange"-->
            <!--                :clearable="false"-->
            <!--                class="timeMini"-->
            <!--                range-separator="~"-->
            <!--                start-placeholder="开始日期"-->
            <!--                style="width: 200px;display: flex;line-height: 34px ;height: 34px ;font-size: 14px !important;"-->
            <!--                end-placeholder="结束日期"-->
            <!--                size="mini"-->
            <!--              />-->
            <!--            </el-form-item>-->
            <!--            <el-form-item label="工单状态" style=" display: flex;">-->
            <!--              <el-select-->
            <!--                v-model="sourceForm.mesordercode"-->
            <!--                filterable-->
            <!--                :popper-append-to-body="false"-->
            <!--                style="width: 200px"-->
            <!--                placeholder="请选择"-->
            <!--              >-->
            <!--                <el-option-->
            <!--                  v-for="item in erporderstusArr"-->
            <!--                  :key="item.code"-->
            <!--                  :label="item.name"-->
            <!--                  :value="item.code"-->
            <!--                />-->
            <!--              </el-select>-->
            <!--            </el-form-item>-->
            <el-form-item label="工单编号" style=" display: flex;">
              <el-input v-model="sourceForm.sourceorder" placeholder="请输入" style="width: 200px" />
            </el-form-item>
            <el-form-item label="产品编码" style=" display: flex;">
              <el-input v-model="sourceForm.partcode" style="width: 200px" placeholder="请输入" />
            </el-form-item>
            <el-form-item label="产品名称" style=" display: flex;">
              <el-input v-model="sourceForm.partname" style="width: 200px" placeholder="请输入" />
            </el-form-item>
            <el-form-item v-show="isExpandDialog" label="产品规格" style=" display: flex;">
              <el-input v-model="sourceForm.partspec" style="width: 200px" placeholder="请输入" />
            </el-form-item>
            <el-form-item v-show="isExpandDialog" label="创建人员" style=" display: flex;">
              <el-input v-model="sourceForm.creatuser" style="width: 200px" placeholder="请输入" />
            </el-form-item>
            <el-form-item
              label="预计开工时间"
              v-show="isExpandDialog"
              label="创建时间"
              label-width="100px"
              style=" display: flex;font-size: 14px;margin-top: 3px"
            >
              <el-date-picker
                v-model="sourceForm.paystartdate"
                v-model="sourceForm.createdate"
                type="daterange"
                range-separator="~"
                class="timeMini"
@@ -834,55 +904,6 @@
              />
              <!--              :picker-options="expireTimeOption"-->
            </el-form-item>
            <el-form-item
              label="预计完工时间"
              label-width="100px"
              style=" display: flex;font-size: 14px;margin-top: 3px"
            >
              <el-date-picker
                v-model="sourceForm.payenddate"
                type="daterange"
                :clearable="false"
                class="timeMini"
                range-separator="~"
                start-placeholder="开始日期"
                style="width: 200px;display: flex;line-height: 34px ;height: 34px ;font-size: 14px !important;"
                end-placeholder="结束日期"
                size="mini"
              />
            </el-form-item>
            <el-form-item label="订单状态" style=" display: flex;">
              <el-select
                v-model="sourceForm.erporderstus"
                filterable
                :popper-append-to-body="false"
                style="width: 200px"
                placeholder="请选择"
              >
                <el-option
                  v-for="item in erporderstusArr"
                  :key="item.code"
                  :label="item.name"
                  :value="item.code"
                />
              </el-select>
            </el-form-item>
            <el-form-item v-show="isExpandDialog" label="订单编号" style=" display: flex;">
              <el-input v-model="sourceForm.erpordercode" placeholder="请输入" style="width: 200px" />
            </el-form-item>
            <el-form-item v-show="isExpandDialog" label="产品编码" style=" display: flex;">
              <el-input v-model="sourceForm.partcode" style="width: 200px" placeholder="请输入" />
            </el-form-item>
            <el-form-item v-show="isExpandDialog" label="产品名称" style=" display: flex;">
              <el-input v-model="sourceForm.partname" style="width: 200px" placeholder="请输入" />
            </el-form-item>
            <el-form-item v-show="isExpandDialog" label="产品规格" style=" display: flex;">
              <el-input v-model="sourceForm.partspec" style="width: 200px" placeholder="请输入" />
            </el-form-item>
            <el-form-item v-show="isExpandDialog" label="创建人员" style=" display: flex;">
              <el-input v-model="sourceForm.creatuser" style="width: 200px" placeholder="请输入" />
            </el-form-item>
          </div>
@@ -915,14 +936,15 @@
      <div class="elTableDiv">
        <el-table
          :data="sourceTableData"
          :height="isExpandDialog?(tableHeight+60)+'px':(tableHeight+140)+'px'"
          :height="isExpandDialog?(tableHeight+60)+'px':(tableHeight+100)+'px'"
          border
          :row-class-name="tableRowClassName"
          :style="{width: 100+'%',height:isExpandDialog?(tableHeight+60)+'px':(tableHeight+140)+'px',}"
          :style="{width: 100+'%',height:isExpandDialog?(tableHeight+60)+'px':(tableHeight+100)+'px',}"
          highlight-current-row
          :header-cell-style="this.$headerCellStyle"
          :cell-style="this.$cellStyle"
          @sort-change="sourceSortChange"
          @row-click="getCurrentRowSource"
        >
          <!--          <el-table-column-->
          <!--            type="selection"-->
@@ -937,8 +959,8 @@
                v-model="radioSelectedId"
                :label="row.id"
                style="color: transparent;padding-left: 10px;"
                @change.native="getCurrentRowSource(row.id)"
              />
              <!--              @change.native="getCurrentRowSource(row.id)"-->
            </template>
          </el-table-column>
          <el-table-column
@@ -947,40 +969,50 @@
            fixed
            label="序号"
          />
          <!--          <el-table-column-->
          <!--            prop="status"-->
          <!--            label="工单状态"-->
          <!--            show-tooltip-when-overflow-->
          <!--            sortable="custom"-->
          <!--            width="110"-->
          <!--          >-->
          <!--            <template slot-scope="{row}">-->
          <!--              <div v-if="row.status==='NEW'">新订单</div>-->
          <!--              <div v-if="row.status==='CREATING'">部分下达</div>-->
          <!--              <div v-if="row.status==='CREATED'">全部下达</div>-->
          <!--              <div v-if="row.status==='CLOSED'">已关闭</div>-->
          <!--            </template>-->
          <!--          </el-table-column>-->
          <el-table-column
            prop="status"
            label="订单状态"
            sortable="custom"
            width="110"
          >
            <template slot-scope="{row}">
              <div v-if="row.status==='NEW'">新订单</div>
              <div v-if="row.status==='CREATING'">部分下达</div>
              <div v-if="row.status==='CREATED'">全部下达</div>
              <div v-if="row.status==='CLOSED'">已关闭</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="wo"
            label="订单编号"
            sortable="custom"
            label="工单编号"
            prop="wo_code"
            show-tooltip-when-overflow
            min-width="150"
          />
            sortable="custom"
          >
            <!--            <template slot-scope="{row}">-->
            <!--              <div v-if="row.m_po">{{ row.m_po }}</div>-->
            <!--              <div v-else>{{ row.wo_code }}</div>-->
            <!--            </template>-->
          </el-table-column>
          <el-table-column
            prop="partcode"
            label="产品编码"
            sortable="custom"
            show-tooltip-when-overflow
            min-width="150"
          />
          <el-table-column
            prop="partname"
            label="产品名称"
            sortable="custom"
            show-tooltip-when-overflow
            min-width="150"
          />
          <el-table-column
            prop="partspec"
            label="产品规格"
            show-tooltip-when-overflow
            sortable="custom"
            min-width="110"
          >
@@ -990,20 +1022,30 @@
            </template>
          </el-table-column>
          <el-table-column
            prop="qty"
            label="订单数量"
            prop="plan_qty"
            label="任务数量"
            width="150"
            show-tooltip-when-overflow
            sortable="custom"
          />
          <el-table-column
            prop="relse_qty"
            label="已下单数量"
            prop="bad_qty"
            label="报废数量"
            width="150"
            show-tooltip-when-overflow
            sortable="custom"
          />
          <!--          <el-table-column-->
          <!--            prop="relse_qty"-->
          <!--            show-tooltip-when-overflow-->
          <!--            label="已下单数量"-->
          <!--            width="150"-->
          <!--            sortable="custom"-->
          <!--          />-->
          <el-table-column
            prop="wkshp_name"
            label="生产车间"
            show-tooltip-when-overflow
            sortable="custom"
            width="150"
          >
@@ -1013,46 +1055,50 @@
            </template>
          </el-table-column>
          <el-table-column
            prop="planstartdate"
            prop="plan_startdate"
            label="预计开工时间"
            show-tooltip-when-overflow
            sortable="custom"
            width="130"
          >
            <template slot-scope="{row}">
              <div v-if="row.planstartdate">{{ row.planstartdate.substring(0, 11) }}</div>
              <div v-if="row.plan_startdate">{{ row.plan_startdate.substring(0, 11) }}</div>
              <div v-else>/</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="planenddate"
            prop="plan_enddate"
            label="预计完工时间"
            show-tooltip-when-overflow
            sortable="custom"
            width="130"
          >
            <template slot-scope="{row}">
              <div v-if="row.planenddate">{{ row.planenddate.substring(0, 11) }}</div>
              <div v-if="row.plan_enddate">{{ row.plan_enddate.substring(0, 11) }}</div>
              <div v-else>/</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="createuser"
            prop="lm_user"
            label="创建人员"
            show-tooltip-when-overflow
            sortable="custom"
            width="150"
          >
            <template slot-scope="{row}">
              <div v-if="row.createuser">{{ row.createuser }}</div>
              <div v-if="row.lm_user">{{ row.lm_user }}</div>
              <div v-else>/</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="createdate"
            prop="lm_date"
            label="创建时间"
            show-tooltip-when-overflow
            width="130"
            sortable="custom"
          >
            <template slot-scope="{row}">
              <div v-if="row.createdate">{{ row.createdate.substring(0, 11) }}</div>
              <div v-if="row.lm_date">{{ row.lm_date.substring(0, 11) }}</div>
              <div v-else>/</div>
            </template>
          </el-table-column>
@@ -1064,7 +1110,7 @@
          <!--            <template slot-scope="{row}">-->
          <!--              <div class="operationClass">-->
          <!--                <el-tooltip class="item" effect="dark" content="下达" placement="top">-->
          <!--                  &lt;!&ndash;                <el-button type="text" @click="edit('edit',row)">下达</el-button>&ndash;&gt;-->
          <!--                  &lt;!&ndash;                <el-button  type="text" @click="edit('edit',row)">下达</el-button>&ndash;&gt;-->
          <!--                  <i-->
          <!--                    class="el-icon-bottom"-->
          <!--                    style="color:#42b983;cursor: pointer;margin-left: 5px"-->
@@ -1084,7 +1130,7 @@
        align="right"
        layout="total,prev, pager, next,sizes"
        popper-class="select_bottom"
        @pagination="getErpOrderSearch"
        @pagination="getMesBadOrderSearch"
      />
      <span slot="footer" class="dialog-footer">
        <div class="footerButton">
@@ -1578,7 +1624,7 @@
  ClosedMesOrder,
  DeleteMesOrder, ErpOrderSearch,
  MesOrderSearch, PartSelectRoute, RouteSelectWkshop, SearchWorkStep, SelectRouteOrWkshop,
  SelectRouteStep
  SelectRouteStep, MesBadOrderSearch
} from '@/api/scgl'
import { InventoryFileAssociationRoute, PartSelect, SaveInventoryFile } from '@/api/zzmx'
import { handleDatetime, handleDatetime2, validateCode } from '@/utils/global'
@@ -1768,17 +1814,18 @@
      dialogVisibleSource: false,
      sourceTableData: [],
      sourceForm: {
        erporderstus: '', // 订单状态码
        erpordercode: '', // 订单编号
        mesordercode: '', // 订单状态码
        sourceorder: '', // 工单编号
        partcode: '', // 产品编码
        partname: '', // 产品名称
        partspec: '', // 产品规格
        creatuser: '', // 创建人员
        // paystartdate: '', // 交付时间
        paystartdate: '', // 预计开工时间
        payenddate: '', // 预计完工时间
        // paystartdate: '', // 预计开工时间
        // payenddate: '', // 预计完工时间
        createdate: '', // 创建时间
        prop: 'createdate', // 排序字段
        prop: 'lm_date', // 排序字段
        order: 'desc', // 排序字段
        page: 1, // 第几页
        rows: 20 // 每页多少条
@@ -1908,7 +1955,7 @@
      }
      this.sourceForm.order = order
      this.sourceForm.prop = prop
      this.getErpOrderSearch()
      this.getMesBadOrderSearch()
    },
    // 查询
    search() {
@@ -2387,30 +2434,31 @@
        return this.$message.info('工单类型为报废补单情况下可选择!')
      }
      this.getErpOrderSearch()
      this.getMesBadOrderSearch()
      this.dialogVisibleSource = true
    },
    async getErpOrderSearch() {
      let tempDate2 = this.sourceForm.paystartdate
      if (tempDate2.length > 0) {
        tempDate2 = handleDatetime(tempDate2[0]) + '~' + handleDatetime(tempDate2[1])
      }
    async getMesBadOrderSearch() {
      // let tempDate2 = this.sourceForm.paystartdate
      // if (tempDate2.length > 0) {
      //   tempDate2 = handleDatetime(tempDate2[0]) + '~' + handleDatetime(tempDate2[1])
      // }
      let tempDate = this.sourceForm.payenddate
      let tempDate = this.sourceForm.createdate
      if (tempDate.length > 0) {
        tempDate = handleDatetime(tempDate[0]) + '~' + handleDatetime(tempDate[1])
      }
      const data = {
        erporderstus: this.sourceForm.erporderstus, // 订单状态码
        erpordercode: this.sourceForm.erpordercode, // 订单编号
        mesordercode: this.sourceForm.mesordercode, // 订单状态码
        sourceorder: this.sourceForm.sourceorder, // 工单编号
        partcode: this.sourceForm.partcode, // 产品编码
        partname: this.sourceForm.partname, // 产品名称
        partspec: this.sourceForm.partspec, // 产品规格
        paystartdate: tempDate2, // 交付时间
        payenddate: tempDate, // 交付时间
        // paystartdate: tempDate2, // 交付时间
        // payenddate: tempDate, // 交付时间
        creatuser: this.sourceForm.creatuser, // 创建人员
        createdate: tempDate, // 创建时间
        prop: this.sourceForm.prop, // 排序字段
        order: this.sourceForm.order, // 排序字段
@@ -2419,16 +2467,17 @@
      }
      const res = await ErpOrderSearch(data)
      this.sourceTableData = res.data.filter(item => item.status !== 'NEW')
      const res = await MesBadOrderSearch(data)
      this.sourceTableData = res.data
      this.sourceFormTotal = res.count
    },
    // 单选框选中获取当前行信息
    getCurrentRowSource(id) {
      this.radioSelectedId = id
    getCurrentRowSource(row, event, column) {
      this.radioSelectedId = row.id
      this.dialogForm.mesqty = row.bad_qty
    },
    sourceSearch() {
      this.getErpOrderSearch()
      this.getMesBadOrderSearch()
    },
    sourceReset() {
      this.sourceForm.erporderstus = ''
@@ -2440,7 +2489,7 @@
      this.sourceForm.payenddate = ''
      this.sourceForm.creatuser = ''
      this.sourceForm.createdate = ''
      this.getErpOrderSearch()
      this.getMesBadOrderSearch()
    },
    dialogVisibleSourceClose() {
      this.radioSelectedId = ''
@@ -2465,7 +2514,7 @@
      console.log(this.radioSelectedId)
      this.sourceTableData.forEach(item => {
        if (item.id === this.radioSelectedId) {
          this.dialogForm.sourceorder = item.wo
          this.dialogForm.sourceorder = item.wo_code
          this.dialogForm.partcode = item.partcode
          this.dialogForm.partspec = item.partspec
        }