cuijian
2025-06-06 1fb93f73037a8c40ea87c7f09f568df16a6869d1
工具台账功能
已添加9个文件
已修改3个文件
1571 ■■■■■ 文件已修改
src/views/tms/ToolLedgerList.vue 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/inbound/InboundModel.vue 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/inboundOrder/InboundOrderModel.vue 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/toolLedger/InStoreDetailList.vue 109 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/toolLedger/OutStoreDetailList.vue 109 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/toolLedger/StocktakingList.vue 126 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/toolLedger/ToolLedgerDetailList.vue 85 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/toolLedger/ToolLedgerListLeft.vue 323 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/toolLedger/ToolLedgerListRight.vue 516 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/toolLedger/ToolLossList.vue 106 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/toolLedger/ToolSharpenList.vue 101 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/modules/toolsClassify/ToolsClassifyListLeft.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tms/ToolLedgerList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,39 @@
<template>
  <a-row
    type="flex"
    :gutter="16"
  >
    <a-col
      :md="5"
      :sm="24"
    >
      <tool-ledger-list-left />
    </a-col>
    <a-col
      :md="24-5"
      :sm="24"
    >
      <tool-ledger-list-right />
    </a-col>
  </a-row>
</template>
<script>
import ToolLedgerListLeft from './modules/toolLedger/ToolLedgerListLeft'
import ToolLedgerListRight from './modules/toolLedger/ToolLedgerListRight'
export default {
  name: 'ToolLedgerList',
  components: { ToolLedgerListLeft, ToolLedgerListRight },
  data() {
    return {
      description: '工具台账信息',
      currentOrgCode: ''
    }
  },
  methods: {}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>
src/views/tms/modules/inbound/InboundModel.vue
@@ -46,6 +46,18 @@
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row style="width: 100%">
          <a-col :span="24 / 2">
            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="库位号" prop="locationCodeId">
              <a-select
                :triggerChange="true"
                :options="locationCodeOptions"
                v-model="model.locationCodeId"
              />
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-form-model>
    </a-spin>
    <a-button type="primary" :style="{ marginBottom: '8px' }" @click="selectReturnList()" v-show="returnShow && !disableSubmit">选择借出工具</a-button>
@@ -174,6 +186,12 @@
              message: '请选择申请入库日期!',
            },
          ],
          locationCodeId:[
            {
              required: true,
              message: '请选择库位号!',
            },
          ]
      },
      url: {
        addInStorage: '/tms/inboundOrder/addInStorage',
@@ -233,12 +251,18 @@
          scopedSlots: { customRender: 'action' },
        },
      ],
      classifyId:''
      classifyId:'',
      locationCodeOptions:[]
    }
  },
  created() {
    //备份model原始值
    this.modelDefault = JSON.parse(JSON.stringify(this.model));
    ajaxGetDictItems("tms_goods_shelves,location_code,id", null).then((res) => {
        if (res.success) {
          this.locationCodeOptions = res.result
        }
      })
  },
  methods: {
    modalFormOk() {
@@ -402,7 +426,7 @@
          toolModel: data[i].toolModel,
          applicationType: data[i].applicationTypeName,
          onlyCode:data[i].onlyCode,
          inStorageQuantity:data[i].storageQuantity || data[i].quantity,
          inStorageQuantity:data[i].storageQuantity || data[i].quantity || 1,
          quantity:data[i].quantity,
          accuracyClass:data[i].accuracyClass
        })
src/views/tms/modules/inboundOrder/InboundOrderModel.vue
@@ -41,7 +41,23 @@
            </a-form-item>
          </a-col>
          <a-col :span="24 / 2">
            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="库位号">
             <a-select
                :triggerChange="true"
                :options="locationCodeOptions"
                v-decorator="[ 'locationCodeId', validatorRules.locationCodeId ]"
              />
            </a-form-item>
          </a-col>
          <!-- <a-col :span="24 / 2">
            <a-form-item label="申请原因" :labelCol="labelCol" :wrapperCol="wrapperCol">
             <a-input placeholder="请输入申请原因"  :disabled="disableSubmit" v-decorator="['applicationReason', validatorRules.applicationReason]" />
            </a-form-item>
          </a-col> -->
        </a-row>
         <a-row style="width: 100%">
          <a-col :span="24">
             <a-form-item label="申请原因" :labelCol="{ span: 3 }" :wrapperCol="{ span: 21 }" >
             <a-input placeholder="请输入申请原因"  :disabled="disableSubmit" v-decorator="['applicationReason', validatorRules.applicationReason]" />
            </a-form-item>
          </a-col>
@@ -324,9 +340,16 @@
          scopedSlots: { customRender: 'action' },
        },
      ],
      locationCodeOptions:[]
    }
  },
  created() {},
  created() {
    ajaxGetDictItems("tms_goods_shelves,location_code,id", null).then((res) => {
        if (res.success) {
          this.locationCodeOptions = res.result
        }
      })
  },
  methods: {
    modalFormOk() {
    },
@@ -531,7 +554,7 @@
          applicationType: data[i].applicationTypeName,
          onlyCode:data[i].onlyCode,
          quantity:data[i].quantity,
          inStorageQuantity:data[i].storageQuantity || data[i].quantity,
          inStorageQuantity:data[i].storageQuantity || data[i].quantity || 1,
          accuracyClass:data[i].accuracyClass
        })
      }
src/views/tms/modules/toolLedger/InStoreDetailList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,109 @@
<template>
  <a-card
    :bordered="false"
    class="card-area"
  >
    <a-table
      ref="table"
      bordered
      size="middle"
      rowKey="id"
      :columns="columns"
      :dataSource="dataSource"
      :pagination="ipagination"
      :loading="loading"
      @change="handleTableChange"
    >
    </a-table>
  </a-card>
</template>
<script>
import { requestPut } from '@/api/manage'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
export default {
  name: 'InStoreDetailList',
  mixins: [JeecgListMixin],
  components: {},
  data() {
    return {
      url: {
        list: '/tms/inStoreDetail/list',
      },
      queryParam: {},
      nodeType: 0,
      dataSource: [],
      disableMixinCreated:true,
      columns: [
        {
          title: '工具编码',
          align: 'center',
          dataIndex: 'toolCode',
        },
        {
          title: '工具编号',
          align: 'center',
          dataIndex: 'onlyCode',
        },
        {
          title: '工具名称',
          dataIndex: 'chineseName',
          align: 'center',
          key: 'toolName'
        },
        {
          title: '型号/图号',
          dataIndex: 'toolModel',
          align: 'center',
        },
        {
          title: '入库单编号',
          dataIndex: 'inboundNum',
          align: 'center',
        },
        {
          title: '入库类型',
          dataIndex: 'inStorehouseTypeName',
          align: 'center',
        },
        {
          title: '入库方式',
          dataIndex: 'operateType',
          align: 'center',
        },
        {
          title: '经手人',
          dataIndex: 'handler',
          align: 'center',
        },
        {
          title: '库位号',
          dataIndex: 'locationCode',
          align: 'center',
        },
        {
          title: '入库数量',
          dataIndex: 'inNumber',
          align: 'center',
        },
      ],
      para:{},
    }
  },
  methods: {
  },
  mounted() {
    this.$bus.$on('getToolLedgerData', (data) => {
      this.queryParam.toolCode = data.toolCode;
      this.searchQuery();
    })
  }
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>
src/views/tms/modules/toolLedger/OutStoreDetailList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,109 @@
<template>
  <a-card
    :bordered="false"
    class="card-area"
  >
    <a-table
      ref="table"
      bordered
      size="middle"
      rowKey="id"
      :columns="columns"
      :dataSource="dataSource"
      :pagination="ipagination"
      :loading="loading"
      @change="handleTableChange"
    >
    </a-table>
  </a-card>
</template>
<script>
import { requestPut } from '@/api/manage'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
export default {
  name: 'OutStoreDetailList',
  mixins: [JeecgListMixin],
  components: {},
  data() {
    return {
      url: {
        list: '/tms/outStoreDetail/outStoreDetailList',
      },
      queryParam: {},
      nodeType: 0,
      dataSource: [],
      disableMixinCreated:true,
      columns: [
        {
          title: '工具编码',
          align: 'center',
          dataIndex: 'toolCode',
        },
        {
          title: '工具编号',
          align: 'center',
          dataIndex: 'onlyCode',
        },
        {
          title: '工具名称',
          dataIndex: 'chineseName',
          align: 'center',
          key: 'toolName'
        },
        {
          title: '型号/图号',
          dataIndex: 'toolModel',
          align: 'center',
        },
        {
          title: '出库单编号',
          dataIndex: 'outNum',
          align: 'center',
        },
        {
          title: '出库类型',
          dataIndex: 'outStorehouseTypeName',
          align: 'center',
        },
        {
          title: '出库方式',
          dataIndex: 'operateType',
          align: 'center',
        },
        {
          title: '经手人',
          dataIndex: 'handler',
          align: 'center',
        },
        {
          title: '出库时间',
          dataIndex: 'outboundTime',
          align: 'center',
        },
        {
          title: '出库数量',
          dataIndex: 'outNumber',
          align: 'center',
        }
      ],
      para:{},
    }
  },
  methods: {
  },
  mounted() {
    this.$bus.$on('getToolLedgerData', (data) => {
      this.queryParam.toolCode = data.toolCode;
      this.searchQuery();
    })
  }
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>
src/views/tms/modules/toolLedger/StocktakingList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,126 @@
<template>
  <a-card
    :bordered="false"
    class="card-area"
  >
    <a-table
      ref="table"
      bordered
      size="middle"
      rowKey="id"
      :columns="columns"
      :dataSource="dataSource"
      :pagination="ipagination"
      :loading="loading"
      @change="handleTableChange"
    >
    </a-table>
  </a-card>
</template>
<script>
import { requestPut } from '@/api/manage'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
export default {
  name: 'ToolLedgerDetailList',
  mixins: [JeecgListMixin],
  components: {},
  data() {
    return {
      url: {
        list: '/tms/toolsStocktakingBound/toolsStocktakingList',
      },
      queryParam: {},
      nodeType: 0,
      dataSource: [],
      disableMixinCreated:true,
      columns: [
        {
          title: '工具编码',
          align: 'center',
          dataIndex: 'toolCode',
          width: '10%',
        },
        {
          title: '工具编号',
          align: 'center',
          dataIndex: 'onlyCode',
          width: '10%',
        },
        {
          title: '工具名称',
          dataIndex: 'chineseName',
          align: 'center',
          key: 'toolName'
        },
        {
          title: '型号/图号',
          dataIndex: 'toolModel',
          align: 'center',
        },
        {
          title: '盘点单号',
          dataIndex: 'orderCode',
          align: 'center',
        },
        {
          title: '盘点名称',
          dataIndex: 'stocktakingName',
          align: 'center',
        },
        {
          title: '盘点类型',
          dataIndex: 'stocktakingType',
          align: 'center',
        },
        {
          title: '经手人',
          dataIndex: 'handler',
          align: 'center',
        },
        {
          title: '盘库时间',
          dataIndex: 'stocktakingDate',
          align: 'center',
        },
        {
          title: '盘盈盘亏',
          dataIndex: 'surplusDeficit',
          align: 'center',
        },
        {
          title: '账面数量',
          dataIndex: 'bookQuantity',
          align: 'center',
        },
        {
          title: '可用数量',
          dataIndex: 'availableQuantity',
          align: 'center',
        },
        {
          title: '实盘数量',
          dataIndex: 'practicalQuantity',
          align: 'center',
        }
      ],
      para:{},
    }
  },
  methods: {
  },
  mounted() {
    this.$bus.$on('getToolLedgerData', (data) => {
      this.queryParam.toolCode = data.toolCode;
      this.searchQuery();
    })
  }
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>
src/views/tms/modules/toolLedger/ToolLedgerDetailList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,85 @@
<template>
  <a-card
    :bordered="false"
    class="card-area"
  >
    <a-table
      ref="table"
      bordered
      size="middle"
      rowKey="id"
      :columns="columns"
      :dataSource="dataSource"
      :pagination="ipagination"
      :loading="loading"
      @change="handleTableChange"
    >
    </a-table>
  </a-card>
</template>
<script>
import { requestPut } from '@/api/manage'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
export default {
  name: 'ToolLedgerDetailList',
  mixins: [JeecgListMixin],
  components: {},
  data() {
    return {
      url: {
        list: '/tms/toolLedgerDetail/queryToolLedgerDetailList',
      },
      queryParam: {},
      nodeType: 0,
      dataSource: [],
      disableMixinCreated:true,
      columns: [
        {
          title: '工具编码',
          align: 'center',
          dataIndex: 'toolCode',
        },
        {
          title: '工具编号',
          align: 'center',
          dataIndex: 'onlyCode',
        },
        {
          title: '工具名称',
          dataIndex: 'chineseName',
          align: 'center',
          key: 'toolName'
        },
        {
          title: '型号/图号',
          dataIndex: 'toolModel',
          align: 'center',
        },
        {
          title: '工具分类',
          dataIndex: 'applicationType',
          align: 'center',
        }
      ],
      para:{},
    }
  },
  methods: {
  },
  mounted() {
    this.$bus.$on('getToolLedgerData', (data) => {
      this.queryParam.toolCode = data.toolCode;
      this.searchQuery();
    })
  }
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>
src/views/tms/modules/toolLedger/ToolLedgerListLeft.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,323 @@
<template>
  <a-card
    :loading="cardLoading"
    :bordered="false"
    title="工具信息"
    style="height: 100%;"
  >
    <a-spin :spinning="loading">
      <a-alert
        type="info"
        :showIcon="true"
        style="margin-right: 54px;"
      >
        <div slot="message">
          å½“前:<span v-if="this.currSelected.title">{{ getCurrSelectedTitle() }}</span>
          <a
            v-if="this.currSelected.title"
            style="margin-left: 10px"
            @click="onClearSelected"
          >取消</a>
        </div>
      </a-alert>
      <!-- <div class="drawer-bootom-button">
        <a-dropdown
          :trigger="['click']"
          placement="bottomCenter"
        >
          <a-menu slot="overlay">
            <a-menu-item
              key="1"
              @click="expandAll"
            >展开所有</a-menu-item>
            <a-menu-item
              key="2"
              @click="closeAll"
            >合并所有</a-menu-item>
            <a-menu-item
              key="3"
              @click="refreshTree"
            >刷新</a-menu-item>
          </a-menu>
          <a-button>
            <a-icon type="bars" />
          </a-button>
        </a-dropdown>
      </div> -->
      <a-input-search
        @search="handleSearch"
        style="width:100%;margin-top: 10px"
        placeholder="检索工具分类"
        allowClear
        v-model="searchInput"
        @change="handleChange"
      />
      <!-- showLine -->
      <a-tree
        :checkStrictly="checkStrictly"
        :selectedKeys="selectedKeys"
        :dropdownStyle="{maxHeight:'200px',overflow:'auto'}"
        :treeData="treeDataSource"
        :defaultExpandAll="true"
        @select="onSelect"
        @expand="onExpand"
      >
        <template
          slot="title"
          slot-scope="{title, type, rfield1}"
        >
          <Tooltip
            placement="top"
            title="工具分类"
          >
            <i
              v-if="type == 0"
              class="action-jeecg actioncompany2"
              style="font-size: 18px;"
            />
          </Tooltip>
          <span v-if="title.indexOf(searchValue) > -1">
            {{ title.substr(0, title.indexOf(searchValue)) }}
            <span class="replaceSearch">{{ searchValue }}</span>
            {{ title.substr(title.indexOf(searchValue) + searchValue.length) }}
          </span>
          <span v-else>{{ title }}</span>
        </template>
      </a-tree>
    </a-spin>
  </a-card>
</template>
<script>
import { getAction } from '@/api/manage'
import Tooltip from 'ant-design-vue/es/tooltip'
export default {
  name: 'ToolLedgerListLeft',
  components: {
    Tooltip,
  },
  props: ['value'],
  data() {
    return {
      searchInput: '',
      cardLoading: false,
      loading: false,
      treeDataSource: [],
      selectedKeys: [],
      expandedKeys: [],
      url: {
        factoryTreeList: '/tms/toolsClassify/loadTree',
      },
      searchValue: '',
      dataList: [],
      autoExpandParent: true,
      checkStrictly: true,
      allTreeKeys: [],
      currSelected: {},
      hiding: false,
    }
  },
  created() {
    this.queryTreeData();
    this.closeAll();
  },
  methods: {
    getCurrSelectedTitle() {
      return !this.currSelected.title ? '' : this.currSelected.title;
    },
    onClearSelected() {
      this.hiding = true;
      this.currSelected = {};
      this.selectedKeys = [];
    },
    onSelect(selectedKeys, e) {
      this.hiding = false;
      let record = e.node.dataRef;
      this.currSelected = Object.assign({}, record);
      this.selectedKeys = [record.key];
    },
    onExpand(expandedKeys) {
      this.expandedKeys = expandedKeys;
      this.autoExpandParent = false;
    },
    queryTreeData() {
      this.loading = true;
      this.cardLoading = true;
      getAction(this.url.factoryTreeList).then((res) => {
        if (res.success) {
          this.dataList = [];
          this.allTreeKeys = [];
          this.treeDataSource = res.result;
          this.generateList(res.result);
        } else {
          this.$message.warn(res.message);
        }
      }).finally(() => {
        this.loading = false;
        this.cardLoading = false;
      })
    },
    handleChange() {
      let search = this.searchInput;
      let expandedKeys = this.dataList
        .map(item => {
          if (item.title.indexOf(search) > -1) {
            return this.getParentKey(item.key, this.treeDataSource);
          }
          return null;
        })
        .filter((item, i, self) => item && self.indexOf(item) === i);
      Object.assign(this, {
        expandedKeys,
        searchValue: search,
        autoExpandParent: true,
      });
    },
    handleSearch(value) {
      let search = value;
      let expandedKeys = this.dataList
        .map(item => {
          if (item.title.indexOf(search) > -1) {
            return this.getParentKey(item.key, this.treeDataSource);
          }
          return null;
        })
        .filter((item, i, self) => item && self.indexOf(item) === i);
      Object.assign(this, {
        expandedKeys,
        searchValue: search,
        autoExpandParent: true,
      });
    },
    getParentKey(key, tree) {
      let parentKey;
      for (let i = 0; i < tree.length; i++) {
        const node = tree[i];
        if (node.children) {
          if (node.children.some(item => item.key === key)) {
            parentKey = node.key;
          } else if (
            this.getParentKey(key, node.children)) {
            parentKey = this.getParentKey(key, node.children);
          }
        }
      }
      return parentKey;
    },
    generateList(data) {
      for (let i = 0; i < data.length; i++) {
        const node = data[i];
        const key = node.key;
        const title = node.title;
        this.dataList.push({ key, title: title });
        this.allTreeKeys.push(key);
        if (node.children) {
          this.generateList(node.children);
        }
      }
    },
    expandAll() {
      this.expandedKeys = this.allTreeKeys;
    },
    closeAll() {
      this.expandedKeys = [];
    },
    refreshTree() {
      this.queryTreeData();
    }
  },
  mounted() {
    this.$bus.$on('queryTreeData', this.queryTreeData);
  },
  //监听
  watch: {
    currSelected(val) {//监听currSelected å˜åŒ–,将变化后的数值传递给 getCurrSelected äº‹ä»¶
      this.$bus.$emit('getCurrSelected', val)
    },
  }
}
</script>
<style scoped>
.replaceSearch {
  color: #40a9ff;
  font-weight: bold;
  background-color: rgb(204, 204, 204);
}
/*隐藏树的默认icon*/
.ant-tree-switcher-noop {
  display: none !important;
}
/*隐藏树的默认竖线*/
.ant-tree.ant-tree-show-line li:not(:last-child):before {
  border-left: 0px;
}
.ant-card-body .table-operator {
  margin: 15px;
}
.anty-form-btn {
  width: 100%;
  text-align: center;
}
.anty-form-btn button {
  margin: 0 5px;
}
.anty-node-layout .ant-layout-header {
  padding-right: 0;
}
.header {
  padding: 0 8px;
}
.header button {
  margin: 0 3px;
}
.ant-modal-cust-warp {
  height: 100%;
}
.ant-modal-cust-warp .ant-modal-body {
  height: calc(100% - 110px) !important;
  overflow-y: auto;
}
.ant-modal-cust-warp .ant-modal-content {
  height: 90% !important;
  overflow-y: hidden;
}
#app .desktop {
  height: auto !important;
}
/** Button按钮间距 */
.ant-btn {
  margin-left: 3px;
}
.ant-alert {
  padding: 5px 15px 5px 37px;
}
.drawer-bootom-button {
  position: absolute;
  top: 1px;
  /* padding: 10px 16px; */
  text-align: left;
  right: 0;
  background: #fff;
  border-radius: 0 0 2px 2px;
}
</style>
src/views/tms/modules/toolLedger/ToolLedgerListRight.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,516 @@
<template>
  <a-card :bordered="false">
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
           <a-col
            :md="6"
            :sm="8"
          >
            <a-form-item
              label="工具编号"
              :labelCol="{span: 5}"
              :wrapperCol="{span: 18, offset: 1}"
            >
              <a-input
                placeholder="请输入工具编号检索"
                v-model="queryParam.toolCode"
              ></a-input>
            </a-form-item>
          </a-col>
          <a-col
            :md="6"
            :sm="8"
          >
            <a-form-item
              label="型号/图号"
              :labelCol="{span: 5}"
              :wrapperCol="{span: 18, offset: 1}"
            >
              <a-input
                placeholder="请输入型号/图号检索"
                v-model="queryParam.toolModel"
              ></a-input>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="24">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- æŸ¥è¯¢åŒºåŸŸ-END -->
    <!-- æ“ä½œæŒ‰é’®åŒºåŸŸ -->
    <!-- table区域-begin -->
    <div>
      <a-table
        ref="table"
        size="middle"
        :scroll="{x:true}"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type:'radio'}"
        class="j-table-force-nowrap"
        :customRow="customRow"
        @change="handleTableChange">
        <template slot="htmlSlot" slot-scope="text">
          <div v-html="text"></div>
        </template>
        <template slot="imgSlot" slot-scope="text,record">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
          <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
        </template>
        <template slot="fileSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
          <a-button
            v-else
            :ghost="true"
            type="primary"
            icon="download"
            size="small"
            @click="downloadFile(text)">
            ä¸‹è½½
          </a-button>
        </template>
      </a-table>
    </div>
     <a-tabs defaultActiveKey="1">
      <a-tab-pane key="1">
        <span slot="tab">
          <a-badge>参数&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a-badge>
        </span>
        <para-hole-tools-list ref="paraHoleToolsList"></para-hole-tools-list>
        <para-threading-tool-list ref="paraThreadingToolList"></para-threading-tool-list>
        <para-mill-tool-list ref="paraMillToolList"></para-mill-tool-list>
        <para-turning-tools-list ref="paraTurningToolsList"></para-turning-tools-list>
        <para-blade-list ref="paraBladeList"></para-blade-list>
        <para-common-tool-list ref="paraCommonToolList"></para-common-tool-list>
      </a-tab-pane>
      <a-tab-pane
        key="2"
        forceRender
      >
        <span slot="tab">
          <a-badge>管理参数&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a-badge>
        </span>
        <tools-config-property-list ref="toolsConfigPropertyList"></tools-config-property-list>
      </a-tab-pane>
      <a-tab-pane
        key="3"
        forceRender
      >
        <span slot="tab">
          <a-badge>把号&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a-badge>
        </span>
        <tool-ledger-detail-list ref="toolLedgerDetailList"></tool-ledger-detail-list>
      </a-tab-pane>
      <a-tab-pane
        key="4"
        forceRender
      >
        <span slot="tab">
          <a-badge>入库信息&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a-badge>
        </span>
        <in-store-detail-list ref="inStoreDetailList"></in-store-detail-list>
      </a-tab-pane>
      <a-tab-pane
        key="5"
        forceRender
      >
        <span slot="tab">
          <a-badge>出库信息&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a-badge>
        </span>
        <out-store-detail-list ref="outStoreDetailList"></out-store-detail-list>
      </a-tab-pane>
      <a-tab-pane
        key="6"
        forceRender
      >
        <span slot="tab">
          <a-badge>刃磨信息&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a-badge>
        </span>
        <tool-sharpen-list ref="toolSharpenList"></tool-sharpen-list>
      </a-tab-pane>
      <a-tab-pane
        key="7"
        forceRender
      >
        <span slot="tab">
          <a-badge>报损信息&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a-badge>
        </span>
        <tool-loss-list ref="toolLossList"></tool-loss-list>
      </a-tab-pane>
      <a-tab-pane
        key="8"
        forceRender
      >
        <span slot="tab">
          <a-badge>盘点信息&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a-badge>
        </span>
        <stocktaking-list ref="stocktakingList"></stocktaking-list>
      </a-tab-pane>
    </a-tabs>
  </a-card>
</template>
<script>
  import '@/assets/less/TableExpand.less'
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import Tooltip from 'ant-design-vue/es/tooltip'
  import { getAction, postAction, deleteAction, requestPut } from '@api/manage'
  import ParaHoleToolsList from '../baseTools/ParaHoleToolsList'
  import ToolsConfigPropertyList from '../baseTools/ToolsConfigPropertyList'
  import ParaMillToolList from '../baseTools/ParaMillToolList'
  import ParaThreadingToolList from '../baseTools/ParaThreadingToolList'
  import ParaTurningToolsList from '../baseTools/ParaTurningToolsList'
  import ParaCommonToolList from '../baseTools/ParaCommonToolList'
  import ParaBladeList from '../baseTools/ParaBladeList'
  import ToolLedgerDetailList from './ToolLedgerDetailList'
  import ToolLossList from './ToolLossList'
  import ToolSharpenList from './ToolSharpenList'
  import StocktakingList from './StocktakingList'
  import InStoreDetailList from './InStoreDetailList'
  import OutStoreDetailList from './OutStoreDetailList'
  export default {
    name: 'ToolLedgerListRight',
    mixins:[JeecgListMixin, mixinDevice],
    components: {
      Tooltip,
      ParaHoleToolsList,
      ToolsConfigPropertyList,
      ParaMillToolList,
      ParaThreadingToolList,
      ParaTurningToolsList,
      ParaCommonToolList,
      ParaBladeList,
      ToolLedgerDetailList,
      ToolLossList,
      ToolSharpenList,
      StocktakingList,
      InStoreDetailList,
      OutStoreDetailList
    },
    data () {
      return {
        description: '工具台账信息管理页面',
        /* åˆ†é¡µå‚æ•° */
      ipagination:{
        current: 1,
        pageSize: 10,
        pageSizeOptions: ['10', '20', '50'],
        showTotal: (total, range) => {
          return range[0] + "-" + range[1] + " å…±" + total + "条"
        },
        showQuickJumper: true,
        showSizeChanger: true,
        total: 0
      },
        // è¡¨å¤´
        columns: [
          {
            title: '#',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
          },
          {
            title:'工具编码',
            align:"center",
            dataIndex: 'toolCode'
          },
          {
            title:'序号',
            align:"center",
            dataIndex: 'signCode'
          },
          {
            title:'中文名称',
            align:"center",
            dataIndex: 'chineseName'
          },
          // {
          //   title:'外文名称',
          //   align:"center",
          //   dataIndex: 'foreignLanguageName'
          // },
          // {
          //   title:'标注级别',
          //   align:"center",
          //   dataIndex: 'standardLevel'
          // },
          // {
          //   title:'标准号',
          //   align:"center",
          //   dataIndex: 'standardCode'
          // },
          {
            title:'型号/图号',
            align:"center",
            dataIndex: 'toolModel'
          },
          {
            title:'工具类型',
            align:"center",
            dataIndex: 'applicationType'
          },
          {
            title:'管理等级',
            align:"center",
            dataIndex: 'accuracyClass'
          },
          {
            title:'存储位置',
            align:"center",
            dataIndex: 'storageLocation'
          },
          {
            title:'库位号',
            align:"center",
            dataIndex: 'positionCode'
          },
          {
            title:'最低库存',
            align:"center",
            dataIndex: 'lowerInventory'
          },
          {
            title:'最高库存',
            align:"center",
            dataIndex: 'highestInventory'
          },
          {
            title:'总库存',
            align:"center",
            dataIndex: 'totalCount'
          },
          {
            title:'可用库存',
            align:"center",
            dataIndex: 'availableCount'
          },
          {
            title:'报损',
            align:"center",
            dataIndex: 'lossCount'
          },
          {
            title:'在借',
            align:"center",
            dataIndex: 'lendCount'
          },
          {
            title:'在磨',
            align:"center",
            dataIndex: 'sharpeningCount'
          },
          {
            title:'在检',
            align:"center",
            dataIndex: 'detectionCount'
          },
          {
            title:'在修',
            align:"center",
            dataIndex: 'repairCount'
          }
          // {
          //   title:'备注',
          //   align:"center",
          //   dataIndex: 'remark'
          // }
          // {
          //   title:'创建人',
          //   align:"center",
          //   dataIndex: 'createBy'
          // },
          // {
          //   title:'创建时间',
          //   align:"center",
          //   dataIndex: 'createTime',
          //   customRender:function (text) {
          //     return !text?"":(text.length>10?text.substr(0,10):text)
          //   }
          // }
        ],
        url: {
          list: "/tms/baseTools/list",
          paraHolesToolsList:"/tms/baseTools/paraHolesToolsList",
          paraCommonToolList:"/tms/baseTools/paraCommonToolList",
          paraThreadingToolList:"/tms/baseTools/paraThreadingToolList",
          paraMillToolList:"/tms/baseTools/paraMillToolList",
          paraTurningToolsList:"/tms/baseTools/paraTurningToolsList",
          paraBladeList:"/tms/baseTools/paraBladeList",
          delete: "/tms/baseTools/delete",
          deleteBatch: "/tms/baseTools/deleteBatch",
          edit: '/tms/baseTools/edit',
          exportXlsUrl: "/tms/baseTools/exportXls",
          importExcelUrl: "tms/baseTools/importExcel",
          queryParaByToolCode:"/tms/baseTools/queryByToolCode",
          queryByToolCode:"/tms/toolsConfigProperty/queryByToolCode",
          toolLedgerList:"/tms/toolLedger/toolLedgerList",
          toolLedgerDetailList:"/tms/toolLedgerDetail/list"
        },
        dictOptions:{},
        superFieldList:[],
        nodeSelected: {}, // å½“前选中的节点数据
        paraTypeFlag:'',
        disableMixinCreated:true
      }
    },
    created() {
      this.$bus.$on('getCurrSelected', (data) => {
      //getCurrSelected äº‹ä»¶ æŽ¥æ”¶ç»„件传递的参数
      this.nodeType = (data.type == undefined ? 0 : data.type);
      this.paraTypeFlag = (data.entity == undefined ? 0 : data.entity.paraTypeFlag)
      this.nodeSelected = data;
      this.loadData()
      this.clearPara()
    })
    },
    computed: {
      importExcelUrl: function(){
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      },
    },
    methods: {
      modalFormOk() {
        this.loadData(); // åˆ·æ–°è¡¨æ ¼æ•°æ®
        this.$bus.$emit('queryTreeData') //刷新左侧树
      },
      onSelectChange(selectedRowKeys,selectionRows) {
        this.selectedRowKeys = selectedRowKeys;
        this.selectionRows = selectionRows
        //通过id查询管理参数和参数数据
        getAction(this.url.queryParaByToolCode, { toolCode: this.selectedRowKeys[0],paraTypeFlag:this.paraTypeFlag}).then((res) => {
          if (res.success) {
            if(this.paraTypeFlag === "1"){
              this.$refs.paraCommonToolList.getPara(res.result);
            }else if(this.paraTypeFlag === "2"){
              this.$refs.paraHoleToolsList.getPara(res.result);
            }else if(this.paraTypeFlag === "3"){
              this.$refs.paraThreadingToolList.getPara(res.result);
            }else if(this.paraTypeFlag === "4"){
              this.$refs.paraMillToolList.getPara(res.result);
            }else if(this.paraTypeFlag === "5"){
              this.$refs.paraTurningToolsList.getPara(res.result);
            }else if(this.paraTypeFlag === "6"){
              this.$refs.paraBladeList.getPara(res.result);
            }
          } else {
            this.$message.warning(res.message);
          }
        })
        getAction(this.url.queryByToolCode, { toolCode: this.selectedRowKeys[0]}).then((res) => {
          if (res.success) {
            this.$refs.toolsConfigPropertyList.getPara(res.result);
          } else {
            this.$message.warning(res.message);
          }
        })
        this.$bus.$emit('getToolLedgerData', this.selectionRows[0])
      },
      //禁用状态样式
      tableRowClass(record, index) {
        if (record.status != "1") {
          return "frozenRowClass";
        }
        return "";
      },
      loadData() {
        let params = this.getQueryParams();
        if (this.nodeSelected && this.nodeSelected.key !== '-1') {
          // åŠ è½½é€‰ä¸­èŠ‚ç‚¹çš„å­ç±»
          params.classifyId = this.nodeSelected.key;
          this.loading = true;
        let httpUrl = this.url.toolLedgerList
        getAction(httpUrl, params)
          .then((res) => {
            if (res.success) {
              this.dataSource = res.result.records; // æ›´æ–°è¡¨æ ¼æ•°æ®
              this.ipagination.total = res.result.total
            } else {
              this.$message.warning("请选择叶子节点进行查询");
              this.ipagination.total = 0
            }
          })
          .finally(() => {
            this.loading = false;
          });
        } else {
          this.$message.warning("请选择叶子节点进行查询");
        }
      },
      onClearSelected() {
        this.selectedKeys = [];
        this.nodeSelected = {}; // æ¸…空选中的节点
        this.dataSource = []; // æ¸…空表格数据
      },
      //重置
      searchReset() {
        this.queryParam = {}
        this.loadData(1);
        this.clearPara()
      },
      //清空选中及参数
      clearPara(){
        this.selectedRowKeys = []
        this.$refs.paraCommonToolList.visable = false
        this.$refs.paraHoleToolsList.visable = false
        this.$refs.paraThreadingToolList.visable = false
        this.$refs.paraMillToolList.visable = false
        this.$refs.paraTurningToolsList.visable = false
        this.$refs.paraBladeList.visable = false
        this.$refs.toolsConfigPropertyList.visable = false
      },
      customRow(record) {
        return {
          on: {
            click: () => {
              this.onSelectChange(record.id.split(","), [record]);
            }
          }
        }
      },
    },
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
   .enable {
    color: green;
  }
  .disable {
    color: red;
  }
</style>
src/views/tms/modules/toolLedger/ToolLossList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,106 @@
<template>
  <a-card
    :bordered="false"
    class="card-area"
  >
    <a-table
      ref="table"
      bordered
      size="middle"
      rowKey="id"
      :columns="columns"
      :dataSource="dataSource"
      :pagination="ipagination"
      :loading="loading"
      @change="handleTableChange"
    >
    </a-table>
  </a-card>
</template>
<script>
import { requestPut } from '@/api/manage'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
export default {
  name: 'ToolLossList',
  mixins: [JeecgListMixin],
  components: {},
  data() {
    return {
      url: {
        list: '/tms/toolsLossBound/toolLossDetailList',
      },
      queryParam: {},
      nodeType: 0,
      dataSource: [],
      disableMixinCreated:true,
      columns: [
        {
          title: '工具编码',
          align: 'center',
          dataIndex: 'toolCode',
          width: '10%',
        },
        {
          title: '工具编号',
          align: 'center',
          dataIndex: 'onlyCode',
          width: '10%',
        },
        {
          title: '工具名称',
          dataIndex: 'chineseName',
          align: 'center',
          key: 'toolName'
        },
        {
          title: '型号/图号',
          dataIndex: 'toolModel',
          align: 'center',
        },
        {
          title: '报损单号',
          dataIndex: 'orderCode',
          align: 'center',
        },
        {
          title: '经手人',
          dataIndex: 'handler',
          align: 'center',
        },
        {
          title: '报损原因',
          dataIndex: 'lossReason',
          align: 'center',
        },
        {
          title: '报损时间',
          dataIndex: 'lossTime',
          align: 'center',
        },
        {
          title: '报损数量',
          dataIndex: 'lossNumber',
          align: 'center',
        }
      ],
      para:{},
    }
  },
  methods: {
  },
  mounted() {
    this.$bus.$on('getToolLedgerData', (data) => {
      this.queryParam.toolCode = data.toolCode;
      this.searchQuery();
    })
  }
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>
src/views/tms/modules/toolLedger/ToolSharpenList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,101 @@
<template>
  <a-card
    :bordered="false"
    class="card-area"
  >
    <a-table
      ref="table"
      bordered
      size="middle"
      rowKey="id"
      :columns="columns"
      :dataSource="dataSource"
      :pagination="ipagination"
      :loading="loading"
      @change="handleTableChange"
    >
    </a-table>
  </a-card>
</template>
<script>
import { requestPut } from '@/api/manage'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
export default {
  name: 'ToolSharpenList',
  mixins: [JeecgListMixin],
  components: {},
  data() {
    return {
      url: {
        list: '/tms/toolSharpening/toolSharpeningList',
      },
      queryParam: {},
      nodeType: 0,
      dataSource: [],
      disableMixinCreated:true,
      columns: [
        {
          title: '工具编码',
          align: 'center',
          dataIndex: 'toolCode',
          width: '10%',
        },
        {
          title: '工具编号',
          align: 'center',
          dataIndex: 'onlyCode',
          width: '10%',
        },
        {
          title: '工具名称',
          dataIndex: 'chineseName',
          align: 'center',
          key: 'toolName'
        },
        {
          title: '型号/图号',
          dataIndex: 'toolModel',
          align: 'center',
        },
        {
          title: '责任人',
          dataIndex: 'toolModel',
          align: 'center',
        },
        {
          title: '刃磨时间',
          dataIndex: 'toolModel',
          align: 'center',
        },
        {
          title: '刃磨结果及建议',
          dataIndex: 'toolModel',
          align: 'center',
        },
        {
          title: '刃磨状态',
          dataIndex: 'toolModel',
          align: 'center',
        },
      ],
      para:{},
    }
  },
  methods: {
  },
  mounted() {
    this.$bus.$on('getToolLedgerData', (data) => {
      this.queryParam.toolCode = data.toolCode;
      this.searchQuery();
    })
  }
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>
src/views/tms/modules/toolsClassify/ToolsClassifyListLeft.vue
@@ -227,7 +227,7 @@
      this.expandedKeys = this.allTreeKeys;
    },
    closeAll() {
      this.expandedKeys = this.allSiteIds;
      this.expandedKeys = [];
    },
    refreshTree() {
      this.queryTreeData();