projects/mesxc-zhp #161
							
								
								
									
										78
									
								
								src/api/cost/costEneryAutoReport.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										78
									
								
								src/api/cost/costEneryAutoReport.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,78 @@
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2023-11-23 14:57:00
 | 
			
		||||
 * @LastEditors: zwq
 | 
			
		||||
 * @LastEditTime: 2023-12-07 09:37:18
 | 
			
		||||
 * @Description:
 | 
			
		||||
 */
 | 
			
		||||
import request from '@/utils/request'
 | 
			
		||||
 | 
			
		||||
// 创建能源自动记录报
 | 
			
		||||
export function createCostEneryAutoReport(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/extend/cost-enery-auto-report/create',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 更新能源自动记录报
 | 
			
		||||
export function updateCostEneryAutoReport(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/extend/cost-enery-auto-report/update',
 | 
			
		||||
    method: 'put',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 删除能源自动记录报
 | 
			
		||||
export function deleteCostEneryAutoReport(id) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/extend/cost-enery-auto-report/delete?id=' + id,
 | 
			
		||||
    method: 'delete'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 获得能源自动记录报
 | 
			
		||||
export function getCostEneryAutoReport(id) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/extend/cost-enery-auto-report/get?id=' + id,
 | 
			
		||||
    method: 'get'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 获得能源自动记录报分页历史
 | 
			
		||||
export function getCostEneryAutoReportPage(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/extend/cost-enery-auto-report/page',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
// 获得能源查询
 | 
			
		||||
export function getCostEneryAutoPage(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/extend/cost-energy-search/getData',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
// 导出能源自动记录报 Excel
 | 
			
		||||
export function exportCostEneryAutoReportExcel(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/extend/cost-enery-auto-report/export-excel',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data,
 | 
			
		||||
    responseType: 'blob'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 导出能源自动记录报 Excel 查询
 | 
			
		||||
export function exportCostEneryExcel(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/extend/cost-energy-search/export-excel',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data,
 | 
			
		||||
    responseType: 'blob'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										73
									
								
								src/api/cost/costMaterialAutoReport.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										73
									
								
								src/api/cost/costMaterialAutoReport.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,73 @@
 | 
			
		||||
import request from '@/utils/request'
 | 
			
		||||
 | 
			
		||||
// 创建原料成本自动统计报
 | 
			
		||||
export function createCostMaterialAutoReport(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/extend/cost-material-auto-report/create',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 更新原料成本自动统计报
 | 
			
		||||
export function updateCostMaterialAutoReport(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/extend/cost-material-auto-report/update',
 | 
			
		||||
    method: 'put',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 删除原料成本自动统计报
 | 
			
		||||
export function deleteCostMaterialAutoReport(id) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/extend/cost-material-auto-report/delete?id=' + id,
 | 
			
		||||
    method: 'delete'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 获得原料成本自动统计报
 | 
			
		||||
export function getCostMaterialAutoReport(id) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/extend/cost-material-auto-report/get?id=' + id,
 | 
			
		||||
    method: 'get'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 获得原料成本自动统计报分页历史
 | 
			
		||||
export function getCostMaterialAutoReportPage(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/extend/cost-material-auto-report/page',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 获得原料成本查询
 | 
			
		||||
export function getCostMaterialSearchPage(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/extend/cost-material-search/getData',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 导出原料成本自动统计报 Excel
 | 
			
		||||
export function exportCostMaterialAutoReportExcel(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/extend/cost-material-auto-report/export-excel',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data,
 | 
			
		||||
    responseType: 'blob'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 导出原料成本自动统计报 Excel查询
 | 
			
		||||
export function exportCostMaterialSearch(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/extend/cost-material-search/export-excel',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data,
 | 
			
		||||
    responseType: 'blob'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										61
									
								
								src/api/cost/costMaterialSet.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										61
									
								
								src/api/cost/costMaterialSet.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,61 @@
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2023-11-15 09:24:30
 | 
			
		||||
 * @LastEditors: zwq
 | 
			
		||||
 * @LastEditTime: 2023-12-05 14:38:48
 | 
			
		||||
 * @Description:
 | 
			
		||||
 */
 | 
			
		||||
import request from '@/utils/request'
 | 
			
		||||
 | 
			
		||||
// 创建原料价位配置
 | 
			
		||||
export function createCostMaterialSet(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/extend/cost-material-set/create',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 更新原料价位配置
 | 
			
		||||
export function updateCostMaterialSet(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/extend/cost-material-set/update',
 | 
			
		||||
    method: 'put',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 删除原料价位配置
 | 
			
		||||
export function deleteCostMaterialSet(id) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/extend/cost-material-set/delete?id=' + id,
 | 
			
		||||
    method: 'delete'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 获得原料价位配置
 | 
			
		||||
export function getCostMaterialSet(id) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/extend/cost-material-set/get?id=' + id,
 | 
			
		||||
    method: 'get'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 获得原料价位配置分页
 | 
			
		||||
export function getCostMaterialSetPage(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/extend/cost-material-set/page',
 | 
			
		||||
    method: 'POST',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 导出原料价位配置 Excel
 | 
			
		||||
export function exportCostMaterialSetExcel(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/extend/cost-material-set/export-excel',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query,
 | 
			
		||||
    responseType: 'blob'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										162
									
								
								src/views/cost/energyCost/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										162
									
								
								src/views/cost/energyCost/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,162 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
		<!-- 搜索工作栏 -->
 | 
			
		||||
		<search-bar
 | 
			
		||||
			:formConfigs="formConfig"
 | 
			
		||||
			ref="searchBarForm"
 | 
			
		||||
			@headBtnClick="buttonClick" />
 | 
			
		||||
 | 
			
		||||
		<!-- 列表 -->
 | 
			
		||||
		<base-table
 | 
			
		||||
			v-loading="dataListLoading"
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:page="listQuery.pageNo"
 | 
			
		||||
			:limit="listQuery.pageSize"
 | 
			
		||||
			:table-data="tableData"></base-table>
 | 
			
		||||
		<pagination
 | 
			
		||||
			:limit.sync="listQuery.pageSize"
 | 
			
		||||
			:page.sync="listQuery.pageNo"
 | 
			
		||||
			:total="listQuery.total"
 | 
			
		||||
			@pagination="getDataList" />
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import basicPage from '../mixins/basic-page';
 | 
			
		||||
import codeFilter from '../mixins/code-filter';
 | 
			
		||||
import {
 | 
			
		||||
	getCostEneryAutoPage,
 | 
			
		||||
	exportCostEneryExcel,
 | 
			
		||||
} from '@/api/cost/costEneryAutoReport';
 | 
			
		||||
import { getEnergyTypeListAll } from '@/api/base/energyType';
 | 
			
		||||
import { publicFormatter } from '@/utils/dict';
 | 
			
		||||
 | 
			
		||||
const tableProps = [
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'energyTypeName',
 | 
			
		||||
		label: '能源类型',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'objName',
 | 
			
		||||
		label: '监控对象',
 | 
			
		||||
		filter: (val) => (val != null ? val : '--'),
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'tableName',
 | 
			
		||||
		label: '水/气表名',
 | 
			
		||||
		filter: (val) => (val != null ? val : '--'),
 | 
			
		||||
		filter: publicFormatter('table_name'),
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'totalUsed',
 | 
			
		||||
		label: '累计使用量',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'totalCost',
 | 
			
		||||
		label: '总价',
 | 
			
		||||
		align: 'right',
 | 
			
		||||
	},
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	mixins: [basicPage],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			urlOptions: {
 | 
			
		||||
				getDataListURL: getCostEneryAutoPage,
 | 
			
		||||
        exportURL: exportCostEneryExcel
 | 
			
		||||
			},
 | 
			
		||||
			tableData: [],
 | 
			
		||||
			tableProps,
 | 
			
		||||
			drawerVisible: false,
 | 
			
		||||
			formConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'select',
 | 
			
		||||
					label: '能源类型',
 | 
			
		||||
					selectOptions: [],
 | 
			
		||||
					param: 'energyTypeId',
 | 
			
		||||
					filterable: true,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'datePicker',
 | 
			
		||||
					label: '时间范围',
 | 
			
		||||
					dateType: 'daterange',
 | 
			
		||||
					format: 'yyyy-MM-dd',
 | 
			
		||||
					valueFormat: 'timestamp',
 | 
			
		||||
					rangeSeparator: '-',
 | 
			
		||||
					startPlaceholder: '开始时间',
 | 
			
		||||
					endPlaceholder: '结束时间',
 | 
			
		||||
					param: 'searchTime',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('cost:energyCost:export')
 | 
			
		||||
						? 'button'
 | 
			
		||||
						: '',
 | 
			
		||||
					btnName: '导出',
 | 
			
		||||
					name: 'export',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
					plain: true,
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	components: {},
 | 
			
		||||
	created() {
 | 
			
		||||
		getEnergyTypeListAll().then((response) => {
 | 
			
		||||
			this.formConfig[0].selectOptions = response.data;
 | 
			
		||||
		});
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
    // 获取数据列表
 | 
			
		||||
    getDataList() {
 | 
			
		||||
      if(this.listQuery.searchTime){
 | 
			
		||||
      this.dataListLoading = true;
 | 
			
		||||
      this.urlOptions.getDataListURL(this.listQuery).then(response => {
 | 
			
		||||
        if(response.hasOwnProperty('data')){
 | 
			
		||||
          this.tableData = response.data.list;
 | 
			
		||||
          this.listQuery.total = response.data.total;
 | 
			
		||||
        }
 | 
			
		||||
        this.dataListLoading = false;
 | 
			
		||||
      });
 | 
			
		||||
    }else{
 | 
			
		||||
      this.$message.warning('请选择时间范围')
 | 
			
		||||
    }
 | 
			
		||||
    },
 | 
			
		||||
		buttonClick(val) {
 | 
			
		||||
			switch (val.btnName) {
 | 
			
		||||
				case 'search':
 | 
			
		||||
					this.listQuery.pageNo = 1;
 | 
			
		||||
					this.listQuery.pageSize = 10;
 | 
			
		||||
					this.listQuery.energyTypeId = val.energyTypeId;
 | 
			
		||||
          this.listQuery.searchTime = val.searchTime ? val.searchTime[0] : null;
 | 
			
		||||
					this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
 | 
			
		||||
					this.listQuery.endTime = val.searchTime ? val.searchTime[1] : null;
 | 
			
		||||
					this.getDataList();
 | 
			
		||||
					break;
 | 
			
		||||
				case 'export':
 | 
			
		||||
          const data = {
 | 
			
		||||
            energyTypeId:val.energyTypeId,
 | 
			
		||||
            startTime : val.searchTime ? val.searchTime[0] : null,
 | 
			
		||||
            endTime : val.searchTime ? val.searchTime[1] : null,
 | 
			
		||||
          }
 | 
			
		||||
					this.handleExport(data);
 | 
			
		||||
					break;
 | 
			
		||||
				default:
 | 
			
		||||
					console.log(val);
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
<style>
 | 
			
		||||
.app-container .el-table .el-table__cell {
 | 
			
		||||
	padding: 0;
 | 
			
		||||
	height: 35px;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										173
									
								
								src/views/cost/energyCostHis/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										173
									
								
								src/views/cost/energyCostHis/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,173 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
		<!-- 搜索工作栏 -->
 | 
			
		||||
		<search-bar
 | 
			
		||||
			:formConfigs="formConfig"
 | 
			
		||||
			ref="searchBarForm"
 | 
			
		||||
			@headBtnClick="buttonClick" />
 | 
			
		||||
 | 
			
		||||
		<!-- 列表 -->
 | 
			
		||||
		<base-table
 | 
			
		||||
			v-loading="dataListLoading"
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:page="listQuery.pageNo"
 | 
			
		||||
			:limit="listQuery.pageSize"
 | 
			
		||||
			:table-data="tableData"></base-table>
 | 
			
		||||
		<pagination
 | 
			
		||||
			:limit.sync="listQuery.pageSize"
 | 
			
		||||
			:page.sync="listQuery.pageNo"
 | 
			
		||||
			:total="listQuery.total"
 | 
			
		||||
			@pagination="getDataList" />
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import basicPage from '../mixins/basic-page';
 | 
			
		||||
import codeFilter from '../mixins/code-filter';
 | 
			
		||||
import {
 | 
			
		||||
	getCostEneryAutoReportPage,
 | 
			
		||||
	exportCostEneryAutoReportExcel,
 | 
			
		||||
} from '@/api/cost/costEneryAutoReport';
 | 
			
		||||
import { getEnergyTypeListAll } from '@/api/base/energyType';
 | 
			
		||||
import { publicFormatter } from '@/utils/dict';
 | 
			
		||||
 | 
			
		||||
const tableProps = [
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'reportType',
 | 
			
		||||
		label: '维度',
 | 
			
		||||
		filter: codeFilter('reportType'),
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'reportName',
 | 
			
		||||
		label: '时间',
 | 
			
		||||
		minWidth: 150,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'energyType',
 | 
			
		||||
		label: '能源类型',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'objName',
 | 
			
		||||
		label: '监控对象',
 | 
			
		||||
		filter: (val) => (val != null ? val : '--'),
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'tableName',
 | 
			
		||||
		label: '水/气表名',
 | 
			
		||||
		filter: (val) => (val != null ? val : '--'),
 | 
			
		||||
		filter: publicFormatter('table_name'),
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'totalUsed',
 | 
			
		||||
		label: '累计使用量',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'totalCost',
 | 
			
		||||
		label: '总价',
 | 
			
		||||
		align: 'right',
 | 
			
		||||
	},
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	mixins: [basicPage],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			urlOptions: {
 | 
			
		||||
				getDataListURL: getCostEneryAutoReportPage,
 | 
			
		||||
				exportURL: exportCostEneryAutoReportExcel,
 | 
			
		||||
			},
 | 
			
		||||
			tableData: [],
 | 
			
		||||
			tableProps,
 | 
			
		||||
			drawerVisible: false,
 | 
			
		||||
			listQuery: {
 | 
			
		||||
				reportType: 2,
 | 
			
		||||
			},
 | 
			
		||||
			formConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'select',
 | 
			
		||||
					label: '维度',
 | 
			
		||||
					selectOptions: [
 | 
			
		||||
						{ id: 2, name: '日' },
 | 
			
		||||
						{ id: 3, name: '周' },
 | 
			
		||||
						{ id: 4, name: '月' },
 | 
			
		||||
						{ id: 5, name: '年' },
 | 
			
		||||
					],
 | 
			
		||||
					param: 'reportType',
 | 
			
		||||
					filterable: true,
 | 
			
		||||
					defaultSelect: 2, // 默认值
 | 
			
		||||
					clearable: false,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'select',
 | 
			
		||||
					label: '能源类型',
 | 
			
		||||
					selectOptions: [],
 | 
			
		||||
					param: 'energyTypeId',
 | 
			
		||||
					filterable: true,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'datePicker',
 | 
			
		||||
					label: '时间范围',
 | 
			
		||||
					dateType: 'daterange',
 | 
			
		||||
					format: 'yyyy-MM-dd',
 | 
			
		||||
					valueFormat: 'timestamp',
 | 
			
		||||
					rangeSeparator: '-',
 | 
			
		||||
					startPlaceholder: '开始时间',
 | 
			
		||||
					endPlaceholder: '结束时间',
 | 
			
		||||
					param: 'searchTime',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('cost:energyCostHis:export')
 | 
			
		||||
						? 'button'
 | 
			
		||||
						: '',
 | 
			
		||||
					btnName: '导出',
 | 
			
		||||
					name: 'export',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
					plain: true,
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	components: {},
 | 
			
		||||
	created() {
 | 
			
		||||
		getEnergyTypeListAll().then((response) => {
 | 
			
		||||
			this.formConfig[1].selectOptions = response.data;
 | 
			
		||||
		});
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		buttonClick(val) {
 | 
			
		||||
			switch (val.btnName) {
 | 
			
		||||
				case 'search':
 | 
			
		||||
					this.listQuery.pageNo = 1;
 | 
			
		||||
					this.listQuery.pageSize = 10;
 | 
			
		||||
					this.listQuery.reportType = val.reportType;
 | 
			
		||||
					this.listQuery.energyTypeId = val.energyTypeId;
 | 
			
		||||
					this.listQuery.reportTime = val.searchTime ? val.searchTime : null;
 | 
			
		||||
					this.getDataList();
 | 
			
		||||
					break;
 | 
			
		||||
				case 'export':
 | 
			
		||||
          const data = {
 | 
			
		||||
            reportType: val.reportType,
 | 
			
		||||
            energyTypeId: val.energyTypeId,
 | 
			
		||||
            reportTime: val.searchTime ? val.searchTime : null
 | 
			
		||||
          }
 | 
			
		||||
					this.handleExport(data);
 | 
			
		||||
					break;
 | 
			
		||||
				default:
 | 
			
		||||
					console.log(val);
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
<style>
 | 
			
		||||
.app-container .el-table .el-table__cell {
 | 
			
		||||
	padding: 0;
 | 
			
		||||
	height: 35px;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										121
									
								
								src/views/cost/mixins/basic-add.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										121
									
								
								src/views/cost/mixins/basic-add.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,121 @@
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2022-08-24 11:19:43
 | 
			
		||||
 * @LastEditors: zwq
 | 
			
		||||
 * @LastEditTime: 2023-11-02 15:33:39
 | 
			
		||||
 * @Description:
 | 
			
		||||
 */
 | 
			
		||||
import { listData } from "@/api/system/dict/data";
 | 
			
		||||
export default {
 | 
			
		||||
  data() {
 | 
			
		||||
    /* eslint-disable */
 | 
			
		||||
    return {
 | 
			
		||||
      urlOptions: {
 | 
			
		||||
        createURL: '',
 | 
			
		||||
        updateURL: '',
 | 
			
		||||
        infoURL: '',
 | 
			
		||||
        codeURL: '',
 | 
			
		||||
        getOption: false, //是否加载获取下拉框方法
 | 
			
		||||
        isGetCode: false, //是否加载获取code方法
 | 
			
		||||
        getDictList: false, //是否加载获取数据字典方法
 | 
			
		||||
        optionArrUrl: [], //需要获取下拉框的方法数组
 | 
			
		||||
        optionArr: {}, //需要获取下拉框的方法数组的返回结果
 | 
			
		||||
        dictList: {}, //需要获取数据字典的方法数组的返回结果
 | 
			
		||||
      },
 | 
			
		||||
      visible: false,
 | 
			
		||||
      setData: false
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  created() {
 | 
			
		||||
  },
 | 
			
		||||
  activated() {
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    init(id) {
 | 
			
		||||
      this.dataForm.id = id || "";
 | 
			
		||||
      this.visible = true;
 | 
			
		||||
      if (this.urlOptions.getOption) {
 | 
			
		||||
        this.getArr()
 | 
			
		||||
      }
 | 
			
		||||
      if (this.urlOptions.getDictList) {
 | 
			
		||||
        this.getDict()
 | 
			
		||||
      }
 | 
			
		||||
      this.$nextTick(() => {
 | 
			
		||||
        this.$refs["dataForm"].resetFields();
 | 
			
		||||
        if (this.dataForm.id) {
 | 
			
		||||
          this.urlOptions.infoURL(id).then(response => {
 | 
			
		||||
            this.dataForm = response.data;
 | 
			
		||||
            if (this.setData) {
 | 
			
		||||
              this.setDataForm()
 | 
			
		||||
            }
 | 
			
		||||
          });
 | 
			
		||||
        } else {
 | 
			
		||||
          if (this.urlOptions.isGetCode) {
 | 
			
		||||
            this.getCode()
 | 
			
		||||
          }
 | 
			
		||||
				}
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
		getCode() {
 | 
			
		||||
			this.urlOptions.codeURL()
 | 
			
		||||
				.then(({ data: res }) => {
 | 
			
		||||
					this.dataForm.code = res;
 | 
			
		||||
				})
 | 
			
		||||
				.catch(() => {});
 | 
			
		||||
		},
 | 
			
		||||
    getArr() {
 | 
			
		||||
      const params = {
 | 
			
		||||
        pageSize: 100,
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
      }
 | 
			
		||||
      this.urlOptions.optionArrUrl.forEach((item, index) => {
 | 
			
		||||
        item(params).then(({ data: res }) => {
 | 
			
		||||
          this.$set(this.urlOptions.optionArr, `arr${index}`, res.list)
 | 
			
		||||
        })
 | 
			
		||||
          .catch(() => {
 | 
			
		||||
          });
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
    /** 查询字典数据列表 */
 | 
			
		||||
    getDict() {
 | 
			
		||||
      this.nameList.forEach((item,index)=>{
 | 
			
		||||
        const queryParams = {
 | 
			
		||||
          pageNo: 1,
 | 
			
		||||
          pageSize: 99,
 | 
			
		||||
          dictType: item,
 | 
			
		||||
        }
 | 
			
		||||
        listData(queryParams).then(response => {
 | 
			
		||||
          this.$set(this.urlOptions.dictList, `dict${index}`, response.data.list)
 | 
			
		||||
        });
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    // 表单提交
 | 
			
		||||
    dataFormSubmit() {
 | 
			
		||||
      this.$refs["dataForm"].validate((valid) => {
 | 
			
		||||
        if (!valid) {
 | 
			
		||||
          return false;
 | 
			
		||||
        }
 | 
			
		||||
        // 修改的提交
 | 
			
		||||
        if (this.dataForm.id) {
 | 
			
		||||
          this.urlOptions.updateURL(this.dataForm).then(response => {
 | 
			
		||||
            this.$modal.msgSuccess("修改成功");
 | 
			
		||||
            this.visible = false;
 | 
			
		||||
            this.$emit("refreshDataList");
 | 
			
		||||
          });
 | 
			
		||||
          return;
 | 
			
		||||
        }
 | 
			
		||||
        // 添加的提交
 | 
			
		||||
        this.urlOptions.createURL(this.dataForm).then(response => {
 | 
			
		||||
          this.$modal.msgSuccess("新增成功");
 | 
			
		||||
          this.visible = false;
 | 
			
		||||
          this.$emit("refreshDataList");
 | 
			
		||||
        });
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
    formClear() {
 | 
			
		||||
      if (this.$refs.dataForm!==undefined) {
 | 
			
		||||
          this.$refs.dataForm.resetFields();
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										172
									
								
								src/views/cost/mixins/basic-page.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										172
									
								
								src/views/cost/mixins/basic-page.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,172 @@
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2022-08-24 11:19:43
 | 
			
		||||
 * @LastEditors: zwq
 | 
			
		||||
 * @LastEditTime: 2023-12-07 09:35:33
 | 
			
		||||
 * @Description:
 | 
			
		||||
 */
 | 
			
		||||
export default {
 | 
			
		||||
  data() {
 | 
			
		||||
    /* eslint-disable */
 | 
			
		||||
    return {
 | 
			
		||||
      urlOptions: {
 | 
			
		||||
        getDataListURL: '',
 | 
			
		||||
        deleteURL: '',
 | 
			
		||||
        statusUrl: '',
 | 
			
		||||
        exportURL: ''
 | 
			
		||||
      },
 | 
			
		||||
      tableData: [],
 | 
			
		||||
      listQuery: {
 | 
			
		||||
        pageSize: 10,
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        total: 1,
 | 
			
		||||
      },
 | 
			
		||||
      exportLoading: false,
 | 
			
		||||
      dataListLoading: false,
 | 
			
		||||
      addOrEditTitle: '',
 | 
			
		||||
      addOrUpdateVisible: false,
 | 
			
		||||
      addOrUpdate:'addOrUpdate'
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  created() {
 | 
			
		||||
  },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    this.getDataList()
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    // 获取数据列表
 | 
			
		||||
    getDataList() {
 | 
			
		||||
      this.dataListLoading = true;
 | 
			
		||||
      this.urlOptions.getDataListURL(this.listQuery).then(response => {
 | 
			
		||||
        if(response.hasOwnProperty('data')){
 | 
			
		||||
          this.tableData = response.data.list;
 | 
			
		||||
          this.listQuery.total = response.data.total;
 | 
			
		||||
        }
 | 
			
		||||
        this.dataListLoading = false;
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
    // 每页数
 | 
			
		||||
    sizeChangeHandle(val) {
 | 
			
		||||
      this.listQuery.pageSize = val;
 | 
			
		||||
      this.listQuery.pageNo = 1;
 | 
			
		||||
      this.getDataList();
 | 
			
		||||
    },
 | 
			
		||||
    // 当前页
 | 
			
		||||
    currentChangeHandle(val) {
 | 
			
		||||
      this.listQuery.pageNo = val;
 | 
			
		||||
      this.getDataList();
 | 
			
		||||
    },
 | 
			
		||||
    // 新增 / 修改
 | 
			
		||||
    addOrUpdateHandle(id) {
 | 
			
		||||
      this.addOrUpdateVisible = true;
 | 
			
		||||
      this.$nextTick(() => {
 | 
			
		||||
        this.$refs.addOrUpdate.init(id);
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
    cancel(id) {
 | 
			
		||||
      this.$refs["popover-" + id].showPopper = false;
 | 
			
		||||
    },
 | 
			
		||||
    //改变状态
 | 
			
		||||
    changeStatus(id) {
 | 
			
		||||
      this.$http
 | 
			
		||||
        .post(this.urlOptions.statusUrl, { id })
 | 
			
		||||
        .then(({ data: res }) => {
 | 
			
		||||
          if (res.code !== 0) {
 | 
			
		||||
            return this.$message.error(res.msg);
 | 
			
		||||
          }
 | 
			
		||||
          this.$refs["popover-" + id].showPopper = false;
 | 
			
		||||
          this.$message({
 | 
			
		||||
            message: this.$t("prompt.success"),
 | 
			
		||||
            type: "success",
 | 
			
		||||
            duration: 500,
 | 
			
		||||
            onClose: () => {
 | 
			
		||||
              this.getDataList();
 | 
			
		||||
            },
 | 
			
		||||
          });
 | 
			
		||||
        })
 | 
			
		||||
        .catch(() => { });
 | 
			
		||||
    },
 | 
			
		||||
    //tableBtn点击
 | 
			
		||||
    handleClick(val) {
 | 
			
		||||
      if (val.type === "edit") {
 | 
			
		||||
        this.addOrUpdateVisible = true;
 | 
			
		||||
        this.addOrEditTitle = "编辑";
 | 
			
		||||
        this.$nextTick(() => {
 | 
			
		||||
          this.$refs.addOrUpdate.init(val.data.id);
 | 
			
		||||
        });
 | 
			
		||||
      } else if (val.type === "delete") {
 | 
			
		||||
        this.deleteHandle(val.data.id, val.data.name, val.data._pageIndex)
 | 
			
		||||
      } else if (val.type === "change") {
 | 
			
		||||
        this.changeStatus(val.data.id)
 | 
			
		||||
      } else {
 | 
			
		||||
        this.otherMethods(val)
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    // 删除
 | 
			
		||||
    deleteHandle(id, name, index) {
 | 
			
		||||
      this.$confirm(`是否确认删除${name ? '名称为"' + name + '"' : '序号为"' + index + '"'}的数据项?`, "系统提示", {
 | 
			
		||||
        confirmButtonText: "确定",
 | 
			
		||||
        cancelButtonText: "取消",
 | 
			
		||||
        type: "warning",
 | 
			
		||||
      })
 | 
			
		||||
        .then(() => {
 | 
			
		||||
          this.urlOptions.deleteURL(id).then(({ data }) => {
 | 
			
		||||
            this.$message({
 | 
			
		||||
              message: "操作成功",
 | 
			
		||||
              type: "success",
 | 
			
		||||
              duration: 1500,
 | 
			
		||||
              onClose: () => {
 | 
			
		||||
                this.getDataList();
 | 
			
		||||
              },
 | 
			
		||||
            });
 | 
			
		||||
          });
 | 
			
		||||
        })
 | 
			
		||||
        .catch(() => { });
 | 
			
		||||
    },
 | 
			
		||||
    //search-bar点击
 | 
			
		||||
    buttonClick(val) {
 | 
			
		||||
      switch (val.btnName) {
 | 
			
		||||
        case "search":
 | 
			
		||||
          this.listQuery.xm1 = val.xm1;
 | 
			
		||||
          this.listQuery.xm2 = val.xm2;
 | 
			
		||||
          this.listQuery.pageNo = 1;
 | 
			
		||||
          this.getDataList();
 | 
			
		||||
          break;
 | 
			
		||||
        case "add":
 | 
			
		||||
          this.addOrEditTitle = '新增'
 | 
			
		||||
          this.addOrUpdateVisible = true;
 | 
			
		||||
          this.addOrUpdateHandle()
 | 
			
		||||
          break;
 | 
			
		||||
        default:
 | 
			
		||||
          console.log(val)
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    handleCancel() {
 | 
			
		||||
      this.$refs[this.addOrUpdate].formClear()
 | 
			
		||||
      this.addOrUpdateVisible = false
 | 
			
		||||
      this.addOrEditTitle = ''
 | 
			
		||||
      this.addOrUpdate = 'addOrUpdate'
 | 
			
		||||
    },
 | 
			
		||||
    handleConfirm() {
 | 
			
		||||
      this.$refs[this.addOrUpdate].dataFormSubmit()
 | 
			
		||||
    },
 | 
			
		||||
    successSubmit() {
 | 
			
		||||
      this.handleCancel()
 | 
			
		||||
      this.getDataList()
 | 
			
		||||
    },
 | 
			
		||||
    /** 导出按钮操作 */
 | 
			
		||||
    handleExport(data) {
 | 
			
		||||
      // 处理查询参数
 | 
			
		||||
      let params = data?{ ...data }:{ ...this.listQuery };
 | 
			
		||||
      params.pageNo = undefined;
 | 
			
		||||
      params.pageSize = undefined;
 | 
			
		||||
      this.$modal.confirm('是否确认导出所有数据项?').then(() => {
 | 
			
		||||
        this.exportLoading = true;
 | 
			
		||||
        return this.urlOptions.exportURL(params);
 | 
			
		||||
      }).then(response => {
 | 
			
		||||
        this.$download.excel(response, '报表.xls');
 | 
			
		||||
        this.exportLoading = false;
 | 
			
		||||
      }).catch(() => { });
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										79
									
								
								src/views/cost/mixins/code-filter.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										79
									
								
								src/views/cost/mixins/code-filter.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,79 @@
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * @Date: 2020-12-29 16:49:28
 | 
			
		||||
 * @LastEditors: zwq
 | 
			
		||||
 * @LastEditTime: 2023-12-07 10:00:51
 | 
			
		||||
 * @FilePath: \basic-admin\src\filters\basicData\index.js
 | 
			
		||||
 * @Description:
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
const table = {
 | 
			
		||||
  lineStatus: {
 | 
			
		||||
    1: '生产中',
 | 
			
		||||
    2: '停止',
 | 
			
		||||
    3: '未知',
 | 
			
		||||
  },
 | 
			
		||||
  deactivate: {
 | 
			
		||||
    1: '启用',
 | 
			
		||||
    0: '停用',
 | 
			
		||||
  },
 | 
			
		||||
  wareType: {
 | 
			
		||||
    1: '缓存',
 | 
			
		||||
    2: '活动',
 | 
			
		||||
    3: '其它',
 | 
			
		||||
  },
 | 
			
		||||
  reportType: {
 | 
			
		||||
    2: '日',
 | 
			
		||||
    3: '周',
 | 
			
		||||
    4: '月',
 | 
			
		||||
    5: '年',
 | 
			
		||||
  },
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 日期格式化
 | 
			
		||||
export function parseTime(time, pattern) {
 | 
			
		||||
  if (arguments.length === 0 || !time) {
 | 
			
		||||
    return null
 | 
			
		||||
  }
 | 
			
		||||
  const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}'
 | 
			
		||||
  let date
 | 
			
		||||
  if (typeof time === 'object') {
 | 
			
		||||
    date = time
 | 
			
		||||
  } else {
 | 
			
		||||
    if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
 | 
			
		||||
      time = parseInt(time)
 | 
			
		||||
    } else if (typeof time === 'string') {
 | 
			
		||||
      time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.\d{3}/gm),'');
 | 
			
		||||
    }
 | 
			
		||||
    if ((typeof time === 'number') && (time.toString().length === 10)) {
 | 
			
		||||
      time = time * 1000
 | 
			
		||||
    }
 | 
			
		||||
    date = new Date(time)
 | 
			
		||||
  }
 | 
			
		||||
  const formatObj = {
 | 
			
		||||
    y: date.getFullYear(),
 | 
			
		||||
    m: date.getMonth() + 1,
 | 
			
		||||
    d: date.getDate(),
 | 
			
		||||
    h: date.getHours(),
 | 
			
		||||
    i: date.getMinutes(),
 | 
			
		||||
    s: date.getSeconds(),
 | 
			
		||||
    a: date.getDay()
 | 
			
		||||
  }
 | 
			
		||||
  const time_str = format.replace(/{([ymdhisa])+}/g, (result, key) => {
 | 
			
		||||
    let value = formatObj[key]
 | 
			
		||||
    // Note: getDay() returns 0 on Sunday
 | 
			
		||||
    if (key === 'a') {
 | 
			
		||||
      return ['日', '一', '二', '三', '四', '五', '六'][value]
 | 
			
		||||
    }
 | 
			
		||||
    if (result.length > 0 && value < 10) {
 | 
			
		||||
      value = '0' + value
 | 
			
		||||
    }
 | 
			
		||||
    return value || 0
 | 
			
		||||
  })
 | 
			
		||||
  return time_str
 | 
			
		||||
}
 | 
			
		||||
export default function (dictTable) {
 | 
			
		||||
  return function (val) {
 | 
			
		||||
    return table?.[dictTable]?.[val]
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										23
									
								
								src/views/cost/mixins/connectTime.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								src/views/cost/mixins/connectTime.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,23 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2023-12-05 13:45:59
 | 
			
		||||
 * @LastEditors: zwq
 | 
			
		||||
 * @LastEditTime: 2023-12-06 15:54:40
 | 
			
		||||
 * @Description
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
	<div>
 | 
			
		||||
		<span>{{ parseTime(injectData.enableTime,'{y}年{m}月{d}日') + '-' + (parseTime(injectData.disableTime)?parseTime(injectData.disableTime,'{y}年{m}月{d}日'):'永久') }}</span>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
export default {
 | 
			
		||||
	name: '',
 | 
			
		||||
	props: {
 | 
			
		||||
		injectData: {
 | 
			
		||||
			type: Object,
 | 
			
		||||
			default: () => ({}),
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										166
									
								
								src/views/cost/rawMaterialConfig/add-or-updata.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										166
									
								
								src/views/cost/rawMaterialConfig/add-or-updata.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,166 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2023-08-01 13:52:10
 | 
			
		||||
 * @LastEditors: zwq
 | 
			
		||||
 * @LastEditTime: 2023-12-05 15:41:39
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
	<el-form
 | 
			
		||||
		:model="dataForm"
 | 
			
		||||
		:rules="dataRule"
 | 
			
		||||
		ref="dataForm"
 | 
			
		||||
		v-if="visible"
 | 
			
		||||
		@keyup.enter.native="dataFormSubmit()"
 | 
			
		||||
		label-width="100px"
 | 
			
		||||
		label-position="top">
 | 
			
		||||
		<el-row :gutter="20">
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item label="原料名称" prop="materialId">
 | 
			
		||||
					<el-select
 | 
			
		||||
						v-model="dataForm.materialId"
 | 
			
		||||
						filterable
 | 
			
		||||
						clearable
 | 
			
		||||
						@change="setCode"
 | 
			
		||||
						:style="{ width: '100%' }"
 | 
			
		||||
						placeholder="请选择原料名称">
 | 
			
		||||
						<el-option
 | 
			
		||||
							v-for="item in MaterialList"
 | 
			
		||||
							:key="item.id"
 | 
			
		||||
							:label="item.name"
 | 
			
		||||
							:value="item.id"></el-option>
 | 
			
		||||
					</el-select>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item label="原料等级" prop="grade">
 | 
			
		||||
					<el-select
 | 
			
		||||
						v-model="dataForm.grade"
 | 
			
		||||
						filterable
 | 
			
		||||
						clearable
 | 
			
		||||
						:style="{ width: '100%' }"
 | 
			
		||||
						placeholder="请选择原料等级">
 | 
			
		||||
						<el-option
 | 
			
		||||
							v-for="item in urlOptions.dictList.dict0"
 | 
			
		||||
							:key="item.id"
 | 
			
		||||
							:label="item.label"
 | 
			
		||||
							:value="parseInt(item.value)"></el-option>
 | 
			
		||||
					</el-select>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item label="原料编码" prop="code">
 | 
			
		||||
					<el-input v-model="dataForm.code" clearable readonly />
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item label="单价" prop="price">
 | 
			
		||||
					<el-input-number
 | 
			
		||||
						:min="0"
 | 
			
		||||
						style="width: 80%"
 | 
			
		||||
						v-model="dataForm.price"
 | 
			
		||||
						clearable
 | 
			
		||||
						placeholder="请输入允许留存时间" />
 | 
			
		||||
					(元/吨)
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item label="生效开始时间" prop="enabledTime">
 | 
			
		||||
					<el-date-picker
 | 
			
		||||
						v-model="dataForm.enabledTime"
 | 
			
		||||
						type="datetime"
 | 
			
		||||
						value-format="timestamp"
 | 
			
		||||
						:style="{ width: '100%' }"
 | 
			
		||||
						placeholder="选择开始时间"></el-date-picker>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item label="生效结束时间" prop="disabledTime">
 | 
			
		||||
					<el-date-picker
 | 
			
		||||
						v-model="dataForm.disabledTime"
 | 
			
		||||
						type="datetime"
 | 
			
		||||
						value-format="timestamp"
 | 
			
		||||
						:style="{ width: '100%' }"
 | 
			
		||||
						placeholder="选择结束时间"></el-date-picker>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item label="备注" prop="remark">
 | 
			
		||||
					<el-input
 | 
			
		||||
						v-model="dataForm.remark"
 | 
			
		||||
						clearable
 | 
			
		||||
						placeholder="请输入备注" />
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
		</el-row>
 | 
			
		||||
	</el-form>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import basicAdd from '../mixins/basic-add';
 | 
			
		||||
import {
 | 
			
		||||
	createCostMaterialSet,
 | 
			
		||||
	updateCostMaterialSet,
 | 
			
		||||
	getCostMaterialSet,
 | 
			
		||||
} from '@/api/cost/costMaterialSet';
 | 
			
		||||
import { getHotMaterialList } from '@/api/base/coreHotMaterial';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	mixins: [basicAdd],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			urlOptions: {
 | 
			
		||||
				getDictList: true,
 | 
			
		||||
				createURL: createCostMaterialSet,
 | 
			
		||||
				updateURL: updateCostMaterialSet,
 | 
			
		||||
				infoURL: getCostMaterialSet,
 | 
			
		||||
				getOption: true,
 | 
			
		||||
			},
 | 
			
		||||
			nameList: ['material_grade'],
 | 
			
		||||
			dataForm: {
 | 
			
		||||
				id: undefined,
 | 
			
		||||
				code: '',
 | 
			
		||||
				materialId: '',
 | 
			
		||||
				price: '',
 | 
			
		||||
				grade: '',
 | 
			
		||||
				enabledTime: new Date().getTime(),
 | 
			
		||||
				disabledTime: null,
 | 
			
		||||
				remark: '',
 | 
			
		||||
			},
 | 
			
		||||
			setData: true,
 | 
			
		||||
			MaterialList: [],
 | 
			
		||||
			dataRule: {
 | 
			
		||||
				materialId: [
 | 
			
		||||
					{ required: true, message: '原料不能为空', trigger: 'change' },
 | 
			
		||||
				],
 | 
			
		||||
				price: [{ required: true, message: '单价不能为空', trigger: 'blur' }],
 | 
			
		||||
				enabledTime: [
 | 
			
		||||
					{
 | 
			
		||||
						required: true,
 | 
			
		||||
						message: '生效开始时间不能为空',
 | 
			
		||||
						trigger: 'change',
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
			},
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	created() {},
 | 
			
		||||
	methods: {
 | 
			
		||||
		getArr() {
 | 
			
		||||
			getHotMaterialList().then((response) => {
 | 
			
		||||
				this.MaterialList = response.data;
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		setDataForm() {
 | 
			
		||||
			this.setCode();
 | 
			
		||||
		},
 | 
			
		||||
		setCode() {
 | 
			
		||||
			this.MaterialList.forEach((item) => {
 | 
			
		||||
				if (item.id === this.dataForm.materialId) {
 | 
			
		||||
					this.dataForm.code = item.code;
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										186
									
								
								src/views/cost/rawMaterialConfig/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										186
									
								
								src/views/cost/rawMaterialConfig/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,186 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
		<!-- 搜索工作栏 -->
 | 
			
		||||
		<search-bar
 | 
			
		||||
			:formConfigs="formConfig"
 | 
			
		||||
			ref="searchBarForm"
 | 
			
		||||
			@headBtnClick="buttonClick" />
 | 
			
		||||
 | 
			
		||||
		<!-- 列表 -->
 | 
			
		||||
		<base-table
 | 
			
		||||
			v-loading="dataListLoading"
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:page="listQuery.pageNo"
 | 
			
		||||
			:limit="listQuery.pageSize"
 | 
			
		||||
			:table-data="tableData">
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				:width="80"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleClick" />
 | 
			
		||||
		</base-table>
 | 
			
		||||
		<pagination
 | 
			
		||||
			:limit.sync="listQuery.pageSize"
 | 
			
		||||
			:page.sync="listQuery.pageNo"
 | 
			
		||||
			:total="listQuery.total"
 | 
			
		||||
			@pagination="getDataList" />
 | 
			
		||||
 | 
			
		||||
		<!-- 对话框(添加 / 修改) -->
 | 
			
		||||
		<base-dialog
 | 
			
		||||
			:dialogTitle="addOrEditTitle"
 | 
			
		||||
			:dialogVisible="addOrUpdateVisible"
 | 
			
		||||
			@cancel="handleCancel"
 | 
			
		||||
			@confirm="handleConfirm"
 | 
			
		||||
			:before-close="handleCancel"
 | 
			
		||||
			width="40%">
 | 
			
		||||
			<add-or-update
 | 
			
		||||
				ref="addOrUpdate"
 | 
			
		||||
				@refreshDataList="successSubmit"></add-or-update>
 | 
			
		||||
		</base-dialog>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import AddOrUpdate from './add-or-updata';
 | 
			
		||||
import basicPage from '../mixins/basic-page';
 | 
			
		||||
import { parseTime } from '../mixins/code-filter';
 | 
			
		||||
import {
 | 
			
		||||
	deleteCostMaterialSet,
 | 
			
		||||
	getCostMaterialSetPage,
 | 
			
		||||
} from '@/api/cost/costMaterialSet';
 | 
			
		||||
import { getHotMaterialList } from '@/api/base/coreHotMaterial';
 | 
			
		||||
import { publicFormatter } from '@/utils/dict';
 | 
			
		||||
 | 
			
		||||
const tableProps = [
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'rawMaterialName',
 | 
			
		||||
		label: '原料名称',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'code',
 | 
			
		||||
		label: '原料编码',
 | 
			
		||||
		width: 190,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'grade',
 | 
			
		||||
		label: '原料等级',
 | 
			
		||||
		filter: publicFormatter('material_grade'),
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'dailyUse',
 | 
			
		||||
		label: '单日消耗量(天)吨',
 | 
			
		||||
		width: 130,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'price',
 | 
			
		||||
		label: '单价(元/吨)',
 | 
			
		||||
		align: 'right',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'enabledTime',
 | 
			
		||||
		label: '生效时间',
 | 
			
		||||
		filter: parseTime,
 | 
			
		||||
		width: 150,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'remark',
 | 
			
		||||
		label: '备注',
 | 
			
		||||
	},
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	mixins: [basicPage],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			urlOptions: {
 | 
			
		||||
				getDataListURL: getCostMaterialSetPage,
 | 
			
		||||
				deleteURL: deleteCostMaterialSet,
 | 
			
		||||
			},
 | 
			
		||||
			tableProps,
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
				this.$auth.hasPermi(`cost:rawMaterialConfig:update`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'edit',
 | 
			
		||||
							btnName: '编辑',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi(`cost:rawMaterialConfig:delete`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'delete',
 | 
			
		||||
							btnName: '删除',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
			].filter((v) => v),
 | 
			
		||||
			tableData: [],
 | 
			
		||||
			formConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'select',
 | 
			
		||||
					label: '原料名称',
 | 
			
		||||
					selectOptions: [],
 | 
			
		||||
					param: 'name',
 | 
			
		||||
					filterable: true,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'separate',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('cost:rawMaterialConfig:create')
 | 
			
		||||
						? 'button'
 | 
			
		||||
						: '',
 | 
			
		||||
					btnName: '新增',
 | 
			
		||||
					name: 'add',
 | 
			
		||||
					color: 'success',
 | 
			
		||||
					plain: true,
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	components: {
 | 
			
		||||
		AddOrUpdate,
 | 
			
		||||
	},
 | 
			
		||||
	created() {
 | 
			
		||||
		getHotMaterialList().then((response) => {
 | 
			
		||||
			this.formConfig[0].selectOptions = response.data;
 | 
			
		||||
		});
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		buttonClick(val) {
 | 
			
		||||
			switch (val.btnName) {
 | 
			
		||||
				case 'search':
 | 
			
		||||
					this.listQuery.pageNo = 1;
 | 
			
		||||
					this.listQuery.pageSize = 10;
 | 
			
		||||
					this.listQuery.materialId = val.name;
 | 
			
		||||
					this.getDataList();
 | 
			
		||||
					break;
 | 
			
		||||
				case 'reset':
 | 
			
		||||
					this.$refs.searchBarForm.resetForm();
 | 
			
		||||
					this.listQuery = {
 | 
			
		||||
						pageSize: 10,
 | 
			
		||||
						pageNo: 1,
 | 
			
		||||
						total: 1,
 | 
			
		||||
					};
 | 
			
		||||
					this.getDataList();
 | 
			
		||||
					break;
 | 
			
		||||
				case 'add':
 | 
			
		||||
					this.addOrEditTitle = '新增';
 | 
			
		||||
					this.addOrUpdateVisible = true;
 | 
			
		||||
					this.addOrUpdateHandle();
 | 
			
		||||
					break;
 | 
			
		||||
				case 'export':
 | 
			
		||||
					this.handleExport();
 | 
			
		||||
					break;
 | 
			
		||||
				default:
 | 
			
		||||
					console.log(val);
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										166
									
								
								src/views/cost/rawMaterialCost/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										166
									
								
								src/views/cost/rawMaterialCost/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,166 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
		<!-- 搜索工作栏 -->
 | 
			
		||||
		<search-bar
 | 
			
		||||
			:formConfigs="formConfig"
 | 
			
		||||
			ref="searchBarForm"
 | 
			
		||||
			@headBtnClick="buttonClick" />
 | 
			
		||||
 | 
			
		||||
		<!-- 列表 -->
 | 
			
		||||
		<base-table
 | 
			
		||||
			v-loading="dataListLoading"
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:page="listQuery.pageNo"
 | 
			
		||||
			:limit="listQuery.pageSize"
 | 
			
		||||
			:table-data="tableData"></base-table>
 | 
			
		||||
		<pagination
 | 
			
		||||
			:limit.sync="listQuery.pageSize"
 | 
			
		||||
			:page.sync="listQuery.pageNo"
 | 
			
		||||
			:total="listQuery.total"
 | 
			
		||||
			@pagination="getDataList" />
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import basicPage from '../mixins/basic-page';
 | 
			
		||||
import connectTime from '../mixins/connectTime';
 | 
			
		||||
import {
 | 
			
		||||
	getCostMaterialSearchPage,
 | 
			
		||||
	exportCostMaterialSearch,
 | 
			
		||||
} from '@/api/cost/costMaterialAutoReport';
 | 
			
		||||
import { getHotMaterialList } from '@/api/base/coreHotMaterial';
 | 
			
		||||
import { publicFormatter } from '@/utils/dict';
 | 
			
		||||
 | 
			
		||||
const tableProps = [
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'rawMaterialName',
 | 
			
		||||
		label: '原料名称',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'grade',
 | 
			
		||||
		label: '原料等级',
 | 
			
		||||
		filter: publicFormatter('material_grade'),
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'price',
 | 
			
		||||
		label: '单价(元/吨)',
 | 
			
		||||
		align: 'right',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'reportName',
 | 
			
		||||
		label: '单价生效时间',
 | 
			
		||||
		minWidth: 190,
 | 
			
		||||
		subcomponent: connectTime,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'totalUsed',
 | 
			
		||||
		label: '累计使用量(吨)',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'totalCost',
 | 
			
		||||
		label: '总价(元)',
 | 
			
		||||
		align: 'right',
 | 
			
		||||
	},
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	mixins: [basicPage],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			urlOptions: {
 | 
			
		||||
				getDataListURL: getCostMaterialSearchPage,
 | 
			
		||||
				exportURL: exportCostMaterialSearch,
 | 
			
		||||
			},
 | 
			
		||||
			tableData: [],
 | 
			
		||||
			tableProps,
 | 
			
		||||
			drawerVisible: false,
 | 
			
		||||
			formConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'select',
 | 
			
		||||
					label: '原料名称',
 | 
			
		||||
					selectOptions: [],
 | 
			
		||||
					param: 'materialId',
 | 
			
		||||
					filterable: true,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'datePicker',
 | 
			
		||||
					label: '时间范围',
 | 
			
		||||
					dateType: 'daterange',
 | 
			
		||||
					format: 'yyyy-MM-dd',
 | 
			
		||||
					valueFormat: 'timestamp',
 | 
			
		||||
					rangeSeparator: '-',
 | 
			
		||||
					startPlaceholder: '开始时间',
 | 
			
		||||
					endPlaceholder: '结束时间',
 | 
			
		||||
					param: 'searchTime',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('cost:rawMaterialCost:export')
 | 
			
		||||
						? 'button'
 | 
			
		||||
						: '',
 | 
			
		||||
					btnName: '导出',
 | 
			
		||||
					name: 'export',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
					plain: true,
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	components: {},
 | 
			
		||||
	created() {
 | 
			
		||||
		getHotMaterialList().then((response) => {
 | 
			
		||||
			this.formConfig[0].selectOptions = response.data;
 | 
			
		||||
		});
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		// 获取数据列表
 | 
			
		||||
		getDataList() {
 | 
			
		||||
			if (this.listQuery.searchTime) {
 | 
			
		||||
				this.dataListLoading = true;
 | 
			
		||||
				this.urlOptions.getDataListURL(this.listQuery).then((response) => {
 | 
			
		||||
					if (response.hasOwnProperty('data')) {
 | 
			
		||||
						this.tableData = response.data.list;
 | 
			
		||||
						this.listQuery.total = response.data.total;
 | 
			
		||||
					}
 | 
			
		||||
					this.dataListLoading = false;
 | 
			
		||||
				});
 | 
			
		||||
			} else {
 | 
			
		||||
				this.$message.warning('请选择时间范围');
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		buttonClick(val) {
 | 
			
		||||
			switch (val.btnName) {
 | 
			
		||||
				case 'search':
 | 
			
		||||
					this.listQuery.pageNo = 1;
 | 
			
		||||
					this.listQuery.pageSize = 10;
 | 
			
		||||
					this.listQuery.materialId = val.materialId;
 | 
			
		||||
					this.listQuery.searchTime = val.searchTime ? val.searchTime[0] : null;
 | 
			
		||||
					this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
 | 
			
		||||
					this.listQuery.endTime = val.searchTime ? val.searchTime[1] : null;
 | 
			
		||||
					this.getDataList();
 | 
			
		||||
					break;
 | 
			
		||||
				case 'export':
 | 
			
		||||
					this.listQuery.materialId = val.materialId;
 | 
			
		||||
					this.listQuery.searchTime = val.searchTime ? val.searchTime[0] : null;
 | 
			
		||||
					this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
 | 
			
		||||
					this.listQuery.endTime = val.searchTime ? val.searchTime[1] : null;
 | 
			
		||||
					this.handleExport();
 | 
			
		||||
					break;
 | 
			
		||||
				default:
 | 
			
		||||
					console.log(val);
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
<style>
 | 
			
		||||
.app-container .el-table .el-table__cell {
 | 
			
		||||
	padding: 0;
 | 
			
		||||
	height: 35px;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										170
									
								
								src/views/cost/rawMaterialCostHis/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										170
									
								
								src/views/cost/rawMaterialCostHis/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,170 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
		<!-- 搜索工作栏 -->
 | 
			
		||||
		<search-bar
 | 
			
		||||
			:formConfigs="formConfig"
 | 
			
		||||
			ref="searchBarForm"
 | 
			
		||||
			@headBtnClick="buttonClick" />
 | 
			
		||||
 | 
			
		||||
		<!-- 列表 -->
 | 
			
		||||
		<base-table
 | 
			
		||||
			v-loading="dataListLoading"
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:page="listQuery.pageNo"
 | 
			
		||||
			:limit="listQuery.pageSize"
 | 
			
		||||
			:table-data="tableData"></base-table>
 | 
			
		||||
		<pagination
 | 
			
		||||
			:limit.sync="listQuery.pageSize"
 | 
			
		||||
			:page.sync="listQuery.pageNo"
 | 
			
		||||
			:total="listQuery.total"
 | 
			
		||||
			@pagination="getDataList" />
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import basicPage from '../mixins/basic-page';
 | 
			
		||||
import codeFilter from '../mixins/code-filter';
 | 
			
		||||
import {
 | 
			
		||||
	getCostMaterialAutoReportPage,
 | 
			
		||||
	exportCostMaterialAutoReportExcel,
 | 
			
		||||
} from '@/api/cost/costMaterialAutoReport';
 | 
			
		||||
import { getHotMaterialList } from '@/api/base/coreHotMaterial';
 | 
			
		||||
import { publicFormatter } from '@/utils/dict';
 | 
			
		||||
 | 
			
		||||
const tableProps = [
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'reportType',
 | 
			
		||||
		label: '维度',
 | 
			
		||||
		filter: codeFilter('reportType'),
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'reportName',
 | 
			
		||||
		label: '时间',
 | 
			
		||||
		minWidth: 150,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'rawMaterialName',
 | 
			
		||||
		label: '原料名称',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'grade',
 | 
			
		||||
		label: '原料等级',
 | 
			
		||||
		filter: publicFormatter('material_grade'),
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'price',
 | 
			
		||||
		label: '单价(元/吨)',
 | 
			
		||||
		align: 'right',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'totalUsed',
 | 
			
		||||
		label: '累计使用量(吨)',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'totalCost',
 | 
			
		||||
		label: '总价(元)',
 | 
			
		||||
		align: 'right',
 | 
			
		||||
	},
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	mixins: [basicPage],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			urlOptions: {
 | 
			
		||||
				getDataListURL: getCostMaterialAutoReportPage,
 | 
			
		||||
        exportURL: exportCostMaterialAutoReportExcel
 | 
			
		||||
			},
 | 
			
		||||
			tableData: [],
 | 
			
		||||
			tableProps,
 | 
			
		||||
			drawerVisible: false,
 | 
			
		||||
			listQuery: {
 | 
			
		||||
				reportType: 2,
 | 
			
		||||
			},
 | 
			
		||||
			formConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'select',
 | 
			
		||||
					label: '维度',
 | 
			
		||||
					selectOptions: [
 | 
			
		||||
						{ id: 2, name: '日' },
 | 
			
		||||
						{ id: 3, name: '周' },
 | 
			
		||||
						{ id: 4, name: '月' },
 | 
			
		||||
						{ id: 5, name: '年' },
 | 
			
		||||
					],
 | 
			
		||||
					param: 'reportType',
 | 
			
		||||
					filterable: true,
 | 
			
		||||
					defaultSelect: 2, // 默认值
 | 
			
		||||
					clearable: false,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'select',
 | 
			
		||||
					label: '原料名称',
 | 
			
		||||
					selectOptions: [],
 | 
			
		||||
					param: 'materialId',
 | 
			
		||||
					filterable: true,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'datePicker',
 | 
			
		||||
					label: '时间范围',
 | 
			
		||||
					dateType: 'daterange',
 | 
			
		||||
					format: 'yyyy-MM-dd',
 | 
			
		||||
					valueFormat: 'timestamp',
 | 
			
		||||
					rangeSeparator: '-',
 | 
			
		||||
					startPlaceholder: '开始时间',
 | 
			
		||||
					endPlaceholder: '结束时间',
 | 
			
		||||
					param: 'searchTime',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('cost:rawMaterialCostHis:export')
 | 
			
		||||
						? 'button'
 | 
			
		||||
						: '',
 | 
			
		||||
					btnName: '导出',
 | 
			
		||||
					name: 'export',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
					plain: true,
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	components: {},
 | 
			
		||||
	created() {
 | 
			
		||||
		getHotMaterialList().then((response) => {
 | 
			
		||||
			this.formConfig[1].selectOptions = response.data;
 | 
			
		||||
		});
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		buttonClick(val) {
 | 
			
		||||
			switch (val.btnName) {
 | 
			
		||||
				case 'search':
 | 
			
		||||
					this.listQuery.pageNo = 1;
 | 
			
		||||
					this.listQuery.pageSize = 10;
 | 
			
		||||
					this.listQuery.reportType = val.reportType;
 | 
			
		||||
					this.listQuery.materialId = val.materialId;
 | 
			
		||||
					this.listQuery.times = val.searchTime ? val.searchTime : null;
 | 
			
		||||
					this.getDataList();
 | 
			
		||||
					break;
 | 
			
		||||
				case 'export':
 | 
			
		||||
					this.listQuery.reportType = val.reportType;
 | 
			
		||||
					this.listQuery.materialId = val.materialId;
 | 
			
		||||
					this.listQuery.times = val.searchTime ? val.searchTime : null;
 | 
			
		||||
					this.handleExport();
 | 
			
		||||
					break;
 | 
			
		||||
				default:
 | 
			
		||||
					console.log(val);
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
<style>
 | 
			
		||||
.app-container .el-table .el-table__cell {
 | 
			
		||||
	padding: 0;
 | 
			
		||||
	height: 35px;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
@@ -62,6 +62,7 @@ const tableProps = [
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'code',
 | 
			
		||||
		label: '物品编码',
 | 
			
		||||
    width: 200
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'spec',
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2023-11-03 16:37:06
 | 
			
		||||
 * @LastEditors: zwq
 | 
			
		||||
 * @LastEditTime: 2023-11-24 14:35:01
 | 
			
		||||
 * @LastEditTime: 2023-12-06 15:31:23
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
@@ -42,7 +42,7 @@
 | 
			
		||||
					<span>{{ parseTime(scope.row.latestOutTime) }}</span>
 | 
			
		||||
				</template>
 | 
			
		||||
			</el-table-column>
 | 
			
		||||
			<el-table-column label="操作" width="100">
 | 
			
		||||
			<el-table-column label="操作" width="100" v-if="false">
 | 
			
		||||
				<template v-slot="scope">
 | 
			
		||||
					<el-button
 | 
			
		||||
						size="mini"
 | 
			
		||||
@@ -134,16 +134,16 @@ export default {
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'separate',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('end-material:warehouse-realtime:create') ? 'button' : '',
 | 
			
		||||
					btnName: '入库',
 | 
			
		||||
					name: 'add',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
					plain: true,
 | 
			
		||||
				},
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: 'separate',
 | 
			
		||||
				// },
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: this.$auth.hasPermi('end-material:warehouse-realtime:create') ? 'button' : '',
 | 
			
		||||
				// 	btnName: '入库',
 | 
			
		||||
				// 	name: 'add',
 | 
			
		||||
				// 	color: 'primary',
 | 
			
		||||
				// 	plain: true,
 | 
			
		||||
				// },
 | 
			
		||||
			],
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2021-11-18 14:16:25
 | 
			
		||||
 * @LastEditors: zwq
 | 
			
		||||
 * @LastEditTime: 2023-11-23 16:08:09
 | 
			
		||||
 * @LastEditTime: 2023-12-06 15:15:52
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
@@ -41,21 +41,23 @@ const tableProps = [
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'num',
 | 
			
		||||
		label: '数量',
 | 
			
		||||
    width: 50
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'allowTime',
 | 
			
		||||
		label: '允许留存时长(天)',
 | 
			
		||||
    width: 150
 | 
			
		||||
    width: 130
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'inTime',
 | 
			
		||||
		label: '入库时间',
 | 
			
		||||
		filter: parseTime,
 | 
			
		||||
    width: 150
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'leftTime',
 | 
			
		||||
		label: '剩余留存时长(天)',
 | 
			
		||||
    width: 150
 | 
			
		||||
    width: 130
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'remark',
 | 
			
		||||
 
 | 
			
		||||
@@ -16,7 +16,7 @@
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				:width="140"
 | 
			
		||||
				:width="70"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleClick" />
 | 
			
		||||
@@ -36,7 +36,7 @@
 | 
			
		||||
			:dialogTitle="addOrEditTitle"
 | 
			
		||||
			:dialogVisible="addOrUpdateVisible"
 | 
			
		||||
			:before-close="handleCancel"
 | 
			
		||||
			width="50%">
 | 
			
		||||
			width="60%">
 | 
			
		||||
			<add-or-update
 | 
			
		||||
				ref="addOrUpdate"
 | 
			
		||||
				@refreshDataList="successSubmit"></add-or-update>
 | 
			
		||||
@@ -99,7 +99,7 @@ const tableProps = [
 | 
			
		||||
		prop: 'inTime',
 | 
			
		||||
		label: '入库时间',
 | 
			
		||||
		filter: parseTime,
 | 
			
		||||
		minWidth: 100,
 | 
			
		||||
    width: 150
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'remark',
 | 
			
		||||
@@ -124,18 +124,18 @@ export default {
 | 
			
		||||
			tableData: [],
 | 
			
		||||
			tableProps,
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
				this.$auth.hasPermi(`end-material:warehouse-realtime-location:query`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'out',
 | 
			
		||||
							btnName: '出库',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi(`end-material:warehouse-realtime-location:query`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'in',
 | 
			
		||||
							btnName: '入库',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				// this.$auth.hasPermi(`end-material:warehouse-realtime-location:query`)
 | 
			
		||||
				// 	? {
 | 
			
		||||
				// 			type: 'out',
 | 
			
		||||
				// 			btnName: '出库',
 | 
			
		||||
				// 	  }
 | 
			
		||||
				// 	: undefined,
 | 
			
		||||
				// this.$auth.hasPermi(`end-material:warehouse-realtime-location:query`)
 | 
			
		||||
				// 	? {
 | 
			
		||||
				// 			type: 'in',
 | 
			
		||||
				// 			btnName: '入库',
 | 
			
		||||
				// 	  }
 | 
			
		||||
				// 	: undefined,
 | 
			
		||||
				this.$auth.hasPermi(`end-material:warehouse-realtime-location:query`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'detail',
 | 
			
		||||
 
 | 
			
		||||
@@ -62,6 +62,7 @@ const tableProps = [
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'code',
 | 
			
		||||
		label: '物品编码',
 | 
			
		||||
    width: 200
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'spec',
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2023-11-03 16:37:06
 | 
			
		||||
 * @LastEditors: zwq
 | 
			
		||||
 * @LastEditTime: 2023-11-24 14:36:24
 | 
			
		||||
 * @LastEditTime: 2023-12-06 15:31:06
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
@@ -42,7 +42,7 @@
 | 
			
		||||
					<span>{{ parseTime(scope.row.latestOutTime) }}</span>
 | 
			
		||||
				</template>
 | 
			
		||||
			</el-table-column>
 | 
			
		||||
			<el-table-column label="操作" width="100">
 | 
			
		||||
			<el-table-column label="操作" width="100" v-if="false">
 | 
			
		||||
				<template v-slot="scope">
 | 
			
		||||
					<el-button
 | 
			
		||||
						size="mini"
 | 
			
		||||
@@ -134,16 +134,16 @@ export default {
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'separate',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('out-material:warehouse-realtime:create') ? 'button' : '',
 | 
			
		||||
					btnName: '入库',
 | 
			
		||||
					name: 'add',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
					plain: true,
 | 
			
		||||
				},
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: 'separate',
 | 
			
		||||
				// },
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: this.$auth.hasPermi('out-material:warehouse-realtime:create') ? 'button' : '',
 | 
			
		||||
				// 	btnName: '入库',
 | 
			
		||||
				// 	name: 'add',
 | 
			
		||||
				// 	color: 'primary',
 | 
			
		||||
				// 	plain: true,
 | 
			
		||||
				// },
 | 
			
		||||
			],
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2021-11-18 14:16:25
 | 
			
		||||
 * @LastEditors: zwq
 | 
			
		||||
 * @LastEditTime: 2023-11-23 16:07:43
 | 
			
		||||
 * @LastEditTime: 2023-12-06 15:15:40
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
@@ -41,21 +41,23 @@ const tableProps = [
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'num',
 | 
			
		||||
		label: '数量',
 | 
			
		||||
    width: 50
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'allowTime',
 | 
			
		||||
		label: '允许留存时长(天)',
 | 
			
		||||
		width: 150,
 | 
			
		||||
    width: 130
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'inTime',
 | 
			
		||||
		label: '入库时间',
 | 
			
		||||
		filter: parseTime,
 | 
			
		||||
    width: 150
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'leftTime',
 | 
			
		||||
		label: '剩余留存时长(天)',
 | 
			
		||||
		width: 150,
 | 
			
		||||
    width: 130
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'remark',
 | 
			
		||||
 
 | 
			
		||||
@@ -16,7 +16,7 @@
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				:width="140"
 | 
			
		||||
				:width="70"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleClick" />
 | 
			
		||||
@@ -36,7 +36,7 @@
 | 
			
		||||
			:dialogTitle="addOrEditTitle"
 | 
			
		||||
			:dialogVisible="addOrUpdateVisible"
 | 
			
		||||
			:before-close="handleCancel"
 | 
			
		||||
			width="50%">
 | 
			
		||||
			width="60%">
 | 
			
		||||
			<add-or-update
 | 
			
		||||
				ref="addOrUpdate"
 | 
			
		||||
				@refreshDataList="successSubmit"></add-or-update>
 | 
			
		||||
@@ -99,7 +99,7 @@ const tableProps = [
 | 
			
		||||
		prop: 'inTime',
 | 
			
		||||
		label: '入库时间',
 | 
			
		||||
		filter: parseTime,
 | 
			
		||||
		minWidth: 100,
 | 
			
		||||
    width: 150
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'remark',
 | 
			
		||||
@@ -124,18 +124,18 @@ export default {
 | 
			
		||||
			tableData: [],
 | 
			
		||||
			tableProps,
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
				this.$auth.hasPermi(`out-material:warehouse-realtime-location:query`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'out',
 | 
			
		||||
							btnName: '出库',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi(`out-material:warehouse-realtime-location:query`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'in',
 | 
			
		||||
							btnName: '入库',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				// this.$auth.hasPermi(`out-material:warehouse-realtime-location:query`)
 | 
			
		||||
				// 	? {
 | 
			
		||||
				// 			type: 'out',
 | 
			
		||||
				// 			btnName: '出库',
 | 
			
		||||
				// 	  }
 | 
			
		||||
				// 	: undefined,
 | 
			
		||||
				// this.$auth.hasPermi(`out-material:warehouse-realtime-location:query`)
 | 
			
		||||
				// 	? {
 | 
			
		||||
				// 			type: 'in',
 | 
			
		||||
				// 			btnName: '入库',
 | 
			
		||||
				// 	  }
 | 
			
		||||
				// 	: undefined,
 | 
			
		||||
				this.$auth.hasPermi(`out-material:warehouse-realtime-location:query`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'detail',
 | 
			
		||||
 
 | 
			
		||||
@@ -62,6 +62,7 @@ const tableProps = [
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'code',
 | 
			
		||||
		label: '物品编码',
 | 
			
		||||
    width: 200
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'spec',
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2023-11-03 16:37:06
 | 
			
		||||
 * @LastEditors: zwq
 | 
			
		||||
 * @LastEditTime: 2023-11-24 14:36:08
 | 
			
		||||
 * @LastEditTime: 2023-12-06 15:30:52
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
@@ -42,7 +42,7 @@
 | 
			
		||||
					<span>{{ parseTime(scope.row.latestOutTime) }}</span>
 | 
			
		||||
				</template>
 | 
			
		||||
			</el-table-column>
 | 
			
		||||
			<el-table-column label="操作" width="100">
 | 
			
		||||
			<el-table-column label="操作" width="100" v-if="false">
 | 
			
		||||
				<template v-slot="scope">
 | 
			
		||||
					<el-button
 | 
			
		||||
						size="mini"
 | 
			
		||||
@@ -134,16 +134,16 @@ export default {
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'separate',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('pack-material:warehouse-realtime:create') ? 'button' : '',
 | 
			
		||||
					btnName: '入库',
 | 
			
		||||
					name: 'add',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
					plain: true,
 | 
			
		||||
				},
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: 'separate',
 | 
			
		||||
				// },
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: this.$auth.hasPermi('pack-material:warehouse-realtime:create') ? 'button' : '',
 | 
			
		||||
				// 	btnName: '入库',
 | 
			
		||||
				// 	name: 'add',
 | 
			
		||||
				// 	color: 'primary',
 | 
			
		||||
				// 	plain: true,
 | 
			
		||||
				// },
 | 
			
		||||
			],
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2021-11-18 14:16:25
 | 
			
		||||
 * @LastEditors: zwq
 | 
			
		||||
 * @LastEditTime: 2023-11-23 16:08:22
 | 
			
		||||
 * @LastEditTime: 2023-12-06 15:15:26
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
@@ -41,21 +41,23 @@ const tableProps = [
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'num',
 | 
			
		||||
		label: '数量',
 | 
			
		||||
    width: 50
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'allowTime',
 | 
			
		||||
		label: '允许留存时长(天)',
 | 
			
		||||
    width: 150
 | 
			
		||||
    width: 130
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'inTime',
 | 
			
		||||
		label: '入库时间',
 | 
			
		||||
		filter: parseTime,
 | 
			
		||||
    width: 150
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'leftTime',
 | 
			
		||||
		label: '剩余留存时长(天)',
 | 
			
		||||
    width: 150
 | 
			
		||||
    width: 130
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'remark',
 | 
			
		||||
 
 | 
			
		||||
@@ -16,7 +16,7 @@
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				:width="140"
 | 
			
		||||
				:width="70"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleClick" />
 | 
			
		||||
@@ -36,7 +36,7 @@
 | 
			
		||||
			:dialogTitle="addOrEditTitle"
 | 
			
		||||
			:dialogVisible="addOrUpdateVisible"
 | 
			
		||||
			:before-close="handleCancel"
 | 
			
		||||
			width="50%">
 | 
			
		||||
			width="60%">
 | 
			
		||||
			<add-or-update
 | 
			
		||||
				ref="addOrUpdate"
 | 
			
		||||
				@refreshDataList="successSubmit"></add-or-update>
 | 
			
		||||
@@ -99,7 +99,7 @@ const tableProps = [
 | 
			
		||||
		prop: 'inTime',
 | 
			
		||||
		label: '入库时间',
 | 
			
		||||
		filter: parseTime,
 | 
			
		||||
		minWidth: 100,
 | 
			
		||||
    width: 150
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'remark',
 | 
			
		||||
@@ -124,18 +124,18 @@ export default {
 | 
			
		||||
			tableData: [],
 | 
			
		||||
			tableProps,
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
				this.$auth.hasPermi(`pack-material:warehouse-realtime-location:query`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'out',
 | 
			
		||||
							btnName: '出库',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi(`pack-material:warehouse-realtime-location:query`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'in',
 | 
			
		||||
							btnName: '入库',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				// this.$auth.hasPermi(`pack-material:warehouse-realtime-location:query`)
 | 
			
		||||
				// 	? {
 | 
			
		||||
				// 			type: 'out',
 | 
			
		||||
				// 			btnName: '出库',
 | 
			
		||||
				// 	  }
 | 
			
		||||
				// 	: undefined,
 | 
			
		||||
				// this.$auth.hasPermi(`pack-material:warehouse-realtime-location:query`)
 | 
			
		||||
				// 	? {
 | 
			
		||||
				// 			type: 'in',
 | 
			
		||||
				// 			btnName: '入库',
 | 
			
		||||
				// 	  }
 | 
			
		||||
				// 	: undefined,
 | 
			
		||||
				this.$auth.hasPermi(`pack-material:warehouse-realtime-location:query`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'detail',
 | 
			
		||||
 
 | 
			
		||||
@@ -62,6 +62,7 @@ const tableProps = [
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'code',
 | 
			
		||||
		label: '物品编码',
 | 
			
		||||
    width: 200
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'spec',
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2023-11-03 16:37:06
 | 
			
		||||
 * @LastEditors: zwq
 | 
			
		||||
 * @LastEditTime: 2023-11-24 14:35:51
 | 
			
		||||
 * @LastEditTime: 2023-12-06 15:30:39
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
@@ -42,7 +42,7 @@
 | 
			
		||||
					<span>{{ parseTime(scope.row.latestOutTime) }}</span>
 | 
			
		||||
				</template>
 | 
			
		||||
			</el-table-column>
 | 
			
		||||
			<el-table-column label="操作" width="100">
 | 
			
		||||
			<el-table-column label="操作" width="100" v-if="false">
 | 
			
		||||
				<template v-slot="scope">
 | 
			
		||||
					<el-button
 | 
			
		||||
						size="mini"
 | 
			
		||||
@@ -134,16 +134,16 @@ export default {
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'separate',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('part-material:warehouse-realtime:create') ? 'button' : '',
 | 
			
		||||
					btnName: '入库',
 | 
			
		||||
					name: 'add',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
					plain: true,
 | 
			
		||||
				},
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: 'separate',
 | 
			
		||||
				// },
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: this.$auth.hasPermi('part-material:warehouse-realtime:create') ? 'button' : '',
 | 
			
		||||
				// 	btnName: '入库',
 | 
			
		||||
				// 	name: 'add',
 | 
			
		||||
				// 	color: 'primary',
 | 
			
		||||
				// 	plain: true,
 | 
			
		||||
				// },
 | 
			
		||||
			],
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2021-11-18 14:16:25
 | 
			
		||||
 * @LastEditors: zwq
 | 
			
		||||
 * @LastEditTime: 2023-11-23 16:08:31
 | 
			
		||||
 * @LastEditTime: 2023-12-06 15:15:11
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
@@ -41,21 +41,23 @@ const tableProps = [
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'num',
 | 
			
		||||
		label: '数量',
 | 
			
		||||
    width: 50
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'allowTime',
 | 
			
		||||
		label: '允许留存时长(天)',
 | 
			
		||||
    width: 150
 | 
			
		||||
    width: 130
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'inTime',
 | 
			
		||||
		label: '入库时间',
 | 
			
		||||
		filter: parseTime,
 | 
			
		||||
    width: 150
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'leftTime',
 | 
			
		||||
		label: '剩余留存时长(天)',
 | 
			
		||||
    width: 150
 | 
			
		||||
    width: 130
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'remark',
 | 
			
		||||
 
 | 
			
		||||
@@ -16,7 +16,7 @@
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				:width="140"
 | 
			
		||||
				:width="70"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleClick" />
 | 
			
		||||
@@ -36,7 +36,7 @@
 | 
			
		||||
			:dialogTitle="addOrEditTitle"
 | 
			
		||||
			:dialogVisible="addOrUpdateVisible"
 | 
			
		||||
			:before-close="handleCancel"
 | 
			
		||||
			width="50%">
 | 
			
		||||
			width="60%">
 | 
			
		||||
			<add-or-update
 | 
			
		||||
				ref="addOrUpdate"
 | 
			
		||||
				@refreshDataList="successSubmit"></add-or-update>
 | 
			
		||||
@@ -99,7 +99,7 @@ const tableProps = [
 | 
			
		||||
		prop: 'inTime',
 | 
			
		||||
		label: '入库时间',
 | 
			
		||||
		filter: parseTime,
 | 
			
		||||
		minWidth: 100,
 | 
			
		||||
    width: 150
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'remark',
 | 
			
		||||
@@ -124,18 +124,18 @@ export default {
 | 
			
		||||
			tableData: [],
 | 
			
		||||
			tableProps,
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
				this.$auth.hasPermi(`part-material:warehouse-realtime-location:query`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'out',
 | 
			
		||||
							btnName: '出库',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi(`part-material:warehouse-realtime-location:query`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'in',
 | 
			
		||||
							btnName: '入库',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				// this.$auth.hasPermi(`part-material:warehouse-realtime-location:query`)
 | 
			
		||||
				// 	? {
 | 
			
		||||
				// 			type: 'out',
 | 
			
		||||
				// 			btnName: '出库',
 | 
			
		||||
				// 	  }
 | 
			
		||||
				// 	: undefined,
 | 
			
		||||
				// this.$auth.hasPermi(`part-material:warehouse-realtime-location:query`)
 | 
			
		||||
				// 	? {
 | 
			
		||||
				// 			type: 'in',
 | 
			
		||||
				// 			btnName: '入库',
 | 
			
		||||
				// 	  }
 | 
			
		||||
				// 	: undefined,
 | 
			
		||||
				this.$auth.hasPermi(`part-material:warehouse-realtime-location:query`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'detail',
 | 
			
		||||
 
 | 
			
		||||
@@ -62,6 +62,7 @@ const tableProps = [
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'code',
 | 
			
		||||
		label: '物品编码',
 | 
			
		||||
    width: 200
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'spec',
 | 
			
		||||
 
 | 
			
		||||
@@ -42,7 +42,7 @@
 | 
			
		||||
					<span>{{ parseTime(scope.row.latestOutTime) }}</span>
 | 
			
		||||
				</template>
 | 
			
		||||
			</el-table-column>
 | 
			
		||||
			<el-table-column label="操作" width="100">
 | 
			
		||||
			<el-table-column label="操作" width="100" v-if="false">
 | 
			
		||||
				<template v-slot="scope">
 | 
			
		||||
					<el-button
 | 
			
		||||
						size="mini"
 | 
			
		||||
@@ -134,16 +134,16 @@ export default {
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'separate',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('raw-material:warehouse-realtime:create') ? 'button' : '',
 | 
			
		||||
					btnName: '入库',
 | 
			
		||||
					name: 'add',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
					plain: true,
 | 
			
		||||
				},
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: 'separate',
 | 
			
		||||
				// },
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: this.$auth.hasPermi('raw-material:warehouse-realtime:create') ? 'button' : '',
 | 
			
		||||
				// 	btnName: '入库',
 | 
			
		||||
				// 	name: 'add',
 | 
			
		||||
				// 	color: 'primary',
 | 
			
		||||
				// 	plain: true,
 | 
			
		||||
				// },
 | 
			
		||||
			],
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2021-11-18 14:16:25
 | 
			
		||||
 * @LastEditors: zwq
 | 
			
		||||
 * @LastEditTime: 2023-11-23 16:08:41
 | 
			
		||||
 * @LastEditTime: 2023-12-06 15:14:12
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
@@ -41,21 +41,23 @@ const tableProps = [
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'num',
 | 
			
		||||
		label: '数量',
 | 
			
		||||
    width: 50
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'allowTime',
 | 
			
		||||
		label: '允许留存时长(天)',
 | 
			
		||||
    width: 150
 | 
			
		||||
    width: 130
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'inTime',
 | 
			
		||||
		label: '入库时间',
 | 
			
		||||
		filter: parseTime,
 | 
			
		||||
    width: 150
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'leftTime',
 | 
			
		||||
		label: '剩余留存时长(天)',
 | 
			
		||||
    width: 150
 | 
			
		||||
    width: 130
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'remark',
 | 
			
		||||
 
 | 
			
		||||
@@ -16,7 +16,7 @@
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				:width="140"
 | 
			
		||||
				:width="70"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleClick" />
 | 
			
		||||
@@ -36,7 +36,7 @@
 | 
			
		||||
			:dialogTitle="addOrEditTitle"
 | 
			
		||||
			:dialogVisible="addOrUpdateVisible"
 | 
			
		||||
			:before-close="handleCancel"
 | 
			
		||||
			width="50%">
 | 
			
		||||
			width="60%">
 | 
			
		||||
			<add-or-update
 | 
			
		||||
				ref="addOrUpdate"
 | 
			
		||||
				@refreshDataList="successSubmit"></add-or-update>
 | 
			
		||||
@@ -99,7 +99,7 @@ const tableProps = [
 | 
			
		||||
		prop: 'inTime',
 | 
			
		||||
		label: '入库时间',
 | 
			
		||||
		filter: parseTime,
 | 
			
		||||
		minWidth: 100,
 | 
			
		||||
    width: 150
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'remark',
 | 
			
		||||
@@ -124,18 +124,18 @@ export default {
 | 
			
		||||
			tableData: [],
 | 
			
		||||
			tableProps,
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
				this.$auth.hasPermi(`raw-material:warehouse-realtime-location:query`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'out',
 | 
			
		||||
							btnName: '出库',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi(`raw-material:warehouse-realtime-location:query`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'in',
 | 
			
		||||
							btnName: '入库',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				// this.$auth.hasPermi(`raw-material:warehouse-realtime-location:query`)
 | 
			
		||||
				// 	? {
 | 
			
		||||
				// 			type: 'out',
 | 
			
		||||
				// 			btnName: '出库',
 | 
			
		||||
				// 	  }
 | 
			
		||||
				// 	: undefined,
 | 
			
		||||
				// this.$auth.hasPermi(`raw-material:warehouse-realtime-location:query`)
 | 
			
		||||
				// 	? {
 | 
			
		||||
				// 			type: 'in',
 | 
			
		||||
				// 			btnName: '入库',
 | 
			
		||||
				// 	  }
 | 
			
		||||
				// 	: undefined,
 | 
			
		||||
				this.$auth.hasPermi(`raw-material:warehouse-realtime-location:query`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'detail',
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2023-08-01 13:52:10
 | 
			
		||||
 * @LastEditors: zwq
 | 
			
		||||
 * @LastEditTime: 2023-11-23 15:20:31
 | 
			
		||||
 * @LastEditTime: 2023-12-05 14:05:08
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
@@ -92,7 +92,7 @@ export default {
 | 
			
		||||
				updateURL: updateWarehouse,
 | 
			
		||||
				infoURL: getWarehouse,
 | 
			
		||||
			},
 | 
			
		||||
			nameList: ['warehouse_type', 'warehouse_good_type'],
 | 
			
		||||
			nameList: ['warehouse_type', 'material_type'],
 | 
			
		||||
			dataForm: {
 | 
			
		||||
				id: undefined,
 | 
			
		||||
				name: undefined,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user