Browse Source

发料

master
ruanqi 2 years ago
parent
commit
e009f793fe
  1. 2
      src/api/material/productionStock.js
  2. 527
      src/views/modules/material/finalRollSearch.vue

2
src/api/material/productionStock.js

@ -16,3 +16,5 @@ export const finalSaveTransHeaderDetail= data => createAPI(`/productionStock/fin
export const deleteSubCach= data => createAPI(`/productionStock/deleteSubCach`,'post',data) export const deleteSubCach= data => createAPI(`/productionStock/deleteSubCach`,'post',data)
export const deleteTransHeaderData= data => createAPI(`/productionStock/deleteTransHeaderData`,'post',data) export const deleteTransHeaderData= data => createAPI(`/productionStock/deleteTransHeaderData`,'post',data)
export const saveStockCach= data => createAPI(`/productionStock/saveStockCach`,'post',data) export const saveStockCach= data => createAPI(`/productionStock/saveStockCach`,'post',data)
export const soFinalRollSearch= data => createAPI(`/productionStock/soFinalRollSearch`,'post',data)
export const updateRollStatus= data => createAPI(`/productionStock/updateRollStatus`,'post',data)

527
src/views/modules/material/finalRollSearch.vue

@ -0,0 +1,527 @@
<template>
<div class="mod-config">
<el-form :inline="true" label-position="top" style="margin-top: 1px; margin-left: 0px;">
<el-form-item :label="'最终卷'">
<el-input v-model="searchData.finalRollNo" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'物料编码'">
<el-input v-model="searchData.partNo" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'派工单号'">
<el-input v-model="searchData.seqNo" type="number" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'生产订单'">
<el-input v-model="searchData.orderNo" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'状态'">
<el-select filterable v-model="searchData.statusCode" >
<el-option label="all" value=""></el-option>
<el-option label="created" value="0"></el-option>
<el-option label="checked" value="1"></el-option>
<el-option label="stocked" value="2"></el-option>
<el-option label="shipped" value="3"></el-option>
<el-option label="isolation" value="8"></el-option>
<el-option label="discarded" value="9"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="'生产日期'">
<el-date-picker
style="width: 120px"
v-model="searchData.startDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
<el-form-item :label="'至'">
<el-date-picker
style="width: 120px"
v-model="searchData.endDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
<el-form-item :label="' '">
<el-button type="primary" @click="searchTable()">查询</el-button>
<download-excel
:fields="fields()"
:data="exportData"
type="xls"
:name="exportName"
:header="exportHeader"
:footer="exportFooter"
:fetch="createExportData"
:before-generate="startDownload"
:before-finish="finishDownload"
worksheet="导出信息"
class="el-button el-button--primary el-button--medium">
{{ '导出' }}
</download-excel>
</el-form-item>
</el-form>
<el-table
:data="dataList"
:height="height"
border
v-loading="dataListLoading"
style="width: 100%; ">
<el-table-column
v-for="(item,index) in columnList1" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed==''?false:item.fixed"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
<el-table-column
header-align="center"
align="center"
width="120"
fixed="left"
label="操作">
<template slot-scope="scope">
<a type="text" size="small" v-if="scope.row.statusCode===2" @click="isolationRoll(scope.row)">隔离</a>
<a type="text" size="small" v-if="scope.row.statusCode===2" @click="discardedRoll(scope.row)">报废</a>
<a type="text" size="small" v-if="scope.row.statusCode===8||scope.row.statusCode===9" @click="returnStatusRoll(scope.row)">撤销状态</a>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[20, 50, 100, 1000]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
</div>
</template>
<script>
import {
soFinalRollSearch,
updateRollStatus,
} from "@/api/material/productionStock.js"
import Chooselist from '@/views/modules/common/Chooselist'
export default {
components: {
Chooselist
},
data() {
return {
dataList: [],
searchData: {
page: 1,
limit: 100,
site:this.$store.state.user.site,
username: this.$store.state.user.name,
finalRollNo: '',
partNo :'',
seqNo:'',
orderNo:'',
statusCode:'',
startDate:'',
endDate:'',
},
exportList:[],
pageIndex: 1,
pageSize: 100,
totalPage: 0,
visible:false,
dataListLoading: false,
columnList1:[
{
userId: this.$store.state.user.name,
functionId: 400003,
serialNumber: '400003Table1FinalRollNo',
tableId: "400003Table1",
tableName: "成品卷查询",
columnProp: "finalRollNo",
headerAlign: "center",
align: "left",
columnLabel: "成品卷号",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},{
userId: this.$store.state.user.name,
functionId: 400003,
serialNumber: '400003Table1PartNo',
tableId: "400003Table1",
tableName: "成品卷查询",
columnProp: "partNo",
headerAlign: "center",
align: "left",
columnLabel: "物料编码",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},{
userId: this.$store.state.user.name,
functionId: 400003,
serialNumber: '400003Table1PartDesc',
tableId: "400003Table1",
tableName: "成品卷查询",
columnProp: "partDesc",
headerAlign: "center",
align: "left",
columnLabel: "物料名称",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 150
},{
userId: this.$store.state.user.name,
functionId: 400003,
serialNumber: '400003Table1OrderNo',
tableId: "400003Table1",
tableName: "成品卷查询",
columnProp: "orderNo",
headerAlign: "center",
align: "left",
columnLabel: "生产订单",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},{
userId: this.$store.state.user.name,
functionId: 400003,
serialNumber: '400003Table1SeqNo',
tableId: "400003Table1",
tableName: "成品卷查询",
columnProp: "seqNo",
headerAlign: "center",
align: "right",
columnLabel: "派工单号",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},{
userId: this.$store.state.user.name,
functionId: 400003,
serialNumber: '400003Table1RollQty',
tableId: "400003Table1",
tableName: "成品卷查询",
columnProp: "rollQty",
headerAlign: "center",
align: "right",
columnLabel: "卷数量",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},{
userId: this.$store.state.user.name,
functionId: 400003,
serialNumber: '400003Table1Status',
tableId: "400003Table1",
tableName: "成品卷查询",
columnProp: "status",
headerAlign: "center",
align: "left",
columnLabel: "状态",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},{
userId: this.$store.state.user.name,
functionId: 400003,
serialNumber: '400003Table1Remark',
tableId: "400003Table1",
tableName: "成品卷查询",
columnProp: "createdByName",
headerAlign: "center",
align: "left",
columnLabel: "创建人",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},{
userId: this.$store.state.user.name,
functionId: 400003,
serialNumber: '400003Table1CreatedDate',
tableId: "400003Table1",
tableName: "成品卷查询",
columnProp: "createdDate",
headerAlign: "center",
align: "left",
columnLabel: "创建时间",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 150
},{
userId: this.$store.state.user.name,
functionId: 400003,
serialNumber: '400003Table1LabelDate',
tableId: "400003Table1",
tableName: "成品卷查询",
columnProp: "labelDate",
headerAlign: "center",
align: "center",
columnLabel: "标签日期",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 150
},{
userId: this.$store.state.user.name,
functionId: 400003,
serialNumber: '400003Table1FqcDate',
tableId: "400003Table1",
tableName: "成品卷查询",
columnProp: "fqcDate",
headerAlign: "center",
align: "center",
columnLabel: "FQC日期",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 150
},{
userId: this.$store.state.user.name,
functionId: 400003,
serialNumber: '400003Table1ManufactureDate',
tableId: "400003Table1",
tableName: "成品卷查询",
columnProp: "manufactureDate",
headerAlign: "center",
align: "center",
columnLabel: "生产日期",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 150
},
],
// start
exportData: [],
exportName: '成品卷库存查询'+this.dayjs().format('YYYYMMDDHHmmss'),
exportHeader: ["成品卷库存查询"],
exportFooter: [],
// end
height:200,
}
},
mounted () {
this.$nextTick(() => {
this.height = window.innerHeight- 200
})
},
methods: {
// S
getBaseList (val, type) {
this.tagNo = val
this.tagNo1 = type
this.$nextTick(() => {
let strVal = ''
if (val === 1013) {
if(type==1) {
strVal = this.dataForm.partType
}
}
this.$refs.baseList.init(val, strVal)
})
},
/* 列表方法的回调 */
getBaseData (val) {
if (this.tagNo === 1013) {
if(this.tagNo1==1) {
this.dataForm.partType = val.Base_id
this.dataForm.partTypeDesc = val.Base_desc
}
}
},
//
init(inData) {
//
this.searchData = JSON.parse(JSON.stringify(inData));
//
this.searchTable();
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.search()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.search()
},
searchTable(){
this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex
soFinalRollSearch(this.searchData).then(({data}) => {
if (data.code == 0) {
this.dataList = data.page.list
this.pageIndex = data.page.currPage
this.pageSize = data.page.pageSize
this.totalPage = data.page.totalCount
}
this.dataListLoading = false
})
},
isolationRoll(row){
let inData={
site:row.site,
finalRollNo:row.finalRollNo,
statusCode:8,
status:'Isolation',
}
this.$confirm('确定要隔离这个卷?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
updateRollStatus(inData).then(({data}) => {
if (data && data.code === 0) {
this.$message.success( '操作成功')
this.searchTable();
} else {
this.$message.error(data.msg)
}
})
}).catch(() => {
})
},
discardedRoll(row){
let inData={
site:row.site,
finalRollNo:row.finalRollNo,
statusCode:9,
status:'Discarded',
}
this.$confirm('确定要报废这个卷?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
updateRollStatus(inData).then(({data}) => {
if (data && data.code === 0) {
this.$message.success( '操作成功')
this.searchTable();
} else {
this.$message.error(data.msg)
}
})
}).catch(() => {
})
},
returnStatusRoll(row){
let inData={
site:row.site,
finalRollNo:row.finalRollNo,
statusCode:2,
status:'Stocked',
}
this.$confirm('确定要还原这个卷?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
updateRollStatus(inData).then(({data}) => {
if (data && data.code === 0) {
this.$message.success( '操作成功')
this.searchTable();
} else {
this.$message.error(data.msg)
}
})
}).catch(() => {
})
},
//excel
//excel
async createExportData() {
this.searchData.limit = -1
this.searchData.page = 1
await soFinalRollSearch(this.searchData).then(({data}) => {
this.exportList= data.page.list;
})
return this.exportList;
},
startDownload() {
// this.exportData = this.dataList
},
finishDownload() {
},
fields() {
let json = "{"
this.columnList1.forEach((item, index) => {
if (index == this.columnList1.length - 1) {
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
} else {
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
}
})
json += "}"
let s = eval("(" + json + ")")
return s
},
},
}
</script>
<style scoped>
</style>
Loading…
Cancel
Save