loulijun2021
2022-07-16 392f9468875a8721c17c4e15c288333017cac4a1
src/views/scgl/scdd.vue
@@ -13,6 +13,7 @@
            <el-form-item label="订单状态" style=" display: flex;">
              <el-select
                v-model="form.erporderstus"
                filterable
                :popper-append-to-body="false"
                style="width: 200px"
                placeholder="请选择"
@@ -56,25 +57,26 @@
              <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="daterange"-->
              <!--                :clearable="false"-->
              <!--                range-separator="~"-->
              <!--                start-placeholder="开始日期"-->
              <!--                end-placeholder="结束日期"-->
              <!--                size="mini"-->
              <!--              />-->
              <!--              :picker-options="expireTimeOption"-->
              <el-date-picker
                v-model="form.createdate"
                type="date"
                size="mini"
                type="daterange"
                :clearable="false"
                style="width: 200px;"
                format="yyyy-MM-dd"
                placeholder="选择日期"
                range-separator="~"
                start-placeholder="开始日期"
                style="width: 240px"
                end-placeholder="结束日期"
                size="mini"
              />
              <!--              :picker-options="expireTimeOption"-->
              <!--              <el-date-picker-->
              <!--                v-model="form.createdate"-->
              <!--                type="date"-->
              <!--                size="mini"-->
              <!--                :clearable="false"-->
              <!--                style="width: 200px;"-->
              <!--                format="yyyy-MM-dd"-->
              <!--                placeholder="选择日期"-->
              <!--              />-->
            </el-form-item>
          </div>
          <div style="min-height: 100px">
@@ -119,7 +121,7 @@
        <el-button
          type="primary"
          icon="el-icon-refresh-right"
          @click="reset('update')"
          @click="syncERP"
        >同步ERP
        </el-button>
        <el-button
@@ -128,14 +130,12 @@
          @click="orderClose"
        >关闭订单
        </el-button>
        <!--        <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">新增</el-button>-->
        <!--        <el-button type="primary" icon="el-icon-upload2" @click="upload">导入</el-button>-->
      </div>
      <el-divider />
      <div class="elTableDiv">
        <el-table
          :data="tableData"
          :height="tableHeight"
          :height="tableHeight+'px'"
          border
          stripe
          :style="{width: 100+'%',height:tableHeight+'px',}"
@@ -206,6 +206,12 @@
          <el-table-column
            prop="qty"
            label="订单数量"
            width="150"
            sortable="custom"
          />
          <el-table-column
            prop="relse_qty"
            label="已下单数量"
            width="150"
            sortable="custom"
          />
@@ -459,10 +465,10 @@
        tempDate2 = handleDatetime(tempDate2[0]) + '~' + handleDatetime(tempDate2[1])
      }
      // let tempDate = this.form.createdate
      // if (tempDate.length > 0) {
      //   tempDate = handleDatetime(tempDate[0]) + '~' + handleDatetime(tempDate[1])
      // }
      let tempDate = this.form.createdate
      if (tempDate.length > 0) {
        tempDate = handleDatetime(tempDate[0]) + '~' + handleDatetime(tempDate[1])
      }
      const data = {
        erporderstus: this.form.erporderstus, // 订单状态码
@@ -472,8 +478,8 @@
        partspec: this.form.partspec, // 产品规格
        paydate: tempDate2, // 交付时间
        creatuser: this.form.creatuser, // 创建人员
        createdate: this.form.createdate.toString().length > 0 ? handleDatetime(this.form.createdate) : '', // 创建时间
        // createdate: tempDate,
        // createdate: this.form.createdate.toString().length > 0 ? handleDatetime(this.form.createdate) : '', // 创建时间
        createdate: tempDate,
        prop: this.form.prop, // 排序字段
        order: this.form.order, // 排序字段
        page: this.form.page, // 第几页
@@ -498,12 +504,33 @@
      this.form.prop = prop
      this.getErpOrderSearch()
    },
    // 同步ERP
    async  syncERP() {
      const loading = this.$loading({
        lock: true,
        text: '正在同步ERP,请稍等...',
        spinner: 'el-icon-loading',
        customClass: 'osloading',
        background: 'rgba(0, 0, 0, 0.7)'
      })
      setTimeout(() => {
        loading.close()
      }, 2000)
      // const res = await xxx()
      // if (res.code==='200'){
      setTimeout(() => {
        loading.close()
        this.getErpOrderSearch()
      }, 2000)
      // }
    },
    // 查询
    search() {
      this.getErpOrderSearch()
    },
    // 重置
    reset(val) {
    reset() {
      this.form.erporderstus = ''
      this.form.erpordercode = ''
      this.form.partcode = ''
@@ -513,9 +540,6 @@
      this.form.creatuser = ''
      this.form.createdate = ''
      this.getErpOrderSearch()
      if (val.length > 0) {
        this.$message.success('ERP已同步!')
      }
    },
    // 单选框选中获取当前行信息
    getCurrentRow(wo) {
@@ -820,3 +844,8 @@
}
</style>
<style>
.osloading{
  font-size: 40px;
}
</style>