loulijun2021
2024-05-11 6613785ce4eb0823cd5442ed0bb0987b0eae2069
src/views/workOrder/produceOrderList.vue
@@ -81,6 +81,14 @@
              <el-input v-model="form.partspec" style="width: 200px" placeholder="请输入" />
            </el-form-item>
            <DateType
              ref="DateTypeRef"
              :is-expand-form="isExpandForm"
              style="display:flex;justify-content: center;align-items: center;position: relative"
              @DateTypeChange="DateTypeChange"
              @cycleTimeChange="cycleTimeChange"
            />
            <!--            <el-form-item-->
            <!--              v-show="isExpandForm"-->
            <!--              label="预计开工时间"-->
@@ -89,7 +97,7 @@
            <!--            >-->
            <!--              <el-date-picker-->
            <!--                v-model="form.paystartdate"-->
            <!--                type="daterange"-->
            <!--                type="datetimerange"-->
            <!--                range-separator="~"-->
            <!--                class="timeMini"-->
            <!--                size="mini"-->
@@ -97,8 +105,12 @@
            <!--                :clearable="false"-->
            <!--                start-placeholder="开始日期"-->
            <!--                end-placeholder="结束日期"-->
            <!--                :picker-options="pickerOptions"-->
            <!--                value-format="yyyy-MM-dd"-->
            <!--                @change="pickerChange"-->
            <!--              />-->
            <!--            </el-form-item>-->
            <!--            <el-form-item-->
            <!--              v-show="isExpandForm"-->
            <!--              label="预计完工时间"-->
@@ -310,6 +322,32 @@
          <!--            </template>-->
          <!--          </el-table-column>-->
          <el-table-column
            prop="planenddate"
            label="预计开工日期"
            sortable="custom"
            show-tooltip-when-overflow
            width="130"
          >
            <template slot-scope="{row}">
              <div v-if="row.planenddate">{{ row.planenddate.substring(0, 11) }}</div>
              <div v-else>/</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="planstartdate"
            label="预计完工日期"
            sortable="custom"
            show-tooltip-when-overflow
            width="130"
          >
            <template slot-scope="{row}">
              <div v-if="row.planstartdate">{{ row.planstartdate.substring(0, 11) }}</div>
              <div v-else>/</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="saleOrderDeliveryDate"
            label="预计交付日期"
            sortable="custom"
@@ -321,6 +359,7 @@
              <div v-else>/</div>
            </template>
          </el-table-column>
          <el-table-column
            show-tooltip-when-overflow
            prop="createuser"
@@ -502,12 +541,14 @@
} from '@/api/WorkOrder'
import { SeaveSearchErpOrder } from '@/api/ErpSyncMes'
import { PrentOrganizationNoCompany } from '@/api/GeneralBasicData'
import moment from 'moment'
import DateType from '@/components/DateType'
const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
  name: 'SCDD',
  components: {
    Pagination
    Pagination, DateType
  },
  directives: { elDragDialog, waves },
  data() {
@@ -524,7 +565,7 @@
    }
    return {
      mouseHoverType: 'mouseout',
      isExpandForm: false,
      isExpandForm: true,
      mainHeight: 0,
      tableHeight: 0,
      form: {
@@ -540,11 +581,16 @@
        paystartdate: '', // 预计开工时间
        payenddate: '', // 预计完工时间
        createdate: '', // 创建时间
        datatype: 'ED', // 时间类型
        timeValue: [], // 时间值
        prop: 'wo', // 排序字段
        order: 'desc', // 排序字段
        page: 1, // 第几页
        rows: 20 // 每页多少条
      },
      erporderstusArr: [
        { code: 'NEW', name: '新订单' },
        { code: 'CREATING', name: '部分下达' },
@@ -601,9 +647,49 @@
      },
      pickerOptions: {
        disabledDate(time) {
          return time.getTime() < Date.now() - 8.64e7
        }
        shortcuts: [
          {
            text: '当天',
            onClick(picker) {
              const end = new Date()
              const start = new Date()
              start.setTime(start.getTime())
              picker.$emit('pick', [start, end])
            }
          }, {
            text: '近三天',
            onClick(picker) {
              const end = new Date()
              const start = new Date()
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 3)
              console.log([start, end], '[start, end]')
              picker.$emit('pick', [start, end])
            }
          }, {
            text: '近一周',
            onClick(picker) {
              const end = new Date()
              const start = new Date()
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
              picker.$emit('pick', [start, end])
            }
          }, {
            text: '近一个月',
            onClick(picker) {
              const end = new Date()
              const start = new Date()
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
              picker.$emit('pick', [start, end])
            }
          }, {
            text: '近三个月',
            onClick(picker) {
              const end = new Date()
              const start = new Date()
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
              picker.$emit('pick', [start, end])
            }
          }]
      },
      multipleSelection: []
