2 changed files with 337 additions and 0 deletions
@ -0,0 +1,324 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<!-- 标题按钮部分开始 --> |
|||
<div class="tab-header webtop"> |
|||
<!-- 标题 --> |
|||
<div>{{ viewTitle }}</div> |
|||
<!-- start 添加修改按钮 --> |
|||
<div style="display: flex;flex-direction: row;justify-content: flex-end;align-items: center"> |
|||
<el-button type="text" @click="handleDownload"><span style="border-bottom: 1px solid blue">下载Excel示例表样</span></el-button> |
|||
<div style="margin-left: 10px;margin-right: 10px"> |
|||
<el-upload |
|||
ref="upload" |
|||
class="avatar-uploade" |
|||
accept=".xls" |
|||
:action="updateAction" |
|||
name="filename" |
|||
:file-list="fileList" |
|||
:on-success="handleSuccess" |
|||
:multiple="false" |
|||
:show-file-list="false" |
|||
:limit="1" |
|||
> |
|||
<el-button type="primary" size="small">导入采购订单表</el-button> |
|||
</el-upload> |
|||
</div> |
|||
<!-- <el-button type="primary" size="small" :disabled="candownload" @click="downCheckExcel">下载审核结果</el-button>--> |
|||
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button> |
|||
<el-button type="primary" size="small" :disabled="submitdisabled">提交</el-button> |
|||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button> |
|||
</div> |
|||
<!-- end 添加修改按钮 --> |
|||
<!-- end 详情按钮 --> |
|||
</div> |
|||
<!-- 标题按钮部分结束 --> |
|||
<!-- Start 新增修改部分 --> |
|||
<div class="listconadd"> |
|||
<el-form ref="form_obj" :model="formobj" :rules="rules" label-position="right" class="formadd"> |
|||
<div class="title"><div>烟草采购订单信息</div></div> |
|||
<el-row> |
|||
<el-col :span="4" class="tleftb"><span>采购申请编号</span></el-col> |
|||
<el-col :span="8" class="trightb"> |
|||
<el-form-item> |
|||
<span>{{ formobj.code }}</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4" class="tleftb"><span>填单人</span></el-col> |
|||
<el-col :span="8" class="trightb"> |
|||
<el-form-item> |
|||
<span>{{ formobj.buyerName }}</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="4" class="tleftb"><span>供货单位</span></el-col> |
|||
<el-col :span="8" class="trightb"> |
|||
<el-form-item> |
|||
<span>{{ formobj.supplierName }}</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4" class="tleftb"><span>仓位</span></el-col> |
|||
<el-col :span="8" class="trightb"> |
|||
<el-form-item> |
|||
<span>{{ formobj.warehousePosition }}</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="4" class="tleftb"><span>采购员</span></el-col> |
|||
<el-col :span="8" class="trightb"> |
|||
<el-form-item> |
|||
<span>{{ formobj.buyerName }}</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4" class="tleftb"><span>入库单位</span></el-col> |
|||
<el-col :span="8" class="trightb"> |
|||
<el-form-item> |
|||
<span>{{ formobj.purchasingDeptName }}</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="4" class="tleftb"><span>要货单位</span></el-col> |
|||
<el-col :span="8" class="trightb"> |
|||
<el-form-item> |
|||
<span>{{ formobj.purchasingDeptName }}</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4" class="tleftb"><span>入库仓位</span></el-col> |
|||
<el-col :span="8" class="trightb"> |
|||
<el-form-item> |
|||
<span>{{ formobj.warehousePosition }}</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="4" class="tleftb"><span>填单日期</span></el-col> |
|||
<el-col :span="8" class="trightb"> |
|||
<el-form-item> |
|||
<span>{{ formobj.purchaseDate }}</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4" class="tleftb"><span>到货日期</span></el-col> |
|||
<el-col :span="8" class="trightb"> |
|||
<el-form-item> |
|||
<span>{{ formobj.arrivalDate }}</span> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<div class="title"> |
|||
<div>门店采购明细</div> |
|||
<div> |
|||
<span>合计金额:{{ amountInTotal }}</span> |
|||
</div> |
|||
</div> |
|||
<el-table :key="tableKey" :data="formobj.pros" :index="index" border style="width: 100%"> |
|||
<el-table-column fixed label="序号" width="80px" type="index" :index="index + 1" align="center" /> |
|||
<el-table-column fixed label="操作" width="100px" align="center" header-align="center"> |
|||
<template slot-scope="scope"> |
|||
<el-button size="mini" type="danger" @click="dataDelete(scope.$index)">删除</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="烟草证编码" align="center"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.proCode }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="门店名称" align="center"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.proName }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="金额(元)" align="center"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.content }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="烟草批次" align="center"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.number }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
</el-form> |
|||
</div> |
|||
<!-- End 添加修改部分 --> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import req from '@/api/supervise/purchaseapplicationmanagement' |
|||
export default { |
|||
name: 'ToBaccopurchaseApplicationAdd', |
|||
data() { |
|||
return { |
|||
candownload: true, |
|||
submitdisabled: false, |
|||
viewTitle: '', |
|||
tableKey: 0, |
|||
index: 0, |
|||
updateAction: process.env.VUE_APP_BASE_API + '/v1/purchaserequisition/importBrandSort', |
|||
fileList: [], |
|||
amountInTotal: '', // 合计金额 |
|||
formobj: { |
|||
sid: '', |
|||
code: '', // 单号 |
|||
buyerName: '', // 采购人姓名 |
|||
buyerCode: '', // 采购人编码 |
|||
purchaseDate: '', // 采购日期 |
|||
arrivalDate: '', // 到货日期 |
|||
purchasingOrgName: '', // 采购组织名称 |
|||
purchasingOrgCode: '', // 采购组织编码 |
|||
purchasingDeptCode: '', // 采购部门名称 |
|||
purchasingDeptName: '', // 采购部门编码 |
|||
supplierName: '', // 供应商名称 |
|||
supplierCode: '', // 供应商编码 |
|||
logisticsCompanyName: '', // 物流公司名称 |
|||
logisticsCompanyCode: '', // 物流公司编码 |
|||
warehousePosition: '', // 仓位 |
|||
warehousePositionCode: '', // 仓位code |
|||
newCode: '', // 新订单编号 |
|||
oldCode: '', // 旧订单编号 |
|||
completionStatusKey: '', // 完成状态key |
|||
pros: [] // 采购商品明细列表 |
|||
}, |
|||
rules: {} |
|||
} |
|||
}, |
|||
created() {}, |
|||
methods: { |
|||
handleReturn() { |
|||
this.formobj = { |
|||
sid: '', |
|||
code: '', // 单号 |
|||
buyerName: '', // 采购人姓名 |
|||
buyerCode: '', // 采购人编码 |
|||
purchaseDate: '', // 采购日期 |
|||
arrivalDate: '', // 到货日期 |
|||
purchasingOrgName: '', // 采购组织名称 |
|||
purchasingOrgCode: '', // 采购组织编码 |
|||
purchasingDeptCode: '', // 采购部门名称 |
|||
purchasingDeptName: '', // 采购部门编码 |
|||
supplierName: '', // 供应商名称 |
|||
supplierCode: '', // 供应商编码 |
|||
logisticsCompanyName: '', // 物流公司名称 |
|||
logisticsCompanyCode: '', // 物流公司编码 |
|||
warehousePosition: '', // 仓位 |
|||
warehousePositionCode: '', // 仓位code |
|||
newCode: '', // 新订单编号 |
|||
oldCode: '', // 旧订单编号 |
|||
completionStatusKey: '', // 完成状态key |
|||
pros: [] // 采购商品明细列表 |
|||
} |
|||
this.amountInTotal = '' |
|||
this.$refs['form_obj'].resetFields() |
|||
this.$store.dispatch('tagsView/delView', this.$route) |
|||
this.$router.go(-1) |
|||
// this.$emit('doback') |
|||
}, |
|||
showAdd() { |
|||
this.$nextTick(() => { |
|||
this.$refs['form_obj'].clearValidate() |
|||
}) |
|||
this.viewTitle = '【审核编号】' |
|||
}, |
|||
showEdit(row) { |
|||
this.$nextTick(() => { |
|||
this.$refs['form_obj'].clearValidate() |
|||
}) |
|||
this.viewTitle = '【审核编号】' |
|||
req |
|||
.fetchBySid(row.sid) |
|||
.then(resp => { |
|||
if (resp.success) { |
|||
this.formobj = resp.data |
|||
if (this.formobj.pros.length > 0) { |
|||
var aa = 0 |
|||
for (var i = 0; i < this.formobj.pros.length; i++) { |
|||
if (this.formobj.pros[i].totalPrice !== '') { |
|||
aa = parseFloat(aa) + parseFloat(this.formobj.pros[i].totalPrice) |
|||
} |
|||
} |
|||
this.amountInTotal = aa |
|||
} |
|||
} else { |
|||
// 根据resp.code进行异常情况处理 |
|||
} |
|||
}) |
|||
.catch(e => { |
|||
this.formobj = row |
|||
}) |
|||
}, |
|||
downCheckExcel() { |
|||
window.location.href = process.env.VUE_APP_BASE_API + '/v1/productnum/products?code='+this.formobj.code |
|||
}, |
|||
handleDownload() { |
|||
window.location.href = process.env.VUE_APP_BASE_API + '/v1/purchaserequisition/yb' |
|||
}, |
|||
handleSuccess(resp, file, fileList) { |
|||
if (resp.success) { |
|||
this.$message({ showClose: true, type: 'success', message: '导入成功' }) |
|||
this.formobj = resp.data |
|||
if (this.formobj.pros.length > 0) { |
|||
var aa = 0 |
|||
for (var i = 0; i < this.formobj.pros.length; i++) { |
|||
if (this.formobj.pros[i].totalPrice !== '') { |
|||
aa = parseFloat(aa) + parseFloat(this.formobj.pros[i].totalPrice) |
|||
} |
|||
} |
|||
this.amountInTotal = aa |
|||
} |
|||
|
|||
console.log(',,1111',this.formobj.code) |
|||
if (this.formobj.code) { |
|||
this.candownload = false |
|||
} |
|||
} else { |
|||
this.$message({ showClose: true, type: 'error', message: resp.msg }) |
|||
} |
|||
}, |
|||
dataDelete(index) { |
|||
const tip = '请确认是否删除所选记录?' |
|||
this.$confirm(tip, '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
this.formobj.pros.splice(index, 1) |
|||
}) |
|||
}, |
|||
saveOrUpdate() { |
|||
this.$refs['form_obj'].validate(valid => { |
|||
if (valid) { |
|||
this.submitdisabled = true |
|||
req |
|||
.saveOrUpdate(this.formobj) |
|||
.then(resp => { |
|||
this.submitdisabled = false |
|||
if (resp.success) { |
|||
this.$message({ showClose: true, type: 'success', message: resp.msg }) |
|||
this.handleReturn() |
|||
} else { |
|||
// 根据resp.code进行异常情况处理 |
|||
} |
|||
}) |
|||
.catch(() => { |
|||
this.submitdisabled = false |
|||
}) |
|||
} else { |
|||
return false |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.title { |
|||
display: flex; |
|||
flex-direction: row; |
|||
justify-content: space-between; |
|||
align-items: center; |
|||
} |
|||
</style> |
Loading…
Reference in new issue