Commit df32524e authored by 徐来柯's avatar 徐来柯

update

parent cb201e79
<template>
<div class="box-container">
<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
border
height="675"
......@@ -24,11 +24,11 @@
<el-table-column
label="入库编号"
:show-overflow-tooltip="true"
prop="SID"
prop="MHSort"
width="180">
</el-table-column>
<el-table-column
prop="ProductName"
prop="xtid"
label="线体编号"
:show-overflow-tooltip="true"
width="180">
......@@ -36,47 +36,47 @@
<el-table-column
label="线体名称"
:show-overflow-tooltip="true"
prop="ProductType"
prop="linname"
width="180">
</el-table-column>
<el-table-column
label="物料编号"
:show-overflow-tooltip="true"
prop="PlanType"
prop="MHSort"
width="180">
</el-table-column>
<el-table-column
label="物料名称"
:show-overflow-tooltip="true"
prop="PlanType"
prop="wlname"
width="180">
</el-table-column>
<el-table-column
label="物料描述"
:show-overflow-tooltip="true"
prop="PlanType"
prop="wlDesc"
width="210">
</el-table-column>
<el-table-column
label="单位"
:show-overflow-tooltip="true"
prop="LineName"
prop="Company"
width="140">
</el-table-column>
<el-table-column
label="入库数量"
:show-overflow-tooltip="true"
prop="UserName"
prop="MHNuber"
width="180">
</el-table-column>
<el-table-column
label="入库时间"
:show-overflow-tooltip="true"
prop="StartDt"
prop="UpdateTime"
>
</el-table-column>
</el-table>
<Pagination @pageFun="pageFun" />
<Pagination :totalCount="totalCount" :pageIndex="pageIndex" :totalPage="totalPage" @pageFun="pageFun" />
</div>
<store-dialog :titleText="'物料入库单'" v-if="popShow" @closeDialog="closeDialog" @conserve="conserve" />
<delete-pop ref="delete" :deletetext="deletetext" :type="typeV" v-if="deleteShow"></delete-pop>
......@@ -95,17 +95,63 @@ export default {
return {
tableData: [],
AllTableData: [],
formData: {
argKeyWord: '',
argWhere: '',
dateValue: [this.$moment().format('YYYY-MM-DD 00:00:00'), this.$moment().format('YYYY-MM-DD 23:59:59')],
scanValue: '',
},
popShow: false,
checkList: [],
deletetext: '',
deleteShow: false,
typeV: '',
// 分页数据
totalCount: 0,
pageIndex: 1,
totalPage: 1,
}
},
mounted() {
created() {
this.searchData()
this.scanGunCode()
},
methods: {
searchData () {
var $this = this
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.$axios({
method:"post",
url:`/api/MaterialWarehousing/MaterialWarehousing_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')
}))
if(this.AllTableData.length >50){
this.tableData = this.AllTableData.slice(0,50)
}else{
this.tableData = this.AllTableData
}
this.totalCount = this.AllTableData.length
this.pageIndex = 1
this.totalPage = Math.ceil(this.AllTableData.length / 50)
}else{
this.tableData = []
this.totalCount = 0
this.pageIndex = 1
this.totalPage = 1
}
}).catch(function(err){
console.log('err',err)
})
},
handleSelectionChange (val) {
this.checkList = val
},
......@@ -208,9 +254,28 @@ export default {
}
},
delData () {
if (this.checkList.length === 0) {
this.deleteShow = true
this.typeV = 2
var $this = this
if ($this.checkList.length === 0) {
$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)=>{
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)
})
}
},
//关闭提示弹窗
......@@ -224,8 +289,30 @@ export default {
this.popShow = false
},
conserve (data) {
console.log(data)
this.popShow = false
var $this = this
this.$axios({
method:"post",
url:`/api/MaterialWarehousing/MWarehousing_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)
})
}
}
}
......
......@@ -19,13 +19,27 @@
<script>
export default {
props: {
totalCount: {
type: Number,
default: 0,
},
pageIndex: {
type: Number,
default: 1,
},
totalPage: {
type: Number,
default: 1,
}
},
data () {
return {
num: 1,
// 首字母已改为小写
totalCount: 1,
pageIndex: 1,
totalPage: 1,
// totalCount: 1,
// pageIndex: 1,
// totalPage: 1,
pageSize: 50,
}
},
......
......@@ -3,11 +3,11 @@
<div class="search-list" >
<div class="search-block" v-if="formList.includes(1)" >
<span class="search" >{{headText}}:</span>
<el-select class="selectName" v-model="selectValue" placeholder="请选择">
<el-select class="selectName" v-model="formData.argWhere" placeholder="请选择">
<el-option
v-for="item in searchList"
:key="item.name"
:label="item.name"
:label="item.id"
:value="item.name">
</el-option>
</el-select>
......@@ -16,7 +16,7 @@
<div class="search-block" v-if="formList.includes(2)">
<el-date-picker
class="selectName"
v-model="dateValue"
v-model="formData.dateValue"
type="datetimerange"
start-placeholder="开始日期"
end-placeholder="结束日期"
......@@ -25,13 +25,13 @@
</div>
<div class="search-block search-input" v-if="formList.includes(1)">
<el-input type="text" v-model="inputValue" :placeholder="placeText"></el-input>
<el-input type="text" v-model="formData.argKeyWord" :placeholder="placeText"></el-input>
</div>
<div class="search-btn" @click="searchData" >查询</div>
<div class="search-block search-input" v-if="formList.includes(3)" style="margin-left: 20px">
<el-input type="text" v-model="scanValue"></el-input>
<el-input type="text" v-model="formData.scanValue"></el-input>
</div>
</div>
......@@ -69,6 +69,12 @@ export default {
return []
}
},
formData: {
type: Object,
default() {
return {}
}
},
btnList: {
// 1: 添加按钮 2: 删除按钮
type: Array,
......@@ -79,11 +85,44 @@ export default {
},
data () {
return {
selectValue: '',
inputValue: '',
scanValue: '',
dateValue: [moment().format('YYYY-MM-DD 00:00:00'), moment().format('YYYY-MM-DD 23:59:59')],
searchList: []
// selectValue: '',
// inputValue: '',
// scanValue: '',
// dateValue: [moment().format('YYYY-MM-DD 00:00:00'), moment().format('YYYY-MM-DD 23:59:59')],
searchList: [
{
id: '不限',
name: ''
},
{
id: '入库编号',
name: '入库编号'
},
{
id: '线体编号',
name: '线体编号'
},
{
id: '线体名称',
name: '线体名称'
},
{
id: '物料编号',
name: '物料编号'
},
{
id: '物料名称',
name: '物料名称'
},
{
id: '物料描述',
name: '物料描述'
},
{
id: '入库时间',
name: '入库时间'
},
]
}
},
created () {
......@@ -91,13 +130,7 @@ export default {
},
methods: {
searchData () {
var searchData = {
selectValue: this.selectValue,
inputValue: this.inputValue,
dateValue: this.dateValue,
scanValue: this.scanValue,
}
console.log(searchData)
this.$emit('searchData')
},
delData () {
this.$emit('delData')
......@@ -105,37 +138,6 @@ export default {
openDialog () {
this.$emit('openDialog')
}
// queryProduct(){
// var value = ''
// this.$axios({
// method:"post",
// url:`/api/Product/Product_Query?argKeyWord=${value}`,
// }).then((res)=>{
// this.HeadData = res.data.data
// if(this.HeadData.length != 0){
// for(let i2=0;i2<this.HeadData.length;i2++){
// var value4 = {
// id:this.HeadData[i2].ID,
// name:this.HeadData[i2].Name
// }
// this.productNameArr.push(value4)
// }
// var value = {
// id:'00000000-0000-0000-0000-000000000000',
// name:'不限'
// }
// this.productNameArr.unshift(value)
// }else{
// var value3 = {
// id:'00000000-0000-0000-0000-000000000000',
// name:'不限'
// }
// this.productNameArr.push(value3)
// }
// }).catch(function(err){
// console.log('err',err)
// })
// },
}
}
</script>
......
......@@ -10,12 +10,12 @@
<div class="centen_row" >
<span class="centen_row_text">线体编号:</span>
<div class="centen_row_select">
<el-select v-model="value" placeholder="请选择">
<el-select v-model="MID" placeholder="请选择">
<el-option
v-for="item in planList"
:key="item.PlanType"
:label="item.PlanType"
:value="item.PlanType">
v-for="item in lineList"
:key="item.Name"
:label="item.Name"
:value="item.ID">
</el-option>
</el-select>
</div>
......@@ -23,12 +23,12 @@
<div class="centen_row" style="margin-top:10px">
<span class="centen_row_text" >物料编号:</span>
<div class="centen_row_select">
<el-select v-model="value1" placeholder="请选择">
<el-select v-model="LID" placeholder="请选择">
<el-option
v-for="item in materList"
:key="item.LineName"
:label="item.LineName"
:value="item.LineName">
:key="item.Name"
:label="item.Name"
:value="item.ID">
</el-option>
</el-select>
</div>
......@@ -38,7 +38,7 @@
<span class="centen_row_text" v-if="type === 'in'" >入库数量:</span>
<span class="centen_row_text" v-if="type === 'out'" >出库数量:</span>
<div class="centen_row_select">
<el-input @change="numFun()" v-model="count" placeholder="请输入数量"></el-input>
<el-input @change="numFun()" v-model="quantity" placeholder="请输入数量"></el-input>
</div>
</div>
......@@ -54,15 +54,6 @@
<script>
export default {
data() {
return {
count: '',
value: '',
value1 : '',
planList: [],
materList: []
}
},
props: {
titleText: {
type: String,
......@@ -73,6 +64,15 @@ export default {
default: 'in',
},
},
data() {
return {
MID: '',
LID: '',
quantity : '',
lineList: [],
materList: []
}
},
directives: {
drag: function(el) {
let dragBox = el; //获取当前元素
......@@ -96,7 +96,10 @@ export default {
};
}
},
created () {
this.getLines()
this.getMaters()
},
methods:{
// guid() {
// return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
......@@ -118,12 +121,28 @@ export default {
}
},
conserve () {
var dialogData = {
count: this.count,
value: this.value,
value1 : this.value1,
var postData = {
MID: this.MID,
LID: this.LID,
Quantity : this.quantity,
}
this.$emit('conserve', dialogData)
this.$emit('conserve', postData)
},
getLines () {
this.$axios({
method:"post",
url:`/api/MaterialDelivery/MaterialDelivery_LinesData`,
}).then((res)=>{
this.lineList = res.data.data
})
},
getMaters () {
this.$axios({
method:"post",
url:`/api/MaterialDelivery/MaterialDelivery_PlansData`,
}).then((res)=>{
this.materList = res.data.data
})
}
}
}
......
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