材料站-工器具台账
This commit is contained in:
		
							parent
							
								
									2bfdcca376
								
							
						
					
					
						commit
						20ce10b1a7
					
				| 
						 | 
				
			
			@ -113,13 +113,24 @@
 | 
			
		|||
        label="序号"
 | 
			
		||||
        align="center"
 | 
			
		||||
        type="index"
 | 
			
		||||
        width="55"
 | 
			
		||||
        :index="index => (queryParams.pageNum - 1) * queryParams.pageSize + index + 1"
 | 
			
		||||
      />
 | 
			
		||||
      <el-table-column label="分公司" align="center" prop="impUnitName" width="200" />
 | 
			
		||||
      <el-table-column label="项目部" align="center" prop="departName" width="200" />
 | 
			
		||||
      <el-table-column label="工程名称" align="center" prop="proName" width="200" />
 | 
			
		||||
      <el-table-column label="分包单位" align="center" prop="subUnitName" width="200" />
 | 
			
		||||
      <el-table-column label="班组名称" align="center" prop="teamName" />
 | 
			
		||||
      <el-table-column label="分包单位" align="center" prop="subUnitName" width="200">
 | 
			
		||||
        <template slot-scope="{ row }">
 | 
			
		||||
          <span v-if="row.subUnitName">{{ row.subUnitName }}</span>
 | 
			
		||||
          <span v-else>{{ '/' }}</span>
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
      <el-table-column label="班组名称" align="center" prop="teamName">
 | 
			
		||||
        <template slot-scope="{ row }">
 | 
			
		||||
          <span v-if="row.teamName">{{ row.teamName }}</span>
 | 
			
		||||
          <span v-else>{{ '站内库存' }}</span>
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
      <el-table-column label="物资名称" align="center" prop="typeName" :show-overflow-tooltip="true" />
 | 
			
		||||
      <el-table-column label="规格型号" align="center" prop="typeModelName" :show-overflow-tooltip="true" />
 | 
			
		||||
      <el-table-column label="计量单位" align="center" prop="unit" :show-overflow-tooltip="true" />
 | 
			
		||||
| 
						 | 
				
			
			@ -159,6 +170,7 @@
 | 
			
		|||
        </el-form-item>
 | 
			
		||||
        <el-form-item>
 | 
			
		||||
          <el-button type="primary" icon="el-icon-search" size="mini" @click="handleDialogQuery">查询</el-button>
 | 
			
		||||
          <el-button icon="el-icon-refresh" size="mini" @click="resetDialogQuery">重置</el-button>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-form-item>
 | 
			
		||||
          <el-button icon="el-icon-download" size="mini" @click="handleDialogStoreExport">导出</el-button>
 | 
			
		||||
| 
						 | 
				
			
			@ -176,8 +188,6 @@
 | 
			
		|||
        <el-table-column label="机具名称" align="center" prop="typeName" :show-overflow-tooltip="true" />
 | 
			
		||||
        <el-table-column label="规格型号" align="center" prop="typeModelName" :show-overflow-tooltip="true" />
 | 
			
		||||
        <el-table-column label="设备编码" align="center" prop="maCode" :show-overflow-tooltip="true" />
 | 
			
		||||
        <el-table-column label="操作人" align="center" prop="inputUser" :show-overflow-tooltip="true" />
 | 
			
		||||
        <el-table-column label="入库时间" align="center" prop="inputTime" :show-overflow-tooltip="true" />
 | 
			
		||||
      </el-table>
 | 
			
		||||
      <pagination
 | 
			
		||||
        v-show="dialogTotal > 0"
 | 
			
		||||
| 
						 | 
				
			
			@ -285,34 +295,52 @@ export default {
 | 
			
		|||
        {
 | 
			
		||||
          ...this.queryParams
 | 
			
		||||
        },
 | 
			
		||||
        `工机具台账_${new Date().getTime()}.xlsx`
 | 
			
		||||
        `工器具台账_${new Date().getTime()}.xlsx`
 | 
			
		||||
      )
 | 
			
		||||
    },
 | 
			
		||||
    //查看在库编码数据
 | 
			
		||||
    openRecords(row) {
 | 
			
		||||
      this.openRecord = true
 | 
			
		||||
      this.dialogList = []
 | 
			
		||||
      this.dialogTotal = 0
 | 
			
		||||
      this.dialogQuery.pageNum = 1
 | 
			
		||||
      this.dialogQuery.pageSize = 10
 | 
			
		||||
      this.dialogQuery.keyWord = ''
 | 
			
		||||
      this.dialogQuery.typeId = row.typeId
 | 
			
		||||
      this.dialogQuery.proId = row.proId
 | 
			
		||||
      this.dialogQuery.teamId = row.teamId || ''
 | 
			
		||||
      this.openRecord = true
 | 
			
		||||
      this.getStoreCodeList()
 | 
			
		||||
    },
 | 
			
		||||
    /** 查询在库编码列表 */
 | 
			
		||||
    getStoreCodeList() {
 | 
			
		||||
      getStorageInfoListApi(this.dialogQuery).then(response => {
 | 
			
		||||
        this.dialogList = response.data.rows
 | 
			
		||||
        this.dialogTotal = response.data.total
 | 
			
		||||
      })
 | 
			
		||||
    async getStoreCodeList() {
 | 
			
		||||
      try {
 | 
			
		||||
        this.loading = true
 | 
			
		||||
        const res = await getStorageInfoListApi(this.dialogQuery)
 | 
			
		||||
        this.dialogList = res.data.rows || []
 | 
			
		||||
        this.dialogTotal = res.data.total || 0
 | 
			
		||||
      } catch (error) {
 | 
			
		||||
        console.log('🚀 ~ getStoreCodeList ~ error:', error)
 | 
			
		||||
      } finally {
 | 
			
		||||
        this.loading = false
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    /** 搜索在库按钮操作 */
 | 
			
		||||
    handleDialogQuery() {
 | 
			
		||||
      this.dialogQuery.pageNum = 1
 | 
			
		||||
      this.dialogQuery.pageSize = 10
 | 
			
		||||
      this.getStoreCodeList()
 | 
			
		||||
    },
 | 
			
		||||
    resetDialogQuery() {
 | 
			
		||||
      this.dialogQuery.pageNum = 1
 | 
			
		||||
      this.dialogQuery.pageSize = 10
 | 
			
		||||
      this.dialogQuery.keyWord = ''
 | 
			
		||||
      this.getStoreCodeList()
 | 
			
		||||
    },
 | 
			
		||||
    handleDialogStoreExport() {
 | 
			
		||||
      this.download(
 | 
			
		||||
        'material/material_maMachine/exportStorageInfoList',
 | 
			
		||||
        { ...this.dialogQuery },
 | 
			
		||||
        `综合查询_在库设备_${new Date().getTime()}.xlsx`
 | 
			
		||||
        `设备编码详情_${new Date().getTime()}.xlsx`
 | 
			
		||||
      )
 | 
			
		||||
    }
 | 
			
		||||
    // ------------------
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,144 @@
 | 
			
		|||
<template>
 | 
			
		||||
  <div class="app-container" id="">
 | 
			
		||||
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
 | 
			
		||||
      <el-form-item label="关键字" prop="keyWord">
 | 
			
		||||
        <el-input
 | 
			
		||||
          v-model="queryParams.keyWord"
 | 
			
		||||
          placeholder="请输入关键字"
 | 
			
		||||
          clearable
 | 
			
		||||
          :maxlength="20"
 | 
			
		||||
          style="width: 240px"
 | 
			
		||||
        />
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-form-item>
 | 
			
		||||
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button>
 | 
			
		||||
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
    </el-form>
 | 
			
		||||
    <el-row :gutter="10" class="mb8">
 | 
			
		||||
      <el-col :span="1.5">
 | 
			
		||||
        <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出数据</el-button>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
 | 
			
		||||
    </el-row>
 | 
			
		||||
    <el-table v-loading="loading" :data="tableList" :max-height="650">
 | 
			
		||||
      <el-table-column
 | 
			
		||||
        label="序号"
 | 
			
		||||
        align="center"
 | 
			
		||||
        type="index"
 | 
			
		||||
        :index="indexContinuation(queryParams.pageNum, queryParams.pageSize)"
 | 
			
		||||
      />
 | 
			
		||||
      <el-table-column label="项目部名称" align="center" prop="proCenter" />
 | 
			
		||||
      <el-table-column label="工程名称" align="center" prop="proName">
 | 
			
		||||
        <template v-slot="{ row }">
 | 
			
		||||
          <span @click="openProDetails(row)" style="color: #409eff; cursor: pointer">{{ row.proName }}</span>
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
      <el-table-column label="总保有量" align="center" prop="allNum" width="180" />
 | 
			
		||||
    </el-table>
 | 
			
		||||
    <pagination
 | 
			
		||||
      v-show="total > 0"
 | 
			
		||||
      :total="total"
 | 
			
		||||
      :page.sync="queryParams.pageNum"
 | 
			
		||||
      :limit.sync="queryParams.pageSize"
 | 
			
		||||
      :page-sizes="[10, 20, 50, 100]"
 | 
			
		||||
      @pagination="getList"
 | 
			
		||||
    />
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import { getProTotalListApi } from '@/api/materialsStation'
 | 
			
		||||
export default {
 | 
			
		||||
  name: '',
 | 
			
		||||
  dicts: [],
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      // 遮罩层
 | 
			
		||||
      loading: false,
 | 
			
		||||
      // 选中数组
 | 
			
		||||
      ids: [],
 | 
			
		||||
      // 非单个禁用
 | 
			
		||||
      single: true,
 | 
			
		||||
      // 非多个禁用
 | 
			
		||||
      multiple: true,
 | 
			
		||||
      // 显示搜索条件
 | 
			
		||||
      showSearch: true,
 | 
			
		||||
      // 总条数
 | 
			
		||||
      total: 0,
 | 
			
		||||
      // 主表格数据
 | 
			
		||||
      tableList: [],
 | 
			
		||||
      // 查询参数
 | 
			
		||||
      queryParams: {
 | 
			
		||||
        pageNum: 1,
 | 
			
		||||
        pageSize: 10,
 | 
			
		||||
        keyWord: null
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  created() {
 | 
			
		||||
    this.getList()
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    // 获取列表
 | 
			
		||||
    async getList() {
 | 
			
		||||
      this.loading = true
 | 
			
		||||
      const params = {
 | 
			
		||||
        keyWord: this.queryParams.keyWord,
 | 
			
		||||
        pageSize: this.queryParams.pageSize,
 | 
			
		||||
        pageNum: this.queryParams.pageNum
 | 
			
		||||
      }
 | 
			
		||||
      try {
 | 
			
		||||
        const res = await getProTotalListApi(params)
 | 
			
		||||
        this.tableList = res.data.rows || []
 | 
			
		||||
        this.total = res.data.total || 0
 | 
			
		||||
        console.log('🚀 ~ getList ~ this.tableList:', this.tableList)
 | 
			
		||||
      } catch (error) {
 | 
			
		||||
        console.log('🚀 ~ getList ~ error:', error)
 | 
			
		||||
      } finally {
 | 
			
		||||
        this.loading = false
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    /** 搜索按钮操作 */
 | 
			
		||||
    handleQuery() {
 | 
			
		||||
      this.queryParams.pageNum = 1
 | 
			
		||||
      this.getList()
 | 
			
		||||
    },
 | 
			
		||||
    /** 重置按钮操作 */
 | 
			
		||||
    resetQuery() {
 | 
			
		||||
      this.resetForm('queryForm')
 | 
			
		||||
      this.handleQuery()
 | 
			
		||||
    },
 | 
			
		||||
    /** 导出按钮操作 */
 | 
			
		||||
    handleExport() {
 | 
			
		||||
      this.download(
 | 
			
		||||
        'material/material_maMachine/exportTotalList',
 | 
			
		||||
        {
 | 
			
		||||
          ...this.queryParams
 | 
			
		||||
        },
 | 
			
		||||
        `工器具台账_${new Date().getTime()}.xlsx`
 | 
			
		||||
      )
 | 
			
		||||
    },
 | 
			
		||||
    // 工程详情
 | 
			
		||||
    openProDetails(row) {
 | 
			
		||||
      this.$router.push({
 | 
			
		||||
        path: '/materialsStation/equipment/equipmentRecord/proDetails',
 | 
			
		||||
        query: {
 | 
			
		||||
          proId: row.proId,
 | 
			
		||||
          proCenter: row.proCenter
 | 
			
		||||
        }
 | 
			
		||||
      })
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
::v-deep.el-table .fixed-width .el-button--mini {
 | 
			
		||||
  width: 60px !important;
 | 
			
		||||
  margin-bottom: 10px;
 | 
			
		||||
}
 | 
			
		||||
.clickText {
 | 
			
		||||
  color: #02a7f0;
 | 
			
		||||
  cursor: pointer;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
		Loading…
	
		Reference in New Issue