成本页面添加

dev-scheduling
jinna 2 weeks ago
parent ce4c013f50
commit 6fd5be856e
  1. 206
      src/views/costManagement/components/productionValue.vue
  2. 266
      src/views/costManagement/components/receiveMaterial.vue

@ -0,0 +1,206 @@
<template>
<div>
<!-- 产值维护 -->
<avue-crud
:option="option"
:table-loading="loading"
:data="data"
v-model="form"
v-model:page="page"
v-model:search="search"
ref="crud"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoad"
@sort-change="sortChange"
@row-save="rowSave"
@row-update="rowUpdate"
>
<template #menu-right>
<el-button type="primary" @click="handleImport">导入</el-button>
</template>
</avue-crud>
<!-- 导入 -->
<basic-import
v-if="isShowImport"
title="导入"
:isShow="isShowImport"
templateUrl="/blade-desk/costCalculationOutput/importTemplate"
templateName="成本-产值维护模板.xls"
importUrl="/blade-desk/costCalculationOutput/import"
showTips="请上传 .xls,.xlsx 标准格式文件;如数据已存在,将直接覆盖原有内容"
@closeDialog="closeDialog"
></basic-import>
</div>
</template>
<script>
import basicImport from '@/components/basic-import/main.vue';
import {getProductionList} from "@/api/costManagement/costConfiguration"
export default {
components:{
basicImport
},
data(){
return{
loading:false,
data:[],
form:{},
search:{
month:this.$dayjs().subtract(1, 'month').format('YYYY-MM')
},
page:{
pageSize:10,
currentPage:1,
total:0,
},
query:{
month:this.$dayjs().subtract(1, 'month').format('YYYY-MM')
},
selectionList:[],
isShowImport:false,
option:{
height: 'auto',
calcHeight: 32,
tip: false,
simplePage: true,
searchShow: true,
searchMenuSpan: 18,
searchIcon: true,
searchIndex: 3,
tree: false,
border: true,
index: true,
selection: true,
viewBtn: false,
delBtn: false,
addBtn: false,
editBtn: false,
editBtnText: '修改',
viewBtnIcon: ' ',
delBtnIcon: ' ',
editBtnIcon: ' ',
viewBtnText: '详情',
// labelWidth: 120,
searchLabelWidth: "auto",
menuWidth: 100,
dialogWidth: '30%',
dialogClickModal: false,
searchEnter: true,
excelBtn: false,
filterBtn: true,
searchShowBtn: false,
columnSort: true,
excelBtn: true,
columnSort: true,
index: false,
showOverflowTooltip: true,
searchLabelPosition: 'left',
searchLabelPosition: 'left',
searchGutter: 24,
searchSpan: 6,
menuAlign: 'center',
gridBtn: false,
searchMenuPosition: 'right',
menu:false,
addBtnIcon: ' ',
viewBtnIcon: ' ',
delBtnIcon: ' ',
editBtnIcon: ' ',
align: 'center',
column: [
{
label:"月份",
prop:"month",
type:'month',
sortable: 'custom',
search:true,
span:24,
format:"YYYY-MM",
valueFormat:"YYYY-MM",
rules: [
{ required: true, message: '请选择月份', trigger: 'blur' }
],
},
{
label:"作业中心",
prop:"workCenterName",
},
{
label:"产值",
prop:"output"
},
{
label:"维护人",
prop:"updateUserName"
},
{
label:"维护时间",
prop:'updateTime'
}
]
}
}
},
mounted(){
},
methods:{
handleImport(){
this.isShowImport = true
},
closeDialog(val){
this.isShowImport = false
if(val){
this.onLoad()
}
},
searchChange(params, done){
this.page.currentPage = 1
this.query = params
this.onLoad()
done()
},
searchReset(){
this.query = {
month:this.$dayjs().subtract(1, 'month').format('YYYY-MM')
}
this.search = {
month:this.$dayjs().subtract(1, 'month').format('YYYY-MM')
}
this.onLoad()
},
selectionChange(list){
this.selectionList = list
},
currentChange(currentPage){
this.page.currentPage = currentPage
},
sizeChange(pageSize){
this.page.pageSize = pageSize
},
refreshChange(){
this.onLoad()
},
onLoad(){
this.loading = true
getProductionList({
current:this.page.currentPage,
size:this.page.pageSize,
...this.query
}).then(res =>{
this.data = res.data.data.records
this.page.total = res.data.data.total
this.loading = false
})
},
}
};
</script>
<style>
</style>

@ -0,0 +1,266 @@
<template>
<div>
<!-- 领料维护 -->
<avue-crud
:option="option"
:table-loading="loading"
:data="data"
v-model="form"
v-model:page="page"
v-model:search="search"
ref="crud"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoad"
@sort-change="sortChange"
@row-save="rowSave"
@row-update="rowUpdate"
>
<template #menu-right>
<el-button type="primary" @click="handleImport">导入</el-button>
</template>
<!-- <template #centerId-search="{type}">
<jhSelect
:value="search.centerId"
@input="val => (search.centerId = val)"
placeholder="请搜索选择"
api-url="/blade-desk/BA/WorkCenter/list"
echo-api="/blade-desk/BA/WorkCenter/list"
echoParamsKey="ids"
echo-method="get"
api-method="get"
list-key="records"
total-key="total"
label-key="wcName"
value-key="id"
search-key="wcName"
:debounce-time="500"
@change="changeTeacher"
:title="'修改'"
/>
</template>
<template #centerId-form="{type}">
<jhSelect
:value="form.centerId"
@input="val => (form.centerId = val)"
placeholder="请搜索选择"
api-url="/blade-desk/BA/WorkCenter/list"
echo-api="/blade-desk/BA/WorkCenter/list"
echoParamsKey="ids"
echo-method="get"
api-method="get"
list-key="records"
total-key="total"
label-key="wcName"
value-key="id"
search-key="wcName"
:debounce-time="500"
@change="changeTeacher"
:title="'修改'"
/>
</template>
<template #person-form="{type}">
<jhSelect
:value="form.person"
placeholder="请搜索选择"
api-url="/blade-system/user/page"
echo-api="/blade-system/user/page"
echoParamsKey="ids"
echo-method="get"
api-method="get"
list-key="records"
total-key="total"
label-key="realName"
value-key="id"
search-key="id"
:debounce-time="500"
@change="changePerson"
multiple
:title="'修改'"
/>
</template> -->
</avue-crud>
<!-- 导入 -->
<basic-import
v-if="isShowImport"
title="导入"
:isShow="isShowImport"
templateUrl="/blade-desk/costCalculationEmployee/importTemplate"
templateName="成本-领料维护模板.xls"
importUrl="/blade-desk/costCalculationEmployee/import"
@closeDialog="closeDialog"
showTips="请上传 .xls,.xlsx 标准格式文件;如数据已存在,将直接覆盖原有内容"
></basic-import>
</div>
</template>
<script>
import basicImport from '@/components/basic-import/main.vue';
import {getReceiveMaterialList} from "@/api/costManagement/costConfiguration"
export default {
components:{
basicImport
},
data(){
return{
loading:false,
data:[],
form:{},
page:{
pageSize:10,
currentPage:1,
total:0,
},
search:{},
query:{},
isShowImport:false,
selectionList:[],
option:{
height: 'auto',
calcHeight: 32,
tip: false,
simplePage: true,
searchShow: true,
searchMenuSpan: 18,
searchIcon: true,
searchIndex: 3,
tree: false,
border: true,
index: true,
selection: true,
viewBtn: false,
delBtn: false,
addBtn: false,
editBtn: false,
editBtnText: '修改',
viewBtnIcon: ' ',
delBtnIcon: ' ',
editBtnIcon: ' ',
viewBtnText: '详情',
// labelWidth: 120,
searchLabelWidth: "auto",
menuWidth: 100,
dialogWidth: '30%',
dialogClickModal: false,
searchEnter: true,
excelBtn: false,
filterBtn: true,
searchShowBtn: false,
columnSort: true,
excelBtn: true,
columnSort: true,
index: false,
showOverflowTooltip: true,
searchLabelPosition: 'left',
searchLabelPosition: 'left',
searchGutter: 24,
searchSpan: 6,
menuAlign: 'center',
gridBtn: false,
searchMenuPosition: 'right',
menu:false,
addBtnIcon: ' ',
viewBtnIcon: ' ',
delBtnIcon: ' ',
editBtnIcon: ' ',
align: 'center',
column: [
{
label:"作业中心",
prop:"workCenterName",
sortable: 'custom',
search:false,
span:24,
display:false,
rules: [
{ required: true, message: '请选择作业中心', trigger: 'blur' }
],
},
{
label:'人员',
prop:"employeeName",
sortable: 'custom',
span:24,
display:false,
rules: [
{ required: true, message: '请选择人员', trigger: 'blur' }
],
},
{
label:"维护人",
prop:"createUserName",
},
{
label:"维护时间",
prop:"createTime",
}
]
}
}
},
mounted(){
},
methods:{
handleImport(){
this.isShowImport = true
},
closeDialog(val){
this.isShowImport = false
if(val){
this.onLoad()
}
},
searchChange(params, done){
this.query = params;
this.page.currentPage = 1
this.onLoad()
done()
},
searchReset(){
this.query = {}
this.onLoad()
},
selectionChange(list){
this.selectionList = list
},
currentChange(currentPage){
this.page.currentPage = currentPage
},
sizeChange(pageSize){
this.page.pageSize = pageSize
},
refreshChange(){
this.onLoad()
},
changePerson(val,item){
console.log('item-------',item)
this.form.person = item && item.records.map(item => item.id)
},
rowSave(row, done, loading){
console.log('row-----------',row)
},
onLoad(){
this.loading = true
getReceiveMaterialList({
current:this.page.currentPage,
size:this.page.pageSize,
...this.query
}).then(res =>{
this.data = res.data.data.records
this.page.total = res.data.data.total
this.loading = false
})
}
}
}
</script>
<style>
</style>
Loading…
Cancel
Save