
4 changed files with 725 additions and 540 deletions
@ -0,0 +1,448 @@ |
|||
<template> |
|||
<div> |
|||
<div class="tab-header webtop"> |
|||
<div>{{ viewTitle }}</div> |
|||
<div> |
|||
<el-button type="primary" size="small" @click="saveOrUpdate" |
|||
>保存</el-button |
|||
> |
|||
<el-button type="info" size="small" @click="handleReturn()" |
|||
>返回</el-button |
|||
> |
|||
</div> |
|||
</div> |
|||
<div class="listconadd"> |
|||
<el-form ref="dataForm" :model="purchaseForm" label-position="top" label-width="190px" class="formadd"> |
|||
<div class="title" style="display: flex;align-items: center;justify-content: space-between;height:40px"> |
|||
<div style="margin-left: 15px;">主体信息</div> |
|||
</div> |
|||
<el-row> |
|||
<el-col :span="4" class="trightb"> |
|||
<el-form-item class="trightb_item"> |
|||
<span slot="label">订单编号:</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item class="trightb_item" prop="no"> |
|||
<el-input :disabled="true" v-model="purchaseForm.no"></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
|
|||
<el-col :span="4" class="trightb"> |
|||
<el-form-item class="trightb_item"> |
|||
<span slot="label">订单日期:</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item class="trightb_item"> |
|||
<!-- <span>{{temp.bankName}}</span> --> |
|||
<el-date-picker v-model="purchaseForm.applicationDate" type="date" style="width: 100%;" |
|||
format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="请选择" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
|
|||
<el-row> |
|||
<el-col :span="4" class="trightb"> |
|||
<el-form-item class="trightb_item"> |
|||
<span slot="label">供货单位:</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item prop="supplier" class="trightb_item"> |
|||
<el-select v-model="purchaseForm.custerSid" placeholder="请选择" > |
|||
<el-option |
|||
v-for="(supplier,i) in supplierList" |
|||
:key="i" |
|||
:label="supplier.name" |
|||
:value="supplier.id"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4" class="trightb"> |
|||
<el-form-item class="trightb_item"> |
|||
<span slot="label">采购申请人:</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item class="trightb_item"> |
|||
<el-input v-model="purchaseForm.creatorName" placeholder="采购申请人" clearable /> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
|
|||
<el-row> |
|||
<el-col :span="4" class="trightb"> |
|||
<el-form-item class="trightb_item"> |
|||
<span slot="label">出库仓库:</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item class="trightb_item"> |
|||
<el-select v-model="purchaseForm.storeHouseSid" placeholder="请选择" > |
|||
<el-option |
|||
v-for="(storehouse,i) in storehouseList" |
|||
:key="i" |
|||
:label="storehouse.name" |
|||
:value="storehouse.sid"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4" class="trightb"> |
|||
<el-form-item class="trightb_item"> |
|||
<span slot="label">出库日期:</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item class="trightb_item"> |
|||
<el-date-picker v-model="purchaseForm.purchaseDate" type="date" style="width: 100%;" |
|||
format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="请选择" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
|
|||
<el-collapse v-model="activeNames"> |
|||
<el-collapse-item name="1"> |
|||
<template slot="title" > |
|||
<span style="margin-left: 15px;">出库商品明细</span><span class="span" @click.stop="add()">添加</span> |
|||
</template> |
|||
<el-table :data="purchaseForm.list" border style="width: 100%;" |
|||
:row-style="{height: '40px'}"> |
|||
<el-table-column label="质物名称" width="120" prop="proName" align="center"> |
|||
<template slot-scope="scope"> |
|||
<el-select v-model="scope.row.proName" placeholder="请选择" > |
|||
<el-option |
|||
v-for="product in productList" |
|||
:key="product.name" |
|||
:label="product.name" |
|||
:value="product.name"> |
|||
</el-option> |
|||
</el-select> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="规格(型号)" width="120" prop="proModel" align="center"> |
|||
<template slot-scope="scope"> |
|||
<el-input v-model="scope.row.proModel" placeholder="商品品类" clearable></el-input> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="成产厂家(产地)" width="150" prop="manufacturer" align="center"> |
|||
<template slot-scope="scope"> |
|||
<el-input v-model="scope.row.manufacturer" placeholder="商品品牌" clearable></el-input> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="数量/重量" width="140" prop="estimateNum" align="center"> |
|||
<template slot-scope="scope"> |
|||
<el-input v-model="scope.row.estimateNum" @input="limitInput2($event,scope.$index)" placeholder="" clearable></el-input> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="单价(元)" width="140" prop="estimateconfirmedPrice" align="center"> |
|||
<template slot-scope="scope"> |
|||
<el-input v-model="scope.row.estimateconfirmedPrice" @input="limitInput1($event,scope.$index)" placeholder="" clearable></el-input> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="出库价值(元)" width="150px" prop="estimateCalculatedValue" align="center"> |
|||
<template slot-scope="scope"> |
|||
<el-input v-model="scope.row.estimateCalculatedValue" :readonly="true" placeholder="" clearable></el-input> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="库存价值(元)" width="130" prop="realityCalculatedValue" align="center"> |
|||
<template slot-scope="scope"> |
|||
<el-input v-model="scope.row.realityCalculatedValue" placeholder="" clearable></el-input> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="货位号" width="150" prop="locationNumber" align="center"> |
|||
<template slot-scope="scope"> |
|||
<el-input v-model="scope.row.locationNumber" placeholder="" clearable></el-input> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column label="操作" fixed="right" align="center" width="150"> |
|||
<template slot-scope="scope"> |
|||
<el-button type="primary" size="mini" @click="doCommoditylDel(scope.$index)">删除</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
|
|||
</el-collapse-item> |
|||
</el-collapse> |
|||
</el-form> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
|
|||
export default { |
|||
name: "outListAdd", |
|||
components: { |
|||
|
|||
}, |
|||
data() { |
|||
return { |
|||
viewTitle: "【新增】出库订单", |
|||
purchaseForm: { |
|||
purchaseId: '', |
|||
product: '', |
|||
barCode: '', |
|||
applicationDate:'', |
|||
no:'', |
|||
supplier: '', |
|||
creatorName:'', |
|||
storehouseName:'', |
|||
storeHouseSid:"", |
|||
custerName:'', |
|||
custerSid:'', |
|||
list:[] |
|||
}, |
|||
supplierList: [], |
|||
storehouseList: [], |
|||
productList: [], |
|||
productList2: [], |
|||
custList: [], |
|||
selectPurchaseList: [], |
|||
activeNames: ['1'], |
|||
rules: { |
|||
product: [ |
|||
{ required: true, message: '请输入商品名', trigger: 'blur' } |
|||
], |
|||
supplier: [ |
|||
{ required: true, message: '请输入供应商', trigger: 'blur' } |
|||
], |
|||
count: [ |
|||
{ required: true, message: '请输入商品数量', trigger: 'blur' } |
|||
], |
|||
storehouse: [ |
|||
{ required: true, message: '请输入所属仓库', trigger: 'blur' } |
|||
] |
|||
} |
|||
}; |
|||
}, |
|||
mounted() { |
|||
|
|||
}, |
|||
created() { |
|||
this.getProductList() |
|||
this.getSupplierList() |
|||
this.getStorehouseList() |
|||
this.getcustListList() |
|||
this.openAddPurchaseDialog() |
|||
}, |
|||
methods: { |
|||
handleReturn(isreload) { |
|||
if (isreload === "true") this.$emit("reloadlist"); |
|||
this.clearList() |
|||
this.$emit("doback"); |
|||
}, |
|||
clearList() { |
|||
this.purchaseForm={ |
|||
applicationDate:'', |
|||
no:'', |
|||
supplier: '', |
|||
storehouseName:'', |
|||
storeHouseSid:"", |
|||
custerName:'', |
|||
custerSid:'', |
|||
storehouse: '', |
|||
status: '', |
|||
list:[] |
|||
|
|||
} |
|||
}, |
|||
saveOrUpdate(){ |
|||
// this.storehouseList.forEach((v, i) => { |
|||
// if(v.sid == this.purchaseForm.storeHouseSid){ |
|||
// this.purchaseForm.storehouseName = v.name |
|||
// } |
|||
// }) |
|||
// this.supplierList.forEach((v, i) => { |
|||
// if(v.name == this.purchaseForm.custerSid){ |
|||
// this.purchaseForm.custerName = v.name |
|||
// this.purchaseForm.custerSid = v.id |
|||
// }else if(v.id == this.purchaseForm.custerSid){ |
|||
// this.purchaseForm.custerName = v.name |
|||
// } |
|||
// }) |
|||
if (this.viewTitle === "【新增】出库订单") return this.addStorehouse(); |
|||
if (this.viewTitle === "【修改】出库订单") { |
|||
this.addStorehouse(); |
|||
} |
|||
}, |
|||
showAdd() { |
|||
this.viewTitle = "【新增】出库订单"; |
|||
this.clearList() |
|||
this.openAddPurchaseDialog() |
|||
}, |
|||
async showEdit(row) { |
|||
this.viewTitle = "【修改】出库订单"; |
|||
const { data: res } = await this.$http.get(`/purchasenew/fetchDetailsBySid/${row.sid}`) |
|||
if (res.code==200) { |
|||
this.purchaseForm=res.data |
|||
|
|||
this.supplierList.forEach((v, i) => { |
|||
if(v.id == res.data.custerSid){ |
|||
this.purchaseForm.custerSid = res.data.custerName |
|||
} |
|||
}) |
|||
} |
|||
}, |
|||
addStorehouse(){ |
|||
this.$refs.dataForm.validate(async validate => { |
|||
if (!validate) return this.$message.error('请填写必填项') |
|||
// this.purchaseForm.status = '待审核' |
|||
const { data: result } = await this.$http.post('/output/addOutStorehouse', this.purchaseForm) |
|||
if (result.code == 200) { |
|||
this.$message({ type: 'success', message: result.msg, showClose: true }) |
|||
this.handleReturn('true') |
|||
this.clearList() |
|||
} |
|||
}) |
|||
}, |
|||
async getSupplierList () { |
|||
const { data: result } = await this.$http.get('/purchase/getSupplier') |
|||
if (result.status !== 200) return this.$message.error('获取列表失败') |
|||
this.supplierList = result.data |
|||
}, |
|||
async getStorehouseList () { |
|||
const { data: result } = await this.$http.get("/v1/shstorehouse/listAll") |
|||
if (result.code == 200){ |
|||
this.storehouseList = result.data |
|||
} |
|||
}, |
|||
async getProductList () { |
|||
const { data: result } = await this.$http.get('/purchase/getProductList', { params: { name: this.purchaseForm.product } }) |
|||
if (result.status !== 200) return this.$message.error('获取商品列表失败') |
|||
this.productList = result.data |
|||
this.purchaseForm.barCode = this.productList[0].barCode |
|||
}, |
|||
async getcustListList () { |
|||
const { data: result } = await this.$http.get('/v1/shstorehouse/fetchEntList') |
|||
if (result.code == 200){ |
|||
this.custList = result.data |
|||
} |
|||
}, |
|||
openAddPurchaseDialog () { |
|||
var now = new Date() |
|||
this.purchaseForm.no = 'IP' + now.getTime() |
|||
if (this.productList2.length == 0) this.productList2 = this.productList |
|||
this.add() |
|||
}, |
|||
add(){ |
|||
this.purchaseForm.list.push({ |
|||
|
|||
}) |
|||
}, |
|||
doCommoditylDel(index) { |
|||
|
|||
const tip = '请确认是否删除所选记录?' |
|||
this.$confirm(tip, '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
this.purchaseForm.list.splice(index, 1); |
|||
}) |
|||
}, |
|||
getLists(){ |
|||
let arrList=this.purchaseForm.list |
|||
for(let i=0;i<arrList.length;i++){ |
|||
if(arrList[i].estimateNum && arrList[i].estimateConfirmedPrice){ |
|||
let newValue=parseFloat(arrList[i].estimateNum) * parseFloat(arrList[i].estimateConfirmedPrice) || 0 |
|||
let getValue=Math.floor(newValue*100)/100 |
|||
this.$set(arrList[i], 'estimateCalculatedValue', getValue) |
|||
}else{ |
|||
this.$set(arrList[i], 'estimateCalculatedValue', '') |
|||
} |
|||
} |
|||
}, |
|||
limitInput1(value, index) { |
|||
this.purchaseForm.list[index].estimateConfirmedPrice = |
|||
("" + value) // 第一步:转成字符串 |
|||
.replace(/[^\d^\.]+/g, "") // 第二步:把不是数字,不是小数点的过滤掉 |
|||
.replace(/^0+(\d)/, "$1") // 第三步:第一位0开头,0后面为数字,则过滤掉,取后面的数字 |
|||
.replace(/^\./, "0.") // 第四步:如果输入的第一位为小数点,则替换成 0. 实现自动补全 |
|||
.match(/^\d*(\.?\d{0,2})/g)[0] || ""; // 第五步:最终匹配得到结果 以数字开头,只有一个小数点,而且小数点后面只能有0到2位小数 |
|||
this.getLists() |
|||
}, |
|||
limitInput2(value, index) { |
|||
this.purchaseForm.list[index].estimateNum = |
|||
("" + value) // 第一步:转成字符串 |
|||
.replace(/[^\d^\.]+/g, "") // 第二步:把不是数字,不是小数点的过滤掉 |
|||
.replace(/^0+(\d)/, "$1") // 第三步:第一位0开头,0后面为数字,则过滤掉,取后面的数字 |
|||
.replace(/^\./, "0.") // 第四步:如果输入的第一位为小数点,则替换成 0. 实现自动补全 |
|||
.match(/^\d*(\.?\d{0,2})/g)[0] || ""; // 第五步:最终匹配得到结果 以数字开头,只有一个小数点,而且小数点后面只能有0到2位小数 |
|||
this.getLists() |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
<style scoped> |
|||
/deep/ .el-collapse-item__header { |
|||
height: 40px; |
|||
font-weight: bold; |
|||
font-size: 16px; |
|||
text-align: left; |
|||
color: #ffffff; |
|||
background-color: #0294d7; |
|||
} |
|||
|
|||
/deep/ .el-collapse-item__content { |
|||
padding-bottom: 0; |
|||
} |
|||
.trightb { |
|||
display: flex; |
|||
align-items: center; |
|||
text-align: center; |
|||
justify-content: center; |
|||
} |
|||
|
|||
.trightb_item { |
|||
padding-top: 5px; |
|||
} |
|||
|
|||
.span { |
|||
margin-left: 50px; |
|||
font-size: 15px; |
|||
font-weight: 400; |
|||
} |
|||
.formadd { |
|||
padding: 10px 40px 0 40px; |
|||
font-size: 16px; |
|||
} |
|||
.formadd .title { |
|||
font-weight: bold; |
|||
font-size: 16px; |
|||
background-color: #0294d7; |
|||
text-align: left; |
|||
color: #ffffff; |
|||
} |
|||
.first_row{ |
|||
border-top: 1px solid #e0e3eb; |
|||
} |
|||
.formadd .el-row { |
|||
display: flex; |
|||
flex-wrap: wrap; |
|||
border-left: 1px solid #e0e3eb; |
|||
} |
|||
.formadd .el-row .el-col { |
|||
border-right: 1px solid #e0e3eb; |
|||
border-bottom: 1px solid #e0e3eb; |
|||
padding: 0 15px; |
|||
min-height: 42px; |
|||
line-height: 1; |
|||
} |
|||
.formadd .el-row .el-col .el-form-item { |
|||
margin-bottom: 0; |
|||
line-height: 42px; |
|||
} |
|||
.addinputw { |
|||
width: 80%; |
|||
line-height: 42px; |
|||
} |
|||
.el-input__inner { |
|||
height: 36px; |
|||
} |
|||
</style> |
|||
|
@ -1,553 +1,282 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<div> |
|||
<button-bar ref="btnbar" view-title="出库订单管理" :btndisabled="btndisabled" @btnhandle="btnHandle" /> |
|||
<div v-show="viewState == 1"> |
|||
<button-bar ref="btnbar" view-title="采购订单管理" :btndisabled="btndisabled" @btnhandle="btnHandle" /> |
|||
<div class="main-content"> |
|||
<div class="searchcon"> |
|||
<el-button size="small" class="searchbtn" @click="isSearchShow = !isSearchShow">{{ isSearchShow ? '隐藏查询条件' : '显示查询条件' }}</el-button> |
|||
<div v-show="isSearchShow" class="search"> |
|||
<el-form ref="queryInfo" :inline="true" :model="queryInfo" class="tab-header"> |
|||
<el-form-item label="出库单号"> |
|||
<el-input v-model="queryInfo.no" placeholder="请输入出库单号" clearable /> |
|||
</el-form-item> |
|||
</el-form> |
|||
<div class="btn" style="text-align: center;"> |
|||
<el-button type="primary" size="small" icon="el-icon-search" @click="getOutStorehouseList">查询</el-button> |
|||
<el-button type="primary" size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button> |
|||
</div> |
|||
<div class="searchcon"> |
|||
<el-button size="small" class="searchbtn" @click="isSearchShow = !isSearchShow">{{ isSearchShow ? '隐藏查询条件' : '显示查询条件' }}</el-button> |
|||
<div v-show="isSearchShow" class="search"> |
|||
<el-form ref="queryInfo" :inline="true" :model="queryInfo" class="tab-header"> |
|||
<el-form-item label="订单编号"> |
|||
<el-input v-model="queryInfo.params.purchaseNo" placeholder="请输入订单编号" clearable /> |
|||
</el-form-item> |
|||
</el-form> |
|||
<div class="btn" style="text-align: center;"> |
|||
<el-button type="primary" size="small" icon="el-icon-search" @click="getPurchaseList">查询</el-button> |
|||
<el-button type="primary" size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button> |
|||
</div> |
|||
</div> |
|||
<!-- <el-button type="primary" @click="addOutStorehouseDialogVisible=true">新增</el-button> |
|||
<el-button type="success" @click="check" icon = "el-icon-success">审核</el-button> |
|||
<el-button type="danger" @click="cancel" icon = "el-icon-error">撤销审核</el-button> |
|||
<el-button type="success" @click="out" icon = "el-icon-success">出库</el-button> --> |
|||
<el-table :data="outStorehouseList.slice((queryInfo.pageNum-1)*queryInfo.pageSize,queryInfo.pageNum*queryInfo.pageSize)" |
|||
style="width: 100%" |
|||
stripe border fixed |
|||
@selection-change="handleSelectionChange"> |
|||
<el-table-column |
|||
fixed="left" |
|||
type="selection" |
|||
width="55"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
align="center" |
|||
label="出库单编号" |
|||
width="150"> |
|||
<template slot-scope="scope" > |
|||
<span @click="handleCheck(scope.row.sid)" style="color: #00afff;cursor:pointer;">{{ scope.row.no }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
align="center" |
|||
prop="applicationDate" |
|||
label="制单日期" |
|||
width="100"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
align="center" |
|||
prop="creatorName" |
|||
label="制单人员" |
|||
width="100"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
align="center" |
|||
prop="custerName" |
|||
label="客户(企业)名称" |
|||
width="180"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
align="center" |
|||
prop="storeHouseName" |
|||
label="仓库" |
|||
width="100"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
align="center" |
|||
prop="auditorName" |
|||
label="审核人" |
|||
width="100"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
align="center" |
|||
prop="state" |
|||
label="状态" |
|||
width="100"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
align="center" |
|||
prop="approvedDate" |
|||
label="审核日期" |
|||
width="100"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
align="center" |
|||
prop="prodNum" |
|||
label="商品信息"> |
|||
<template slot-scope="scope" > |
|||
<span @click="handleCheckProdInfo(scope.row.sid)" |
|||
style="color: #00afff;cursor:pointer;">{{ scope.row.prodNum }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<div class="pages"> |
|||
<div class="tit" /> |
|||
<pagination |
|||
v-show="outStorehouseList.length > 0" |
|||
:total="total" |
|||
:page.sync="queryInfo.pageNum" |
|||
:limit.sync="queryInfo.pageSize" |
|||
class="pagination" |
|||
@pagination="getOutStorehouseList" |
|||
/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<el-dialog :title="title" :visible.sync="outputDialogVisible" width="75%" @close="closeSupplierDialog"> |
|||
</div> |
|||
</div> |
|||
|
|||
<el-form :model="outputDetail" ref="supplierRuleForm" label-width="200px" class="demo-ruleForm" :inline="true"> |
|||
<el-form-item label="制单日期:" prop="contacts" align="center" v-show="outputDialogVisible2"> |
|||
{{outputDetail.applicationDate}} |
|||
</el-form-item> |
|||
<el-form-item label="申请单编号:" prop="no" align="center" v-show="outputDialogVisible2"> |
|||
{{outputDetail.no}} |
|||
</el-form-item> |
|||
<el-form-item label="企业名称:" prop="no" align="center" v-show="outputDialogVisible2"> |
|||
{{outputDetail.custerName}} |
|||
</el-form-item> |
|||
<el-table :data="outputDetail.list" |
|||
style="width: 100%" |
|||
stripe border fixed |
|||
@selection-change="handleSelectionChange"> |
|||
<el-table-column |
|||
align="center" |
|||
label="质物名称" |
|||
width="150"> |
|||
<template slot-scope="scope" > |
|||
<span @click="handleCheck(scope.row.sid)" style="color: #00afff;cursor:pointer;">{{ scope.row.proName }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
align="center" |
|||
prop="proModel" |
|||
label="规格(型号)" |
|||
width="130"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
align="center" |
|||
prop="manufacturer" |
|||
label="生产厂家(产地)" |
|||
width="150"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
align="center" |
|||
label="预计出库量" |
|||
width="80"> |
|||
<el-table-column |
|||
align="center" |
|||
prop="estimateNum" |
|||
label="数量" |
|||
width="80"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
align="center" |
|||
prop="estimateWeight" |
|||
label="重量" |
|||
width="100"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
align="center" |
|||
prop="estimateConfirmedPrice" |
|||
label="质权人确认的单价" |
|||
width="90"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
align="center" |
|||
prop="estimateCalculatedValue" |
|||
label="核算的价值" |
|||
width="90"> |
|||
</el-table-column> |
|||
</el-table-column> |
|||
<el-table-column |
|||
align="center" |
|||
label="实际出库量" |
|||
width="80"> |
|||
<el-table-column |
|||
align="center" |
|||
prop="realityNum" |
|||
label="数量" |
|||
width="80"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
align="center" |
|||
prop="realityWeight" |
|||
label="重量" |
|||
width="100"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
align="center" |
|||
prop="realityConfirmedPrice" |
|||
label="质权人确认的单价" |
|||
width="90"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
align="center" |
|||
prop="realityCalculatedValue" |
|||
label="核算的价值" |
|||
width="90"> |
|||
</el-table-column> |
|||
</el-table-column> |
|||
<el-table-column |
|||
align="center" |
|||
prop="locationNumber" |
|||
label="货位号" |
|||
width="100"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
align="center" |
|||
prop="remarks" |
|||
label="备注"> |
|||
</el-table-column> |
|||
</el-table> |
|||
</el-form> |
|||
</el-dialog> |
|||
<el-table :data="purchaseList" |
|||
style="width: 100%" |
|||
border> |
|||
<el-table-column label="序号" type="index" width="60" :index="indexMethod" align="center" /> |
|||
<el-table-column |
|||
prop="custName" |
|||
label="客户名称" |
|||
align="center" |
|||
width="180"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="purchaseNo" |
|||
label="订单编号" |
|||
align="center" |
|||
width="180"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="purchaseDate" |
|||
label="订单日期" |
|||
align="center" |
|||
width="180"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="supplierName" |
|||
label="供应商名称" |
|||
align="center" |
|||
width="180"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="purchasePerson" |
|||
label="采购申请人" |
|||
align="center" |
|||
width="180"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="storehouseName" |
|||
label="仓库名称" |
|||
align="center" |
|||
width="180"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="state" |
|||
label="状态" |
|||
align="center" |
|||
width="180"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
fixed="right" |
|||
prop="operate" |
|||
label="操作" |
|||
width="300" |
|||
align="center"> |
|||
<template slot-scope="scope" > |
|||
<el-button |
|||
type="primary" |
|||
icon="el-icon-zoom-in" |
|||
size="small" |
|||
@click="LookPurchase(scope.row)" |
|||
>查看详情</el-button |
|||
> |
|||
<el-button type="primary" icon="el-icon-edit" size="small" @click="open(scope.row)">修改</el-button> |
|||
<el-button type="danger" icon="el-icon-delete" size="small" @click="deletePurchase(scope.row)">删除</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<div class="pages"> |
|||
<div class="tit" /> |
|||
<pagination |
|||
v-show="purchaseList.length > 0" |
|||
:total="queryInfo.total" |
|||
:page.sync="queryInfo.current" |
|||
:limit.sync="queryInfo.size" |
|||
class="pagination" |
|||
@pagination="getPurchaseList" |
|||
/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<divadd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="getPurchaseList" /> |
|||
<storeShow v-show="viewState == 4" ref="storeAdd" @doback="resetState" @reloadlist="getPurchaseList" /> |
|||
</div> |
|||
|
|||
</template> |
|||
|
|||
<script> |
|||
import ButtonBar from '@/components/ButtonBar' |
|||
import Pagination from '@/components/pagination' |
|||
import pageye from '@/components/pagination/pageye' |
|||
import divadd from '@/views/component/outStorehouseManagement/add/outListAdd.vue' |
|||
import storeShow from '@/views/component/outStorehouseManagement/add/outListAdd.vue' |
|||
export default { |
|||
components: { |
|||
ButtonBar, |
|||
Pagination, |
|||
pageye, |
|||
}, |
|||
data () { |
|||
return { |
|||
btndisabled: false, |
|||
isSearchShow: false, |
|||
queryInfo: { |
|||
no: '', |
|||
pageNum: 1, |
|||
pageSize: 10 |
|||
}, |
|||
outputDetail: {}, |
|||
title:"", |
|||
outputDialogVisible: false, |
|||
outputDialogVisible2: false, |
|||
components: { |
|||
ButtonBar, |
|||
Pagination, |
|||
pageye, |
|||
divadd, |
|||
storeShow |
|||
}, |
|||
data () { |
|||
return { |
|||
viewState: 1, |
|||
btndisabled: false, |
|||
isSearchShow: false, |
|||
queryInfo: { |
|||
total: 0, |
|||
user: '', |
|||
outStorehouseList: [], |
|||
addOutStorehouseDialogVisible: false, |
|||
updataOutStorehouseDialogVisible: false, |
|||
outStorehouseForm: { |
|||
outStorehouseId: '', |
|||
productName: '', |
|||
count: '', |
|||
locationId: '', |
|||
status: '', |
|||
receivePerson: '', |
|||
addr: '', |
|||
outTime: '', |
|||
createPerson: '', |
|||
createTime: '', |
|||
checkPerson: '', |
|||
checkTime: '' |
|||
}, |
|||
storehouseList: '', |
|||
barCodeList: '', |
|||
locationIdList: '', |
|||
availableQuantity: 0, |
|||
outStorehouse: '', |
|||
selectOutStorehouseList: [], |
|||
|
|||
rules: { |
|||
barCode: [ |
|||
{ required: true, message: '请输入条码', trigger: 'blur' } |
|||
], |
|||
locationId: [ |
|||
{ required: true, message: '请输入货位', trigger: 'blur' } |
|||
], |
|||
count: [ |
|||
{ required: true, message: '请输入数量', trigger: 'blur' } |
|||
], |
|||
receivePerson: [ |
|||
{ required: true, message: '请输入收货人', trigger: 'blur' } |
|||
], |
|||
addr: [ |
|||
{ required: true, message: '请输入地址', trigger: 'blur' } |
|||
] |
|||
}, |
|||
btnList: [ |
|||
{ |
|||
type: 'primary', |
|||
size: 'small', |
|||
icon: 'plus', |
|||
btnKey: 'toAdd', |
|||
btnLabel: '新增' |
|||
}, |
|||
{ |
|||
type: 'success', |
|||
size: 'small', |
|||
icon: 'submit', |
|||
btnKey: 'check', |
|||
btnLabel: '审核' |
|||
}, |
|||
{ |
|||
type: 'danger', |
|||
size: 'small', |
|||
icon: 'cross', |
|||
btnKey: 'cancel', |
|||
btnLabel: '撤销审核' |
|||
}, |
|||
{ |
|||
type: 'success', |
|||
size: 'small', |
|||
icon: 'export', |
|||
btnKey: 'out', |
|||
btnLabel: '出库' |
|||
}, |
|||
{ |
|||
type: 'info', |
|||
size: 'small', |
|||
icon: 'cross', |
|||
btnKey: 'doClose', |
|||
btnLabel: '关闭' |
|||
} |
|||
], |
|||
} |
|||
}, |
|||
methods: { |
|||
btnHandle(btnKey) { |
|||
switch (btnKey) { |
|||
case 'toAdd': |
|||
this.toAdd() |
|||
break |
|||
case 'check': |
|||
this.check() |
|||
break |
|||
case 'cancel': |
|||
this.cancel() |
|||
break |
|||
case 'out': |
|||
this.out() |
|||
break |
|||
case 'doClose': // 关闭 |
|||
this.doClose() |
|||
break |
|||
default: |
|||
break |
|||
} |
|||
}, |
|||
resetQuery() { |
|||
this.queryInfo={ |
|||
no: '', |
|||
pageNum: 1, |
|||
pageSize: 10 |
|||
}, |
|||
this.getOutStorehouseList() |
|||
}, |
|||
async handleCheck(sid){ |
|||
const { data: result } = await this.$http.get('/output/getOutStorehouse/' + sid, { }) |
|||
if (result.code !== "200") return this.$message.error('获取列表失败') |
|||
this.outputDetail = result.data |
|||
this.title = '出库单详情' |
|||
this.outputDialogVisible = true |
|||
this.outputDialogVisible2 = true |
|||
}, |
|||
async handleCheckProdInfo(sid){ |
|||
const { data: result } = await this.$http.get('/output/getOutStorehouse/' + sid, { }) |
|||
if (result.code !== "200") return this.$message.error('获取列表失败') |
|||
this.outputDetail = result.data |
|||
this.title = '商品详情' |
|||
this.outputDialogVisible = true |
|||
this.outputDialogVisible2 = false |
|||
}, |
|||
closeSupplierDialog(){ |
|||
this.inputDialogVisible2 = false |
|||
this.inputDialogVisible = false |
|||
}, |
|||
handleSizeChange (val) { |
|||
this.queryInfo.pageSize = val |
|||
this.getOutStorehouseList() |
|||
}, |
|||
|
|||
handleCurrentChange (val) { |
|||
this.queryInfo.pageNum = val |
|||
this.getOutStorehouseList() |
|||
}, |
|||
|
|||
closeAddOutStorehouseDialog () { |
|||
this.$refs.addOutStorehouseRuleForm.resetFields() |
|||
}, |
|||
|
|||
closeUpdataOutStorehouseDialog () { |
|||
this.$refs.updataOutStorehouseRuleForm.resetFields() |
|||
}, |
|||
|
|||
handleSelectionChange (val) { |
|||
this.selectOutStorehouseList = val |
|||
}, |
|||
|
|||
check () { |
|||
for (var i = 0; i < this.selectOutStorehouseList.length; i++) { |
|||
if (this.selectOutStorehouseList[i].status === '待审核') { |
|||
this.selectOutStorehouseList[i].status = '已审核' |
|||
this.selectOutStorehouseList[i].checkPerson = this.user |
|||
this.outStorehouse = this.selectOutStorehouseList[i] |
|||
this.checkAcancel() |
|||
this.$message.success('订单' + this.selectOutStorehouseList[i].outStorehouseId + '审核成功') |
|||
} else if (this.selectOutStorehouseList[i].status === '已审核') { |
|||
this.$message.error('订单' + this.selectOutStorehouseList[i].outStorehouseId + '已审核') |
|||
} else { |
|||
this.$message.error('订单' + this.selectOutStorehouseList[i].outStorehouseId + '进行中') |
|||
} |
|||
current: 1, |
|||
size: 10, |
|||
params: { |
|||
purchaseNo:'' |
|||
} |
|||
}, |
|||
|
|||
cancel () { |
|||
for (var i = 0; i < this.selectOutStorehouseList.length; i++) { |
|||
if (this.selectOutStorehouseList[i].status === '已审核') { |
|||
this.selectOutStorehouseList[i].status = '待审核' |
|||
this.selectOutStorehouseList[i].createTime = '' |
|||
this.selectOutStorehouseList[i].createPerson = '' |
|||
this.outStorehouse = this.selectOutStorehouseList[i] |
|||
this.checkAcancel() |
|||
this.$message.success('订单' + this.selectOutStorehouseList[i].outStorehouseId + '撤销审核成功') |
|||
} else if (this.selectOutStorehouseList[i].status === '待审核') { |
|||
this.$message.error('订单' + this.selectOutStorehouseList[i].outStorehouseId + '未审核') |
|||
} else { |
|||
this.$message.error('订单' + this.selectOutStorehouseList[i].outStorehouseId + '进行中') |
|||
} |
|||
} |
|||
}, |
|||
|
|||
async checkAcancel () { |
|||
const { data: result } = await this.$http.put('/outStorehouse/updataOutStorehouse', this.outStorehouse) |
|||
if (result.status !== 200) return this.$message.error('更新失败') |
|||
this.getOutStorehouseList() |
|||
}, |
|||
|
|||
async getQuery () { |
|||
const { data: result } = await this.$http.get('/outStorehouse/getQuery', { params: this.outStorehouseForm }) |
|||
if (result.status !== 200) return this.$message.error('获取列表失败') |
|||
this.barCodeList = result.data.barCodeList |
|||
this.locationIdList = result.data.locationIdList |
|||
this.availableQuantity = result.data.availableQuantity |
|||
this.outStorehouseForm.productName = result.data.productName |
|||
console.log(this.barCodeList) |
|||
}, |
|||
|
|||
async getOutStorehouseList () { |
|||
const { data: result } = await this.$http.post('/output/listPage', { params: this.queryInfo }) |
|||
console.log(result); |
|||
if (result.code !== "200") return this.$message.error('获取列表失败') |
|||
this.total = result.data.total |
|||
this.outStorehouseList = result.data.records |
|||
}, |
|||
|
|||
getId () { |
|||
const now = new Date() |
|||
this.outStorehouseForm.outStorehouseId = 'OT' + now.getTime() |
|||
}, |
|||
|
|||
addOutStorehouse () { |
|||
this.$refs.addOutStorehouseRuleForm.validate(async validate => { |
|||
this.getId() |
|||
this.outStorehouseForm.status = '待审核' |
|||
this.outStorehouseForm.createPerson = this.user |
|||
if (!validate) return this.$message.error('请填写必填项') |
|||
const { data: result } = await this.$http.post('/outStorehouse/addOutStorehouse', this.outStorehouseForm) |
|||
if (result.status !== 200) return this.$message.error('添加失败') |
|||
this.$message.success('添加成功') |
|||
this.getOutStorehouseList() |
|||
this.addOutStorehouseDialogVisible = false |
|||
}) |
|||
}, |
|||
|
|||
open (outStorehouse) { |
|||
// this.outStorehouseForm.outStorehouseId = outStorehouse.outStorehouse |
|||
// this.outStorehouseForm.barCode = outStorehouse.barCode |
|||
// this.outStorehouseForm.productName = outStorehouse.productName |
|||
// this.outStorehouseForm.locationId = outStorehouse.locationId |
|||
// this.outStorehouseForm.count = outStorehouse.locationId |
|||
// this.outStorehouseForm.status = outStorehouse.status |
|||
// this.outStorehouseForm.receivePerson = outStorehouse.receivePerson |
|||
// this.outStorehouseForm.addr = outStorehouse.addr |
|||
// this.outStorehouseForm.createPerson = outStorehouse.createPerson |
|||
if (outStorehouse.status !== '待审核') return this.$message.error('订单' + outStorehouse.outStorehouseId + '进行中') |
|||
outStorehouse.count = 0 |
|||
this.outStorehouse = outStorehouse |
|||
this.updataOutStorehouseDialogVisible = true |
|||
btnList: [ |
|||
{ |
|||
type: 'primary', |
|||
size: 'small', |
|||
icon: 'plus', |
|||
btnKey: 'toAdd', |
|||
btnLabel: '新增' |
|||
}, |
|||
{ |
|||
type: 'info', |
|||
size: 'small', |
|||
icon: 'cross', |
|||
btnKey: 'doClose', |
|||
btnLabel: '关闭' |
|||
} |
|||
], |
|||
total: 0, |
|||
purchaseList: [], |
|||
selectPurchaseList: [], |
|||
purchaseForm: { |
|||
purchaseId: '', |
|||
product: '', |
|||
barCode: '', |
|||
purchaseDate:'', |
|||
purchaseNo:'', |
|||
supplier: '', |
|||
storehouseName:'', |
|||
supplierName:'', |
|||
count: '', |
|||
storehouse: '', |
|||
state: '', |
|||
products:[] |
|||
}, |
|||
|
|||
updataOutStorehouse () { |
|||
this.$refs.updataOutStorehouseRuleForm.validate(async validate => { |
|||
if (!validate) return this.$message.error('请输入必填项') |
|||
const { data: result } = await this.$http.put('/outStorehouse/updataOutStorehouse', this.outStorehouse) |
|||
if (result.status !== 200) return this.$message.error('更新数据失败') |
|||
this.$message.success('更新成功') |
|||
this.getOutStorehouseList() |
|||
this.updataOutStorehouseDialogVisible = false |
|||
}) |
|||
pirce:'', |
|||
num:'', |
|||
} |
|||
}, |
|||
created(){ |
|||
}, |
|||
methods: { |
|||
resetState() { |
|||
this.viewState = 1 |
|||
}, |
|||
btnHandle(btnKey) { |
|||
switch (btnKey) { |
|||
case 'toAdd': |
|||
this.toAdd() |
|||
break |
|||
case 'doClose': // 关闭 |
|||
this.doClose() |
|||
break |
|||
default: |
|||
break |
|||
} |
|||
}, |
|||
resetQuery() { |
|||
this.queryInfo= { |
|||
total: 0, |
|||
current: 1, |
|||
size: 10, |
|||
params: { |
|||
purchaseNo:'' |
|||
} |
|||
}, |
|||
|
|||
deleteOutStrorehouse (outStorehouse) { |
|||
console.log(outStorehouse) |
|||
if (outStorehouse.status !== '待审核') return this.$message.error('订单' + this.outStorehouse.outStorehouseId + '进行中') |
|||
this.outStorehouse = outStorehouse |
|||
console.log(this.outStorehouse) |
|||
this.deleteOutStorehouse() |
|||
this.getOutStorehouseList() |
|||
this.outStorehouse = '' |
|||
this.getPurchaseList() |
|||
}, |
|||
// 序号 |
|||
indexMethod(index) { |
|||
var pagestart = (this.queryInfo.current - 1) * this.queryInfo.size |
|||
var pageindex = index + 1 + pagestart |
|||
return pageindex |
|||
}, |
|||
async getPurchaseList () { |
|||
const { data: result } = await this.$http.post('/purchasenew/listPage', this.queryInfo) |
|||
if (result.code == 200){ |
|||
this.queryInfo.total=result.data.total |
|||
this.purchaseList = result.data.records |
|||
} |
|||
}, |
|||
clearList(){ |
|||
this.purchaseForm={ |
|||
purchaseId: '', |
|||
product: '', |
|||
barCode: '', |
|||
purchaseDate:'', |
|||
purchaseNo:'', |
|||
supplier: '', |
|||
storehouseName:'', |
|||
supplierName:'', |
|||
count: '', |
|||
storehouse: '', |
|||
state: '', |
|||
products:[] |
|||
|
|||
async deleteOutStorehouse (outStorehouse) { |
|||
const result = await this.$confirm('此操作将永久删除' + outStorehouse.outStorehouseId + ', 是否继续?', '提示', { |
|||
} |
|||
}, |
|||
async deletePurchase (purchase) { |
|||
if(purchase.state=='已入库'){ |
|||
this.$message.error('已经入库的采购订单不能编辑') |
|||
}else{ |
|||
const sids = [] |
|||
sids.push(purchase.sid) |
|||
const result = await this.$confirm('此操作将永久删除订单' + purchase.purchaseNo + ', 是否继续?', '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).catch(error => error) |
|||
if (result !== 'confirm') return this.$message.info('用户取消操作') |
|||
const { data: resultDB } = await this.$http.delete(`/outStorehouse/delete/${outStorehouse.outStorehouseId}/${outStorehouse.count}/${outStorehouse.locationId}`) |
|||
if (resultDB.status !== 200) return this.$message.error('删除订单失败') |
|||
this.getStorehouseList() |
|||
const { data: resultDB } = await this.$http.post('/purchasenew/delBySids', sids) |
|||
if (resultDB.code == 200) |
|||
this.$message.success('订单删除成功') |
|||
}, |
|||
|
|||
async out () { |
|||
for (var i = 0; i < this.selectOutStorehouseList.length; i++) { |
|||
if (this.selectOutStorehouseList[i].status === '已拣货') { |
|||
this.selectOutStorehouseList[i].status = '已出库' |
|||
this.outStorehouse = this.selectOutStorehouseList[i] |
|||
const { data: result } = await this.$http.put('/outStorehouse/out', this.outStorehouse) |
|||
this.$message.success('订单' + this.selectOutStorehouseList[i].outStorehouseId + '出库成功') |
|||
} else { |
|||
this.$message.error('订单' + this.selectOutStorehouseList[i].outStorehouseId + '进行中') |
|||
} |
|||
this.getPurchaseList() |
|||
} |
|||
this.getOutStorehouseList() |
|||
}, |
|||
doClose() { |
|||
this.$store.dispatch('tagsView/delView', this.$route) |
|||
this.$router.go(-1) |
|||
}, |
|||
toAdd() { |
|||
|
|||
}, |
|||
}, |
|||
|
|||
async open (row) { |
|||
if(row.state=='已入库'){ |
|||
this.$message({ |
|||
message: '已经入库的采购订单不能编辑', |
|||
type: 'warning' |
|||
}); |
|||
}else{ |
|||
this.viewState = 3 |
|||
this.$refs['divadd'].showEdit(row) |
|||
} |
|||
}, |
|||
mounted () { |
|||
this.$refs['btnbar'].setButtonList(this.btnList) |
|||
this.getOutStorehouseList() |
|||
this.getQuery() |
|||
// this.getStorehouse() |
|||
// this.user = window.sessionStorage.getItem('token').substr(32) |
|||
} |
|||
LookPurchase(row) { |
|||
this.viewState = 4 |
|||
this.$refs['storeAdd'].showEdit(row) |
|||
}, |
|||
toAdd() { |
|||
this.viewState = 2 |
|||
this.$refs['divadd'].showAdd() |
|||
}, |
|||
doClose() { |
|||
this.$store.dispatch('tagsView/delView', this.$route) |
|||
this.$router.go(-1) |
|||
}, |
|||
}, |
|||
|
|||
mounted () { |
|||
this.$refs['btnbar'].setButtonList(this.btnList) |
|||
this.getPurchaseList() |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
<style scoped> |
|||
|
|||
</style> |
|||
|
Loading…
Reference in new issue