lyh
2025-05-28 e14ed882d12df3b48e59390eba364442cdff70bd
src/views/tms/stocktakingBound/ToolsStocktaKingBoundDetail.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,224 @@
<template>
  <a-card :bordered="false">
    <div>
      <a-table ref="table" size="middle" bordered rowKey="id" :scroll="{ x: true }" :columns="columns"
        :dataSource="dataSource" :pagination="ipagination" :loading="loading" @change="handleTableChange">
        <span slot="num" slot-scope="text, record" class="fontweight">
          {{ record.num }}
        </span>
         </a-table>
      <template v-for="col in columns" :slot="col.dataIndex" slot-scope="text, record, index">
      </template>
    </div>
  </a-card>
</template>
<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { getAction } from '@/api/manage'
import Tooltip from 'ant-design-vue/es/tooltip'
export default {
  name: "ToolsStocktaKingBoundDetail",
  components: {
    Tooltip,
  },
  mixins: [JeecgListMixin],
  props: {
    mainId: {
      type: String,
      default: '',
      required: false
    }
  },
  watch: {
    mainId: {
      immediate: true,
      handler(val) {
        if (!this.mainId) {
          this.clearList()
        } else {
          this.queryParam['stocktakingBoundId'] = val;
          this.queryParam['delFlag'] = 0;
          this.loadData(1);
        }
      }
    }
  },
  data() {
    return {
      columns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          align: 'center',
          customRender: function(t, r, index) {
            return parseInt(index) + 1
          },
          width: 50
        },
        {
          title: '刀具编号',
          dataIndex: 'toolCode',
          align: 'center'
        },
        {
          title: '工具类型',
          dataIndex: 'applicationType_dictText',
          align: 'center',
        },
        {
          title: '中文名称',
          dataIndex: 'chineseName',
          align: 'center'
        },
        {
          title: '型号/图号',
          dataIndex: 'toolModel',
          align: 'center'
        },
        {
          title: '刀具材料',
          dataIndex: 'toolMaterial',
          align: 'center'
        },
        {
          title: '零件材料',
          dataIndex: 'partMaterial',
          align: 'center'
        },
        {
          title: '厂家',
          dataIndex: 'supplierId',
          align: 'center'
        },
        {
          title: '存储位置(库位号)',
          dataIndex: 'goodsShelvesId',
          align: 'center'
        },
        {
          title: '账面数量',
          dataIndex: 'bookQuantity',
          align: 'center'
        },
        {
          title: '可用数量',
          dataIndex: 'availableQuantity',
          align: 'center'
        },
        {
          title: '实盘数量',
          dataIndex: 'practicalQuantity',
          align: 'center'
        },
        {
          title: '差异值',
          dataIndex: 'differenceValue',
          align: 'center'
        },
        {
          title: '盘亏盘盈',
          dataIndex: 'surplusDeficit_dictText',
          align: 'center'
        },
        {
          title: '盘库时间',
          dataIndex: 'stocktakingDate',
          align: 'center'
        },
        {
          title: '备注',
          dataIndex: 'remark',
          align: 'center'
        }
      ],
      url: {
        list: "/tms/toolsStocktakingBound/listToolsStocktakingBoundControllerDetailsByMainId",
      },
      /* åˆ†é¡µå‚æ•° */
      ipagination: {
        current: 1,
        pageSize: 20,
        pageSizeOptions: ['5', '10', '20', '50'],
        showTotal: (total, range) => {
          return range[0] + '-' + range[1] + ' å…±' + total + '条'
        },
        showQuickJumper: true,
        showSizeChanger: true,
        total: 0
      },
    }
  },
  created() {
  },
  computed: {
  },
  methods: {
    clearList() {
      this.dataSource = []
      this.selectedRowKeys = []
      this.ipagination.current = 1
    },
    loadData(arg) {
      if (!this.url.list) {
        this.$message.error("请设置url.list属性!")
        return
      }
      //加载数据 è‹¥ä¼ å…¥å‚æ•°1则加载第一页的内容
      if (arg === 1) {
        this.ipagination.current = 1;
      }
      var params = this.getQueryParams();//查询条件
      this.loading = true;
      getAction(this.url.list, params).then((res) => {
        if (res.success) {
          this.dataSource = res.result.records || res.result;
          if (res.result.total) {
            this.ipagination.total = res.result.total;
          } else {
            this.ipagination.total = 0;
          }
          //update-end---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
        } else {
          this.$message.warning(res.message)
        }
      }).finally(() => {
        this.loading = false
      })
    },
  }
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
.fontweight {
  font-weight: bold;
}
/deep/ .frozenRowClass {
  color: #c9c9c9;
}
.success {
  color: green;
}
.error {
  color: red;
}
</style>