“linengliang”
2023-10-18 83830b509d3cce2dba0be3fdbc6f4db054b78d74
src/views/eam/EquipmentCalibrationOrder.vue
@@ -92,10 +92,10 @@
        :loading="loading"
        class="j-table-force-nowrap"
        @change="handleTableChange"
        :rowSelection="rowSelection"
        :customRow="clickThenSelect"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}"
      >
        <!-- :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" -->
        <span
          slot="action"
          slot-scope="text, record"
@@ -154,6 +154,14 @@
            v-if="record.status === '4'"
            type="vertical"
          />
          <a
            @click="handleFinal(record)"
          >录入结果</a>
           <!-- v-if="record.status === '5'" -->
           <a-divider
            type="vertical"
          />
          <a-dropdown>
            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
            <a-menu slot="overlay">
@@ -186,37 +194,20 @@
        </span>
      </a-table>
      <a-tabs
        type="card"
        defaultActiveKey="1"
      >
        <a-tab-pane
          key="1"
          forceRender
          tab="检验项"
        >
          <span slot="tab">
            <a-badge>精度参数&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a-badge>
          </span>
          <div
            class="table-operator"
            style="margin:10px"
          >
            <equipment-precision-parameters-list ref="PrecisionParametersList"></equipment-precision-parameters-list>
          </div>
            <equipment-precision-parameters-list ref="PrecisionParametersList" :calibrationOrderId="mainId"></equipment-precision-parameters-list>
        </a-tab-pane>
        <a-tab-pane
          key="2"
          forceRender
          tab="检定报告"
        >
          <span slot="tab">
            <a-badge>检定报告&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a-badge>
          </span>
          <div
            class="table-operator"
            style="margin:10px"
          >
            <equipment-calibration-order-report-list ref="EquipmentCalibrationOrderReportList"></equipment-calibration-order-report-list>
          </div>
            <equipment-calibration-order-report-list ref="EquipmentCalibrationOrderReportList"  :calibrationOrderId="mainId"></equipment-calibration-order-report-list>
        </a-tab-pane>
      </a-tabs>
@@ -231,44 +222,49 @@
      ref="EquipmentCalibrationOrderExeDrawer"
      @ok="modalFormOk"
    ></equipment-calibration-order-exe-drawer>
    <final-modal ref="finalModal"  @ok="modalFormOk"></final-modal>
  </a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import EquipmentCalibrationOrderModal from './modules/equipmentCalibrationOrder/EquipmentCalibrationOrderModal'
import EquipmentCalibrationOrderExeDrawer from './modules/equipmentCalibrationOrder/EquipmentCalibrationOrderExeDrawer'
import { getAction, postAction, requestPut } from '@/api/manage'
import EquipmentPrecisionParametersList from './modules/equipmentCalibrationOrder/EquipmentPrecisionParametersList'
import EquipmentCalibrationOrderReportList from './modules/equipmentCalibrationOrder/EquipmentCalibrationOrderReportList'
import FinalModal from './modules/equipmentCalibrationOrder/FinalModal.vue'
export default {
  name: 'EquipmentCalibrationOrder',
  mixins: [JeecgListMixin, mixinDevice],
  mixins: [JeecgListMixin],
  components: {
    EquipmentCalibrationOrderModal,
    EquipmentCalibrationOrderExeDrawer,
    EquipmentPrecisionParametersList,
    EquipmentCalibrationOrderReportList,
    FinalModal
  },
  data() {
    return {
      description: '设备检定工单',
      /* 分页参数 */
      ipagination: {
        current: 1,
        pageSize: 5,
        pageSizeOptions: ['5', '10', '50'],
        showTotal: (total, range) => {
          return range[0] + "-" + range[1] + " 共" + total + "条"
        },
        showQuickJumper: true,
        showSizeChanger: true,
        total: 0
      ipagination:{
          current: 1,
          pageSize: 5,
          pageSizeOptions: ['5', '10', '50'],
          showTotal: (total, range) => {
            return range[0] + "-" + range[1] + " 共" + total + "条"
          },
          showQuickJumper: true,
          showSizeChanger: true,
          total: 0
      },
      dictOptions:{
      },
      /* 分页参数 */
      // 表头
      columns: [
        {
@@ -326,7 +322,7 @@
        {
          title: '判定结果',
          align: "center",
          dataIndex: 'calibrationResult'
          dataIndex: 'calibrationOrderUda6_dictText'
        },
        {
          title: '创建人',
@@ -367,6 +363,7 @@
        delete: "/eam/calibrationOrder/delete",
        edit: "/eam/calibrationOrder/editStatus",
      },
      mainId:'',
    }
  },
@@ -374,41 +371,14 @@
    importExcelUrl: function () {
      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
    },
    rowSelection() {
      return {
        type: 'checkbox',
        onChange: (selectedRowKeys, selectedRows) => {
          this.selectedRowKeys = selectedRowKeys;
          this.onSelectChange(selectedRowKeys, selectedRows);
        },
        getCheckboxProps: record => ({
          props: {
            disabled: record.distable
          },
        }),
        selectedRowKeys: this.selectedRowKeys,
      };
    },
  },
  methods: {
    clickThenSelect(record) {
      return {
        on: {
          click: () => {
            this.onSelectChange(record.id.split(","), [record]);
          }
        }
      }
    },
    onSelectChange(selectedRowKeys, selectionRows) {
      if (selectedRowKeys.length == 1) {
        this.$refs.EquipmentCalibrationOrderReportList.calibrationOrderId = selectedRowKeys[0]
        this.$refs.PrecisionParametersList.calibrationOrderId = selectedRowKeys[0]
        this.mainId = selectedRowKeys[0];
      } else {
        this.$refs.PrecisionParametersList.calibrationOrderId = '-1'
        this.$refs.EquipmentCalibrationOrderReportList.calibrationOrderId = '-1'
        this.mainId = '-1';
      }
      this.selectedRowKeys = selectedRowKeys;
      this.selectionRows = selectionRows;
@@ -453,30 +423,23 @@
        }
      })
    },
    searchQuery() {
      this.$refs.PrecisionParametersList.calibrationOrderId = '-1'
      this.$refs.EquipmentCalibrationOrderReportList.calibrationOrderId = '-1'
      this.loadData(1);
    onClearSelected() {
        this.selectedRowKeys = [];
        this.selectionRows = [];
        this.mainId=''
    },
    searchReset() {
      this.queryParam = {};
      this.selectedRowKeys = []
      this.selectionRows = []
      this.$refs.PrecisionParametersList.calibrationOrderId = '-1'
      this.$refs.EquipmentCalibrationOrderReportList.calibrationOrderId = '-1'
      this.loadData(1);
    clickThenSelect(record) {
        return {
          on: {
            click: () => {
              this.onSelectChange(record.id.split(","), [record]);
            }
          }
        }
    },
    modalFormOk() {
      // 新增/修改 成功时,重载列表
      this.loadData()
      //清空列表选中
      this.onClearSelected()
      this.$refs.PrecisionParametersList.calibrationOrderId = '-1'
      this.$refs.EquipmentCalibrationOrderReportList.calibrationOrderId = '-1'
    },
    handleFinal(record){
      this.$refs.finalModal.edit(record);
    }
  }
}
</script>