loulijun2021
2022-07-07 f791db88d83a7ed851b9412d9797ed16b345fe79
src/views/scgl/scdd.vue
@@ -39,30 +39,81 @@
              <el-input v-model="form.partspec" style="width: 200px" placeholder="请输入" />
            </el-form-item>
            <el-form-item label="交付时间" style=" display: flex;">
              <!--              <el-date-picker-->
              <!--                v-model="form.paydate"-->
              <!--                type="date"-->
              <!--                value-format="yyyy-MM-dd HH:mm:ss"-->
              <!--                style="width: 200px"-->
              <!--                placeholder="选择日期"-->
              <!--              />-->
              <el-date-picker
                v-model="form.paydate"
                type="date"
                value-format="yyyy-MM-dd HH:mm:ss"
                style="width: 200px"
                placeholder="选择日期"
                type="daterange"
                range-separator="~"
                size="mini"
                start-placeholder="开始日期"
                end-placeholder="结束日期"
              />
              <!--              :picker-options="expireTimeOption"-->
            </el-form-item>
            <el-form-item label="创建人员" style=" display: flex;">
              <el-input v-model="form.creatuser" style="width: 200px" placeholder="请输入" />
            </el-form-item>
            <el-form-item label="创建时间" style=" display: flex;">
              <!--              <el-date-picker-->
              <!--                v-model="form.createdate"-->
              <!--                type="date"-->
              <!--                value-format="yyyy-MM-dd HH:mm:ss"-->
              <!--                style="width: 200px"-->
              <!--                placeholder="选择日期"-->
              <!--              />-->
              <el-date-picker
                v-model="form.createdate"
                type="date"
                value-format="yyyy-MM-dd HH:mm:ss"
                style="width: 200px"
                placeholder="选择日期"
                type="daterange"
                range-separator="~"
                start-placeholder="开始日期"
                end-placeholder="结束日期"
                size="mini"
              />
              <!--              :picker-options="expireTimeOption"-->
            </el-form-item>
          </div>
          <div style="display: flex;align-items: start;margin-top: 5px;z-index: 2">
            <el-button type="primary" icon="el-icon-search" @click="search">查询</el-button>
            <el-button type="info" icon="el-icon-refresh" @click="reset">重置</el-button>
          <div style="min-height: 100px">
            <div style="display: flex;align-items: start;margin-top: 5px;z-index: 2;justify-content: end">
              <el-button type="primary" icon="el-icon-search" @click="search">查询</el-button>
              <el-button type="info" icon="el-icon-refresh" @click="reset">重置</el-button>
            </div>
            <!--                      <div v-if="!isFullscreen" style="display: flex;align-items: start; margin-top: 15px;z-index: 2">-->
            <!--                        <el-button-->
            <!--                          type="primary"-->
            <!--                          icon="el-icon-refresh-right"-->
            <!--                          @click="reset('update')"-->
            <!--                        >同步ERP-->
            <!--                        </el-button>-->
            <!--                        <el-button-->
            <!--                          type="primary"-->
            <!--                          icon="el-icon-switch-button"-->
            <!--                          @click="orderClose"-->
            <!--                        >关闭订单-->
            <!--                        </el-button>-->
            <!--                      </div>-->
            <!--                      <div v-if="isFullscreen" style="display: flex;flex-direction: column;align-items: end">-->
            <!--                        <el-button-->
            <!--                          type="primary"-->
            <!--                          icon="el-icon-refresh-right"-->
            <!--                          style="margin: 10px 0"-->
            <!--                          @click="reset('update')"-->
            <!--                        >同步ERP-->
            <!--                        </el-button>-->
            <!--                        <el-button-->
            <!--                          type="primary"-->
            <!--                          icon="el-icon-switch-button"-->
            <!--                          @click="orderClose"-->
            <!--                        >关闭订单-->
            <!--                        </el-button>-->
            <!--                      </div>-->
          </div>
        </el-form>
      </div>
@@ -134,16 +185,19 @@
            prop="wo"
            label="订单编号"
            sortable="custom"
            width="150"
          />
          <el-table-column
            prop="partcode"
            label="产品编码"
            sortable="custom"
            width="150"
          />
          <el-table-column
            prop="partname"
            label="产品名称"
            sortable="custom"
            width="150"
          />
          <el-table-column
            prop="partspec"
@@ -154,12 +208,14 @@
          <el-table-column
            prop="qty"
            label="订单数量"
            width="150"
            sortable="custom"
          />
          <el-table-column
            prop="wkshp_name"
            label="生产车间"
            sortable="custom"
            width="150"
          />
          <el-table-column
            prop="paydate"
@@ -171,6 +227,7 @@
            prop="createuser"
            label="创建人员"
            sortable="custom"
            width="150"
          />
          <el-table-column
            prop="createdate"
@@ -180,6 +237,7 @@
          />
          <el-table-column
            label="操作"
            fixed="right"
          >
            <template slot-scope="{row}">
              <div class="operationClass">
@@ -205,29 +263,29 @@
    <el-dialog
      :title="operation==='add'?'新增':'下达'"
      :visible.sync="dialogVisible"
      width="60%"
      width="800px"
      top="15vh"
      :close-on-click-modal="false"
      @closed="handleClose"
      @close="handleClose"
    >
      <el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="80px">
        <el-form-item label="订单状态" prop="erporderstus">
          <el-select
            v-model="dialogForm.erporderstus"
            disabled
            :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="订单状态" prop="erporderstus">-->
        <!--          <el-select-->
        <!--            v-model="dialogForm.erporderstus"-->
        <!--            disabled-->
        <!--            :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="订单编号" prop="erpordercode">
          <el-input v-model="dialogForm.erpordercode" disabled style="width: 200px" />
        </el-form-item>