@@ -626,34 +712,53 @@
    this.getHeight()
  },
  methods: {
    DateTypeChange(value) {
      console.log('asd', value)
      this.form.datatype = value
    },
    cycleTimeChange(val) {
      this.form.timeValue = val
    },
    pickerChange(value) {
      console.log(value, 123)
      this.cycleTime = null
    },
    async getPrentOrganizationNoCompany() {
      const { data: res } = await PrentOrganizationNoCompany()
      this.wkshopcodeArr = res
    },
    async getErpOrderSearch() {
      console.log(this.form, 1)
      let tempDate2 = this.form.paystartdate
      if (tempDate2.length > 0) {
        tempDate2 = handleDatetime(tempDate2[0]) + '~' + handleDatetime(tempDate2[1])
      }
      let tempDate = this.form.payenddate
      if (tempDate.length > 0) {
        tempDate = handleDatetime(tempDate[0]) + '~' + handleDatetime(tempDate[1])
      }
      // let tempDate2 = this.form.paystartdate
      // if (tempDate2.length > 0) {
      //   tempDate2 = handleDatetime(tempDate2[0]) + '~' + handleDatetime(tempDate2[1])
      // }
      //
      // let tempDate = this.form.payenddate
      // if (tempDate.length > 0) {
      //   tempDate = handleDatetime(tempDate[0]) + '~' + handleDatetime(tempDate[1])
      // }
      const data = {
        wkshopcode: this.form.wkshopcode,
        erporderstus: this.form.erporderstus, // 订单状态码
        wkshopcode: this.form.wkshopcode, // 车间编码
        erpordercode: this.form.erpordercode, // 订单编号
        saleordercode: this.form.saleordercode, // 销售单号
        partcode: this.form.partcode, // 产品编码
        partname: this.form.partname, // 产品名称
        partspec: this.form.partspec, // 产品规格
        paystartdate: tempDate2, // 交付时间
        payenddate: tempDate, // 交付时间
        saleordercode: this.form.saleordercode,
        datatype: this.form.datatype, // 日期类型(计划开工(PS)、计划完工(PE)、预计交付(ED))
        searchdate: this.form.timeValue.join('~'), // 时间段
        // paystartdate: tempDate2, // 交付时间
        // payenddate: tempDate, // 交付时间
        creatuser: this.form.creatuser, // 创建人员
        // createdate: this.form.createdate.toString().length > 0 ? handleDatetime(this.form.createdate) : '', // 创建时间
        prop: this.form.prop, // 排序字段
        order: this.form.order, // 排序字段
@@ -725,6 +830,12 @@
      this.form.creatuser = ''
      this.form.erpordercode = ''
      this.form.createdate = ''
      this.form.timeValue = []
      this.cycleTime = null
      this.$refs.DateTypeRef.clearValue()
      this.getErpOrderSearch()
    },
    // 单选框选中获取当前行信息
@@ -1106,7 +1217,8 @@
    margin-top: -3px;
  }
}
::v-deep .el-icon-delete  {
::v-deep .el-icon-delete {
  cursor: pointer;
  margin-right: 0px !important;
}
@@ -1123,5 +1235,11 @@
.el-loading-text {
  font-size: 26px !important;
}
.el-picker-panel__footer {
  display: flex !important;
  justify-content: flex-end !important;
}
</style>