chenlu
2024-09-24 edc227277159601c5cb86829f1c5ce14cf7903a4
north-glass-erp/northglass-erp/src/views/pp/workOrder/SelectWorkOrder.vue
@@ -26,7 +26,6 @@
const getTableRow = (row, type) => {
  switch (type) {
    case 'edit' : {
      //alert('我接收到子组件传送的编辑信息')
      router.push({path: '/main/workOrder/addWorkOrder', query: {orderId: row.orderId}})
      break
    }
@@ -152,7 +151,7 @@
//点击查询
const getWorkOrder = (isButtonDisabled) => {
const getWorkOrder = () => {
  let startTime = orderInfo.workOrderDate[0]
  let endTime = orderInfo.workOrderDate[1]
@@ -247,8 +246,15 @@
    mode: 'row',
    showStatus: true
  },//表头参数
  checkboxConfig: {
    labelField: 'name',
    checkMethod: ({ row }) => {
      return optionVal.value === '1'
    }
  },
  columns: [
    {type: 'expand', fixed: "left", slots: {content: 'content'}, width: 50},
    {type: 'checkbox', fixed: "left", title: t('basicData.check'), width: 80},
    {title: t('basicData.operate'), width: 110, slots: {default: 'button_slot'}, fixed: "left"},
    {type: 'seq', fixed: "left", title: t('basicData.Number'), width: 50},
    {field: 'orderId', title: t('order.orderId'), filters: [{data: ''}], slots: {filter: 'num1_filter'}, width: 110},
@@ -272,9 +278,9 @@
  ],//表头按钮
  data: null,//表格数据
  toolbarConfig: {
    // buttons: [{
    //
    // }],
    buttons: [
      {'code': 'transferOrder', 'name': t('workOrder.transferOrder'),status: 'primary'}
    ],
    // import: false,
    // export: true,
    // print: true,
@@ -298,6 +304,23 @@
  }
})
const gridEvents = {
  async toolbarButtonClick({code}) {
    const $grid = xGrid.value
    if ($grid) {
      switch (code) {
        case 'transferOrder':  {
          const idList = []
           $grid.getCheckboxRecords().forEach(item => {
             idList.push(item.orderId)
          })
          router.push({path: '/main/workOrder/addWorkOrder', query: {orderId:idList.join(',')}})
          break
        }
      }
    }
  }
}
onMounted(() => {
  getFirst()
@@ -319,7 +342,12 @@
        />
          
        <el-select :default-first-option="true" ref="getSelect" style="width: 130px" v-model="optionVal" class="m-2"
        <el-select
            :default-first-option="true"
            ref="getSelect" style="width: 130px"
            v-model="optionVal"
            class="m-2"
            @change="getWorkOrder"
                   >
          <el-option
              v-for="item in options"
@@ -330,7 +358,7 @@
        </el-select>
        &nbsp;&nbsp;
        <el-button
            @click="getWorkOrder(isButtonDisabled)"
            @click="getWorkOrder"
            :disabled="isButtonDisabled"
            id="select"
            type="primary" :icon="Search">{{$t('basicData.search')}}
@@ -344,6 +372,7 @@
        class="mytable-scrollbar"
        ref="xGrid"
        v-bind="gridOptions"
        v-on="gridEvents"
    >
      <!--      @toolbar-button-click="toolbarButtonClickEvent"-->
@@ -362,14 +391,14 @@
      <!--左边固定显示的插槽-->
      <template #button_slot="{ row }">
<!--        <el-button :class="{disable: optionVal== 0}" :disabled="optionVal == 0" @click="getTableRow(row,'edit')" link type="primary" size="small">{{$t('workOrder.transferOrder')}}</el-button>-->
        <el-button :class="{disable: optionVal== 0}" :disabled="optionVal == 0"
                   @click="getTableRow(row,'edit')"
                   v-if="userStore.user.permissions.indexOf('SelectWorkOrder.edit') > -1"
                   link
                   type="primary"
                   size="small">
          {{$t('workOrder.transferOrder')}}
        </el-button>
<!--        <el-button :class="{disable: optionVal== 0}" :disabled="optionVal == 0"-->
<!--                   @click="getTableRow(row,'edit')"-->
<!--                   v-if="userStore.user.permissions.indexOf('SelectWorkOrder.edit') > -1"-->
<!--                   link-->
<!--                   type="primary"-->
<!--                   size="small">-->
<!--          {{$t('workOrder.transferOrder')}}-->
<!--        </el-button>-->
        <!--        <el-button :class="{disable: optionVal== 1}" :disabled="optionVal == 1" @click="getTableRow(row,'delete')" link type="primary" size="small">{{$t('basicData.delete')}}</el-button>-->
        <el-popconfirm   @confirm="getTableRow(row,'delete')" :title="$t('searchOrder.deleteConfirm')">