@@ -237,9 +295,7 @@
        <el-form-item label="产品名称" prop="partname">
          <el-input v-model="dialogForm.partname" disabled style="width: 200px" />
        </el-form-item>
        <el-form-item label="订单数量" prop="erpqty">
          <el-input v-model="dialogForm.erpqty" disabled style="width: 200px" />
        </el-form-item>
        <el-form-item label="产品规格" prop="partspec">
          <el-input v-model="dialogForm.partspec" disabled style="width: 200px" />
        </el-form-item>
@@ -248,6 +304,17 @@
        </el-form-item>
        <el-form-item label="所属仓库" prop="warehousename">
          <el-input v-model="dialogForm.warehousename" disabled style="width: 200px" />
        </el-form-item>
        <el-form-item label="订单数量" prop="erpqty">
          <el-input v-model="dialogForm.erpqty" disabled style="width: 200px" />
        </el-form-item>
        <el-form-item label="已下单数" prop="relse_qty">
          <el-input
            v-model="dialogForm.relse_qty"
            disabled
            oninput="value=value.replace(/[^0-9.]/g,'')"
            style="width: 200px"
          />
        </el-form-item>
        <el-form-item label="下单数量" prop="markqty">
          <el-input
@@ -263,14 +330,7 @@
            style="width: 200px"
          />
        </el-form-item>
        <el-form-item label="已下单数" prop="relse_qty">
          <el-input
            v-model="dialogForm.relse_qty"
            disabled
            oninput="value=value.replace(/[^0-9.]/g,'')"
            style="width: 200px"
          />
        </el-form-item>
        <!--        <el-form-item label="交付时间" prop="">-->
        <!--          <el-date-picker-->
        <!--            v-model="dialogForm.markqty"-->
@@ -295,7 +355,7 @@
<script>
import Pagination from '@/components/Pagination'
import { ClosedErpOrder, ErpOrderSearch, MarkSaveErpOrder } from '@/api/scgl'
import { handleDatatime } from '@/utils/global'
import { handleDatatime, handleDatetime } from '@/utils/global'
const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
@@ -316,6 +376,7 @@
      }
    }
    return {
      isFullscreen: false,
      mainHeight: 0,
      tableHeight: 0,
      form: {
@@ -327,7 +388,7 @@
        paydate: '', // 交付时间
        creatuser: '', // 创建人员
        createdate: '', // 创建时间
        prop: 'partcode', // 排序字段
        prop: 'createdate', // 排序字段
        order: 'desc', // 排序字段
        page: 1, // 第几页
        rows: 20 // 每页多少条
@@ -376,6 +437,11 @@
        ]
      }
      // expireTimeOption: {
      //   disabledDate(time) {
      //     return time.getTime() > Date.now() - 8.64e6 // 如果没有后面的-8.64e6就是不可以选择今天的
      //   }
      // }
    }
  },
@@ -389,7 +455,34 @@
  },
  methods: {
    async getErpOrderSearch() {
      const res = await ErpOrderSearch(this.form)
      console.log(this.form, 1)
      let tempDate2 = this.form.paydate
      if (tempDate2.length > 0) {
        tempDate2 = handleDatetime(tempDate2[0]) + '~' + handleDatetime(tempDate2[1])
      }
      let tempDate = this.form.createdate
      if (tempDate.length > 0) {
        tempDate = handleDatetime(tempDate[0]) + '~' + handleDatetime(tempDate[1])
      }
      const data = {
        erporderstus: this.form.erporderstus, // 订单状态码
        erpordercode: this.form.erpordercode, // 订单编号
        partcode: this.form.partcode, // 产品编码
        partname: this.form.partname, // 产品名称
        partspec: this.form.partspec, // 产品规格
        paydate: tempDate2, // 交付时间
        creatuser: this.form.creatuser, // 创建人员
        createdate: tempDate, // 创建时间
        prop: this.form.prop, // 排序字段
        order: this.form.order, // 排序字段
        page: this.form.page, // 第几页
        rows: this.form.rows // 每页多少条
      }
      const res = await ErpOrderSearch(data)
      this.tableData = res.data
      this.total = res.count
    },
@@ -430,11 +523,11 @@
      this.radioSelected = wo
    },
    // 订单关闭
    async  orderClose() {
    async orderClose() {
      if (this.radioSelected.length < 1) {
        return this.$message.info('请先选择订单!')
      }
      this.tableData.find(item => {
      this.tableData.forEach(item => {
        if (item.wo === this.radioSelected) {
          if (item.status !== 'NEW') {
            return this.$message.info('此订单非新订单,无法关闭!')
@@ -519,7 +612,7 @@
      this.$refs.dialogForm.validate(valid => {
        if (valid) {
          const data = {
            'erporderstus': this.dialogForm.erporderstus,
            // 'erporderstus': this.dialogForm.erporderstus,
            'erpordercode': this.dialogForm.erpordercode,
            'partcode': this.dialogForm.partcode,
            'wkshopcode': this.dialogForm.wkshopcode,
@@ -547,6 +640,10 @@
      this.$nextTick(() => {
        this.mainHeight = window.innerHeight - 250
        this.tableHeight = this.mainHeight - 100
        this.isFullscreen = window.innerHeight < 800
        if (this.isFullscreen) {
          this.tableHeight = this.tableHeight - 50
        }
      })
    }
  }
@@ -717,8 +814,8 @@
  border-color: $main_color;
}
.elTableDiv{
  ::v-deep .el-radio__label{
.elTableDiv {
  ::v-deep .el-radio__label {
    display: none;
  }
}