廖井涛
2024-06-14 fb8ec3f6a555f8ca1d02b305b08088d07dd5e709
north-glass-erp/northglass-erp/src/views/pp/processCard/ProductionScheduling.vue
@@ -29,16 +29,12 @@
      break
    }
    case  'setType': {
      alert('我接收到子组件传送的排版状态')
      break
    }
  }
}
//工序
const value = ref('切割')
const processVal = ref('切割')
//排产状态
@@ -54,10 +50,6 @@
  },
]
function padLeftZero(str) {
  return ('00' + str).substr(str.length)
}
//定义表单值
const form = reactive({
  date1: '',
@@ -70,25 +62,6 @@
})
//表尾求和
const sumNum = (list, field) => {
  let count = 0
  list.forEach(item => {
    count += Number(item[field])
  })
  return count.toFixed(2)
}
//定义滚动条高度
let scrollTop = ref(null)
let scrollHeight = ref(null)
let clientHeight = ref(null)
const scrollEvnt = (row) => {
  // 内容高度
  scrollTop.value = row.$event.target.scrollTop
  scrollHeight.value = row.$event.target.scrollHeight
  clientHeight.value = row.$event.target.clientHeight
}
//筛选条件,有外键需要先定义明细里面的数据
let filterData = ref({
  order: {
@@ -137,7 +110,7 @@
form.date1 = getNowTime()
let startTime = form.date1[0]
let endTime = form.date1[1]
let selectProcesses = value.value
let selectProcesses = processVal.value
let inputVal = form.orderId
if (inputVal == '') {
  inputVal = null
@@ -166,7 +139,7 @@
const getWorkOrder = () => {
  let startTime = form.date1[0]
  let endTime = form.date1[1]
  let selectProcesses = value.value
  let selectProcesses = processVal.value
  let selectState = stateValue.value
  let inputVal = form.orderId
  if (inputVal == '') {
@@ -175,24 +148,6 @@
  if (selectProcesses == '') {
    selectProcesses = null
  }
  // if (inputVal == null && selectState == 1) {
  //   //根据时间查询未排产数据
  //   request.post(`/productionScheduling/selectLastScheduling/${startTime}/${endTime}/${selectProcesses}/${inputVal}`, filterData.value).then((res) => {
  //
  //     if (res.code == 200) {
  //       pageTotal.value = res.data.total
  //       xGrid.value.loadData(res.data.data)
  //       gridOptions.loading = false
  //       //禁用删除、审核按钮
  //       gridOptions.toolbarConfig.buttons[0].disabled = true
  //       gridOptions.toolbarConfig.buttons[1].disabled = true
  //       //启用保存
  //       gridOptions.toolbarConfig.buttons[2].disabled = false
  //     } else {
  //       ElMessage.warning(res.msg)
  //     }
  //   })
  // } else if (inputVal != null && selectState == 1) {
  //根据工序查询未排产数据
  request.post(`/productionScheduling/selectScheduling/${pageNum.value}/${total.pageSize}/${startTime}/${endTime}/${inputVal}/${selectProcesses}/${selectState}`, filterData.value).then((res) => {
    if (res.code == 200) {
@@ -202,48 +157,24 @@
      xGrid.value.loadData(res.data.data)
      console.log(res.data.data)
      gridOptions.loading = false
      if (selectState==1){
      //禁用删除、审核按钮
      gridOptions.toolbarConfig.buttons[0].disabled = true
      gridOptions.toolbarConfig.buttons[1].disabled = true
      //启用保存
      gridOptions.toolbarConfig.buttons[2].disabled = false
    } else {
        //禁用删除、审核按钮
        gridOptions.toolbarConfig.buttons[0].disabled = false
        gridOptions.toolbarConfig.buttons[1].disabled = false
        //启用保存
        gridOptions.toolbarConfig.buttons[2].disabled = false
      }
    } else {
      ElMessage.warning(res.msg)
    }
  })
  // } else if (inputVal == null && selectState == 2) {
  //   //根据时间查询已排产数据
  //   request.post(`/productionScheduling/selectScheduling/${startTime}/${endTime}/${inputVal}/${selectProcesses}/${selectState}`, filterData.value).then((res) => {
  //     if (res.code == 200) {
  //       pageTotal.value = res.data.total
  //       xGrid.value.loadData(res.data.data)
  //       gridOptions.loading = false
  //       //启用删除、审核按钮
  //       gridOptions.toolbarConfig.buttons[0].disabled = false
  //       gridOptions.toolbarConfig.buttons[1].disabled = false
  //       //禁用保存
  //       gridOptions.toolbarConfig.buttons[2].disabled = true
  //     } else {
  //       ElMessage.warning(res.msg)
  //     }
  //   })
  // } else if (inputVal != null && selectState == 2) {
  //   //根据订单号查询已排产数据
  //   request.post(`/productionScheduling/selectSchedulingNot/${startTime}/${endTime}/${inputVal}/${selectProcesses}/${selectState}`, filterData.value).then((res) => {
  //     if (res.code == 200) {
  //       pageTotal.value = res.data.total
  //       xGrid.value.loadData(res.data.data)
  //       gridOptions.loading = false
  //       //启用删除、审核按钮
  //       gridOptions.toolbarConfig.buttons[0].disabled = false
  //       gridOptions.toolbarConfig.buttons[1].disabled = false
  //       //禁用保存
  //       gridOptions.toolbarConfig.buttons[2].disabled = true
  //     } else {
  //       ElMessage.warning(res.msg)
  //     }
  //   })
  // }
}
@@ -272,7 +203,7 @@
//获取选中时间
  let startTime = form.date1[0]
  let endTime = form.date1[1]
  let selectProcesses = value.value
  let selectProcesses = processVal.value
  let selectState = stateValue.value
  let inputVal = form.orderId
  if (inputVal == '') {
@@ -281,7 +212,6 @@
  if (selectProcesses == '') {
    selectProcesses = null
  }
  request.post(`/productionScheduling/selectScheduling/1/${total.pageSize}/${startTime}/${endTime}/${inputVal}/${selectProcesses}/${selectState}`, filterData.value).then((res) => {
    if (res.code == 200) {
      total.dataTotal = res.data.total.total * 1
@@ -289,11 +219,6 @@
      pageNum.value = 1
      xGrid.value.loadData(res.data.data)
      gridOptions.loading = false
      //禁用删除、审核按钮
      gridOptions.toolbarConfig.buttons[0].disabled = true
      gridOptions.toolbarConfig.buttons[1].disabled = true
      //启用保存
      gridOptions.toolbarConfig.buttons[2].disabled = false
    } else {
      ElMessage.warning(res.msg)
    }
@@ -315,7 +240,7 @@
  keepSource: true,//保持源数据
  align: 'center',//文字居中
  stripe: true,//斑马纹
  rowConfig: {isCurrent: true, isHover: true, height: 30},//鼠标移动或选择高亮
  rowConfig: {isCurrent: true, isHover: true, height: 50},//鼠标移动或选择高亮
  id: 'CustomerList',
  showFooter: true,//显示脚
  printConfig: {},
@@ -333,7 +258,6 @@
  customConfig: {
    storage: true
  },
  editConfig: {
    trigger: 'click',
    mode: 'row',
@@ -371,17 +295,17 @@
  //表头参数
  columns: [
    {type: 'expand', fixed: "left", slots: {content: 'content'}, width: 50},
    {type: 'checkbox', fixed: "left", title: t('basicData.check'), width: 80},
    {type: 'seq', fixed: "left", title: t('basicData.Number'), width: 50},
    {type: 'checkbox', fixed: "left", title: t('basicData.check'), width: 80},
    {
      field: 'scheduled_start_time',
      width: 120,
      editRender: {name: 'input', attrs: {placeholder: '', type: 'date'}},
      field: 'scheduledStartTime',
      width: 130,
      editRender: {name: 'input', attrs: {placeholder: '', type: 'date'},},
      title: t('processCard.scheduledStartTime')
    },
    {
      field: 'plan_end_time',
      width: 120,
      field: 'planEndTime',
      width: 130,
      editRender: {name: 'input', attrs: {placeholder: '', type: 'date'}},
      title: t('processCard.planEndTime')
    },
@@ -391,7 +315,7 @@
      title: t('order.orderId'),
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      width: 100,
      width: 110,
    },
    {
      field: 'order.customerName',
@@ -412,14 +336,14 @@
      title: t('order.OrderNum'),
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      width: 70,
      width: 100,
    },
    {
      field: 'technologyNumber',
      title: t('processCard.technologyNumber'),
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      width: 70,
      width: 100,
    },
    {
      field: 'orderGlassDetail.childWidth',
@@ -431,7 +355,7 @@
      title: t('order.height'),
      width: 60,
    },
    {field: 'orderDetail.quantity', title: t('processCard.orderQuantity'), width: 70},
    {field: 'orderDetail.quantity', title: t('processCard.orderQuantity'), width: 90},
    {field: 'orderGlassDetail.area', title: t('processCard.orderArea'), width: 90},
    {
      field: 'schedulingQuantity',
@@ -440,13 +364,13 @@
      title: t('processCard.productionSchedulingQuantity'),
      sortable: true
    },
    {field: 'pendingProductionQuantity', title: t('processCard.quantityToScheduled'), width: 120},
    {field: 'pendingProductionArea', title: t('processCard.areaToScheduled'), width: 120},
    {field: 'productionScheduledQuantity', title: t('processCard.plannedProductionQuantity'), width: 120},
    {field: 'productionScheduledArea', title: t('processCard.plannedProductionArea'), width: 120},
    {field: 'reviewStatus', title: t('processCard.reviewedState'), width: 140},
    {field: 'reviewer', title: t('processCard.reviewed'), width: 140},
    {field: 'orderGlassDetail.glassChild', title: t('order.product'), width: 140},
    {field: 'pendingProductionQuantity', title: t('processCard.quantityToScheduled'), width: 100},
    {field: 'pendingProductionArea', title: t('processCard.areaToScheduled'), width: 100},
    {field: 'productionScheduledQuantity', title: t('processCard.plannedProductionQuantity'), width: 100},
    {field: 'productionScheduledArea', title: t('processCard.plannedProductionArea'), width: 100},
    {field: 'reviewStatus', title: t('processCard.reviewedState'), width: 80},
    {field: 'reviewer', title: t('processCard.reviewed'), width: 80},
    {field: 'orderDetail.productName', title: t('order.product'), width: 140},
    {field: 'orderDetail.shape', title: t('order.shape'), width: 80},
    {field: 'notes', title: t('processCard.notes'), editRender: {name: 'input', attrs: {placeholder: ''}}, width: 120},
    {field: 'schedulingId', title: t('processCard.schedulingId'), width: 120},
@@ -500,16 +424,16 @@
              return;
            }
            for (let i = 0; i < selectRecords.length; i++) {
              let start = selectRecords[i].scheduled_start_time
              let end = selectRecords[i].plan_end_time
              let number = selectRecords[i].scheduling_quantity
              let start = selectRecords[i].scheduledStartTime
              let end = selectRecords[i].planEndTime
              let number = selectRecords[i].schedulingQuantity
              //计划开始、结束时间,排产数量不能为空
              if (start == null || end == null || number == null) {
                ElMessage.warning(t('processCard.saveCorrespondingValues'))
                return;
              }
            }
            let selectProcesses = value.value
            let selectProcesses = processVal.value
            if (selectProcesses == null || selectProcesses == "") {
              ElMessage.warning(t('processCard.selectProductionSchedulingProcess'))
              return;
@@ -606,7 +530,7 @@
      switch (menu.code) {
        case 'copyChecked' : {
          let result = toolbarButtonClickEvent()
          if (result.cell === "scheduled_start_time" || result.cell === "plan_end_time") {
          if (result.cell === "scheduledStartTime" || result.cell === "planEndTime" || result.cell === "schedulingQuantity"){
            if (result) {
              const dataList = xGrid.value.getTableData().visibleData
              const val = dataList[result.start][result.cell]
@@ -622,7 +546,7 @@
        }
        case 'copyAll' : {
          let result = toolbarButtonClickEvent()
          if (result.cell === "scheduled_start_time" || result.cell === "plan_end_time") {
          if (result.cell === "scheduledStartTime" || result.cell === "planEndTime"|| result.cell === "schedulingQuantity") {
            if (result) {
              const dataList = xGrid.value.getTableData().visibleData
              const val = dataList[result.start][result.cell]
@@ -637,7 +561,7 @@
        }
        case 'clearChecked' : {
          let result = toolbarButtonClickEvent()
          if (result.cell === "scheduled_start_time" || result.cell === "plan_end_time") {
          if (result.cell === "scheduledStartTime" || result.cell === "planEndTime"|| result.cell === "schedulingQuantity") {
            if (result) {
              const dataList = xGrid.value.getTableData().visibleData
              dataList.forEach((item, index) => {
@@ -690,7 +614,7 @@
        &nbsp;&nbsp;
        <el-input v-model="form.orderId" :placeholder="$t('order.orderId')" clearable style="width: 110px"></el-input>
        &nbsp;
        <el-select v-model="value" clearable default-value="default_city" style="width: 120px">
        <el-select v-model="processVal" clearable default-value="default_city" style="width: 120px">
          <el-option
              v-for="item in titleSelectJson['processType']"
              :key="item.id"
@@ -761,11 +685,7 @@
    </vxe-grid>
  </div>
  <div ref="cellArea" class="vxe-table--cell-area">
    <span class="vxe-table--cell-main-area"></span>
    <span class="vxe-table--cell-active-area"></span>
  </div>
</template>
<style scoped>