Commit 62b1ec91 authored by 徐来柯's avatar 徐来柯

update

parent df32524e
<template> <template>
<div class="box-container"> <div class="box-container">
<div class="wrap"> <div class="wrap">
<search-form :formList="[1,2,3]" :btnList="[1,2]" @openDialog="openDialog" @delData="delData" /> <search-form :formList="[1,2,3]" :btnList="[1,2]" :formData="formData" @searchData="searchData" @openDialog="openDialog" @delData="delData" />
<el-table <el-table
border border
height="675" height="675"
...@@ -24,11 +24,11 @@ ...@@ -24,11 +24,11 @@
<el-table-column <el-table-column
label="出库编号" label="出库编号"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
prop="SID" prop="MHSort"
width="180"> width="180">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="ProductName" prop="xtid"
label="线体编号" label="线体编号"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
width="180"> width="180">
...@@ -36,64 +36,48 @@ ...@@ -36,64 +36,48 @@
<el-table-column <el-table-column
label="线体名称" label="线体名称"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
prop="ProductType" prop="linname"
width="180"> width="180">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="物料编号" label="物料编号"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
prop="PlanType" prop="wlid"
width="180"> width="180">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="物料名称" label="物料名称"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
prop="PlanType" prop="wlname"
width="180"> width="180">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="物料描述" label="物料描述"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
prop="PlanType" prop="wlDesc"
width="210"> width="210">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="单位" label="单位"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
prop="LineName" prop="Company"
width="140"> width="140">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="出库数量" label="出库数量"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
prop="UserName" prop="MHNuber"
width="180"> width="180">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="出库时间" label="出库时间"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
prop="StartDt" prop="UpdateTime"
> >
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- <div class="page_bottom" > <Pagination ref="page" :totalCount="totalCount" :totalPage="totalPage" @pageFun="pageFun" />
<div class="bottom_text">
<span>{{totalCount}}条记录 当前第{{pageIndex}}页 共{{totalPage}}页 每页{{pageSize}}条记录</span>
</div>
<div class="bottom_btns">
<div class="bottom_firest" @click="first">首页</div>
<div ref="last" :class="num <= 1 ? 'bottom_disabled' : 'bottom_next'" @click="last" >上一页</div>
<div ref="next" :class="num === totalPage || num <= 0 ? 'bottom_disabled' : 'bottom_next'" @click="next" >下一页</div>
<div class="bottom_end" @click="end" > 末页</div>
<span></span>
<input v-model="num" class="text" @input="handleBlur" type="text"/>
<span></span>
<div @click="jump" class="bottom_jump">跳转</div>
</div>
</div> -->
<Pagination @pageFun="pageFun" />
</div> </div>
<store-dialog :titleText="'物料出库单'" :type="'out'" v-if="popShow" @closeDialog="closeDialog" @conserve="conserve" /> <store-dialog :titleText="'物料出库单'" :type="'out'" v-if="popShow" @closeDialog="closeDialog" @conserve="conserve" />
...@@ -113,29 +97,98 @@ export default { ...@@ -113,29 +97,98 @@ export default {
return { return {
tableData: [], tableData: [],
AllTableData: [], AllTableData: [],
cloneData: [],
popShow: false, popShow: false,
checkList: [], checkList: [],
deletetext: '', deletetext: '',
deleteShow: false, deleteShow: false,
formData: {
argKeyWord: '',
argWhere: '',
dateValue: [this.$moment().format('YYYY-MM-DD 00:00:00'), this.$moment().format('YYYY-MM-DD 23:59:59')],
scanValue: '',
},
typeV: '', typeV: '',
// 分页数据
totalCount: 0,
// pageIndex: 1,
totalPage: 1
} }
}, },
created() {
this.searchData()
// this.scanGunCode()
},
methods: { methods: {
searchData () {
var $this = this
var postData = this.resetData()
this.$axios({
method:"post",
url:`/api/MaterialDelivery/MaterialDelivery_Query?argKeyWord=${postData.argKeyWord}&argWhere=${postData.argWhere}&Stime=${postData.Stime}&Etime=${postData.Etime}`,
}).then((res)=>{
if(res.data.data.length != 0 ){
this.AllTableData = res.data.data.map(item => ({
...item,
UpdateTime: this.$moment(item.UpdateTime).format('YYYY-MM-DD HH:mm:ss')
}))
this.cloneData= JSON.parse(JSON.stringify(this.AllTableData))
if(this.AllTableData.length > this.$refs.page.pageSize){
this.tableData = this.AllTableData.slice(0, this.$refs.page.pageSize)
}else{
this.tableData = this.AllTableData
}
this.totalCount = this.AllTableData.length
// this.pageIndex = 1
this.totalPage = Math.ceil(this.AllTableData.length / this.$refs.page.pageSize)
}else{
this.tableData = []
this.totalCount = 0
// this.pageIndex = 1
this.totalPage = 1
}
this.pageFun(1)
}).catch(function(err){
console.log('err',err)
})
},
handleSelectionChange (val) { handleSelectionChange (val) {
this.checkList = val this.checkList = val
}, },
// 分页方法 // 分页方法
pageFun(num){ pageFun(num){
if(num == 1){ if(num == 1){
this.tableData = this.AllTableData.slice(0,50) this.tableData = this.cloneData.slice(0, this.$refs.page.pageSize)
}else{ }else{
this.tableData = this.AllTableData.slice((num-1)*this.pageSize + 1,this.pageSize*num) this.tableData = this.cloneData.slice((num-1)*this.$refs.page.pageSize,this.$refs.page.pageSize*num)
} }
}, },
delData () { delData () {
if (this.checkList.length === 0) { var $this = this
this.deleteShow = true if ($this.checkList.length === 0) {
this.typeV = 2 $this.deleteShow = true
$this.typeV = 2
} else {
var list = []
$this.checkList.forEach((item) => {
list.push(item.ID)
})
$this.$axios({
method:"post",
url:`/api/MaterialDelivery/MaterialDelivery_Delete`,
data:list
}).then((res)=>{
let postData = this.resetData()
$this.searchData(postData)
})
}
},
resetData () {
return {
argKeyWord: this.formData.argKeyWord,
argWhere: this.formData.argWhere,
Stime: this.formData.dateValue ? this.$moment(this.formData.dateValue[0]).format('YYYY-MM-DD HH:mm:ss') : '',
Etime: this.formData.dateValue ? this.$moment(this.formData.dateValue[1]).format('YYYY-MM-DD HH:mm:ss') : ''
} }
}, },
//关闭提示弹窗 //关闭提示弹窗
...@@ -149,8 +202,30 @@ export default { ...@@ -149,8 +202,30 @@ export default {
this.popShow = false this.popShow = false
}, },
conserve (data) { conserve (data) {
console.log(data) var $this = this
this.popShow = false this.$axios({
method:"post",
url:`/api/MaterialDelivery/MaterialDelivery_WindowAddSave`,
data:data
}).then((res)=>{
if(res.data.code != 0){
$this.typeV = '5'
$this.deleteShow = true
}else{
$this.typeV = '6'
$this.popShow = false
}
$this.deletetext = res.data.msg
var postData = {
argKeyWord: this.formData.argKeyWord,
argWhere: this.formData.argWhere,
Stime: $this.$refs.dateValue ? $this.$moment(this.dateValue[0]).format('YYYY-MM-DD HH:mm:ss') : '',
Etime: $this.$refs.dateValue ? $this.$moment(this.dateValue[1]).format('YYYY-MM-DD HH:mm:ss') : ''
}
$this.searchData(postData)
}).catch(function(err){
console.log('err',err)
})
} }
} }
} }
......
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
> >
</el-table-column> </el-table-column>
</el-table> </el-table>
<Pagination :totalCount="totalCount" :pageIndex="pageIndex" :totalPage="totalPage" @pageFun="pageFun" /> <Pagination ref="page" :totalCount="totalCount" :totalPage="totalPage" @pageFun="pageFun" />
</div> </div>
<store-dialog :titleText="'物料入库单'" v-if="popShow" @closeDialog="closeDialog" @conserve="conserve" /> <store-dialog :titleText="'物料入库单'" v-if="popShow" @closeDialog="closeDialog" @conserve="conserve" />
<delete-pop ref="delete" :deletetext="deletetext" :type="typeV" v-if="deleteShow"></delete-pop> <delete-pop ref="delete" :deletetext="deletetext" :type="typeV" v-if="deleteShow"></delete-pop>
...@@ -95,6 +95,7 @@ export default { ...@@ -95,6 +95,7 @@ export default {
return { return {
tableData: [], tableData: [],
AllTableData: [], AllTableData: [],
cloneData: [],
formData: { formData: {
argKeyWord: '', argKeyWord: '',
argWhere: '', argWhere: '',
...@@ -108,8 +109,8 @@ export default { ...@@ -108,8 +109,8 @@ export default {
typeV: '', typeV: '',
// 分页数据 // 分页数据
totalCount: 0, totalCount: 0,
pageIndex: 1, // pageIndex: 1,
totalPage: 1, totalPage: 1
} }
}, },
created() { created() {
...@@ -119,12 +120,7 @@ export default { ...@@ -119,12 +120,7 @@ export default {
methods: { methods: {
searchData () { searchData () {
var $this = this var $this = this
var postData = { var postData = this.resetData()
argKeyWord: this.formData.argKeyWord,
argWhere: this.formData.argWhere,
Stime: this.formData.dateValue ? this.$moment(this.formData.dateValue[0]).format('YYYY-MM-DD HH:mm:ss') : '',
Etime: this.formData.dateValue ? this.$moment(this.formData.dateValue[1]).format('YYYY-MM-DD HH:mm:ss') : ''
}
this.$axios({ this.$axios({
method:"post", method:"post",
url:`/api/MaterialWarehousing/MaterialWarehousing_Query?argKeyWord=${postData.argKeyWord}&argWhere=${postData.argWhere}&Stime=${postData.Stime}&Etime=${postData.Etime}`, url:`/api/MaterialWarehousing/MaterialWarehousing_Query?argKeyWord=${postData.argKeyWord}&argWhere=${postData.argWhere}&Stime=${postData.Stime}&Etime=${postData.Etime}`,
...@@ -134,20 +130,23 @@ export default { ...@@ -134,20 +130,23 @@ export default {
...item, ...item,
UpdateTime: this.$moment(item.UpdateTime).format('YYYY-MM-DD HH:mm:ss') UpdateTime: this.$moment(item.UpdateTime).format('YYYY-MM-DD HH:mm:ss')
})) }))
if(this.AllTableData.length >50){ // 克隆一份tableData数据
this.tableData = this.AllTableData.slice(0,50) this.cloneData= JSON.parse(JSON.stringify(this.AllTableData))
if(this.AllTableData.length > this.$refs.page.pageSize){
this.tableData = this.AllTableData.slice(0, this.$refs.page.pageSize)
}else{ }else{
this.tableData = this.AllTableData this.tableData = this.AllTableData
} }
this.totalCount = this.AllTableData.length this.totalCount = this.AllTableData.length
this.pageIndex = 1 // this.pageIndex = 1
this.totalPage = Math.ceil(this.AllTableData.length / 50) this.totalPage = Math.ceil(this.AllTableData.length / this.$refs.page.pageSize)
}else{ }else{
this.tableData = [] this.tableData = []
this.totalCount = 0 this.totalCount = 0
this.pageIndex = 1 // this.pageIndex = 1
this.totalPage = 1 this.totalPage = 1
} }
this.pageFun(1)
}).catch(function(err){ }).catch(function(err){
console.log('err',err) console.log('err',err)
}) })
...@@ -158,9 +157,9 @@ export default { ...@@ -158,9 +157,9 @@ export default {
// 分页方法 // 分页方法
pageFun(num){ pageFun(num){
if(num == 1){ if(num == 1){
this.tableData = this.AllTableData.slice(0,50) this.tableData = this.cloneData.slice(0, this.$refs.page.pageSize)
}else{ }else{
this.tableData = this.AllTableData.slice((num-1)*this.pageSize + 1,this.pageSize*num) this.tableData = this.cloneData.slice((num-1)*this.$refs.page.pageSize,this.$refs.page.pageSize*num)
} }
}, },
// 扫码枪扫码 // 扫码枪扫码
...@@ -186,48 +185,40 @@ export default { ...@@ -186,48 +185,40 @@ export default {
console.log('扫码结束') console.log('扫码结束')
// this.loading = true // this.loading = true
const cacheCode = barCode const cacheCode = barCode
this.$axios({
method:"post",
url:`/api/MaterialWarehousing/MaterialDelivery_ScanCodeAdd`,
data: {
ScanCode: cacheCode
}
}).then((res)=>{
var postData = {
argKeyWord: this.formData.argKeyWord,
argWhere: this.formData.argWhere,
Stime: this.formData.dateValue ? this.$moment(this.formData.dateValue[0]).format('YYYY-MM-DD HH:mm:ss') : '',
Etime: this.formData.dateValue ? this.$moment(this.formData.dateValue[1]).format('YYYY-MM-DD HH:mm:ss') : ''
}
this.searchData(this.postData)
})
// request({ // request({
// url: `/returnOrder/scanCodeForReturnOrder/${this.$route.query.id}`, // url: `/api/MaterialWarehousing/MaterialDelivery_ScanCodeAdd`,
// method: 'put', // method: 'put',
// data: { // data: {
// barcode: cacheCode // ScanCode: cacheCode
// } // }
// }) // })
// .then(res => { // .then(res => {
// this.loading = false // // this.loading = false
// if (res.data.code === 200) { // var postData = {
// if (res.data.data.returnInfo.length === 1) { // argKeyWord: this.formData.argKeyWord,
// // 只有一个商品直接更新数量 // argWhere: this.formData.argWhere,
// const data = res.data.data.returnInfo[0] // Stime: this.formData.dateValue ? this.$moment(this.formData.dateValue[0]).format('YYYY-MM-DD HH:mm:ss') : '',
// request({ // Etime: this.formData.dateValue ? this.$moment(this.formData.dateValue[1]).format('YYYY-MM-DD HH:mm:ss') : ''
// url: `/returnOrder/returnOrderGoods/${data.id}`,
// method: 'put',
// data: {
// ...data,
// realNum: data.realNum + 1,
// code: cacheCode
// }
// }).then(res => {
// if (res.data.code === 200) {
// this.$message.success('扫描成功')
// this.print(data.id)
// this.getDetails(true)
// }
// })
// } else if (res.data.data.returnInfo.length >= 2) {
// // 多个商品弹窗
// this.editModal = {
// loading: false,
// type: 12,
// show: true,
// editData: res.data.data,
// code: cacheCode
// }
// }
// } // }
// $this.searchData(this.postData)
// }) // })
// .catch(() => { // .catch(() => {
// this.loading = false // // this.loading = false
// }) // })
barCode = '' barCode = ''
lastCode = '' lastCode = ''
...@@ -253,6 +244,14 @@ export default { ...@@ -253,6 +244,14 @@ export default {
console.log(lastCode) console.log(lastCode)
} }
}, },
resetData () {
return {
argKeyWord: this.formData.argKeyWord,
argWhere: this.formData.argWhere,
Stime: this.formData.dateValue ? this.$moment(this.formData.dateValue[0]).format('YYYY-MM-DD HH:mm:ss') : '',
Etime: this.formData.dateValue ? this.$moment(this.formData.dateValue[1]).format('YYYY-MM-DD HH:mm:ss') : ''
}
},
delData () { delData () {
var $this = this var $this = this
if ($this.checkList.length === 0) { if ($this.checkList.length === 0) {
...@@ -268,12 +267,7 @@ export default { ...@@ -268,12 +267,7 @@ export default {
url:`/api/MaterialDelivery/MaterialDelivery_Delete`, url:`/api/MaterialDelivery/MaterialDelivery_Delete`,
data:list data:list
}).then((res)=>{ }).then((res)=>{
var postData = { var postData = $this.resetData()
argKeyWord: this.formData.argKeyWord,
argWhere: this.formData.argWhere,
Stime: $this.$refs.dateValue ? $this.$moment(this.dateValue[0]).format('YYYY-MM-DD HH:mm:ss') : '',
Etime: $this.$refs.dateValue ? $this.$moment(this.dateValue[1]).format('YYYY-MM-DD HH:mm:ss') : ''
}
$this.searchData(postData) $this.searchData(postData)
}) })
} }
......
...@@ -31,7 +31,11 @@ export default { ...@@ -31,7 +31,11 @@ export default {
totalPage: { totalPage: {
type: Number, type: Number,
default: 1, default: 1,
} },
// allTableData: {
// type: Number,
// default: 0,
// },
}, },
data () { data () {
return { return {
...@@ -42,6 +46,9 @@ export default { ...@@ -42,6 +46,9 @@ export default {
// totalPage: 1, // totalPage: 1,
pageSize: 50, pageSize: 50,
} }
},
created () {
}, },
methods: { methods: {
// 分页方法 // 分页方法
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<div class="centen_row" > <div class="centen_row" >
<span class="centen_row_text">线体编号:</span> <span class="centen_row_text">线体编号:</span>
<div class="centen_row_select"> <div class="centen_row_select">
<el-select v-model="MID" placeholder="请选择"> <el-select v-model="LID" placeholder="请选择">
<el-option <el-option
v-for="item in lineList" v-for="item in lineList"
:key="item.Name" :key="item.Name"
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<div class="centen_row" style="margin-top:10px"> <div class="centen_row" style="margin-top:10px">
<span class="centen_row_text" >物料编号:</span> <span class="centen_row_text" >物料编号:</span>
<div class="centen_row_select"> <div class="centen_row_select">
<el-select v-model="LID" placeholder="请选择"> <el-select v-model="MID" placeholder="请选择">
<el-option <el-option
v-for="item in materList" v-for="item in materList"
:key="item.Name" :key="item.Name"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment