
4 changed files with 675 additions and 139 deletions
@ -0,0 +1,34 @@ |
|||
import request from '@/utils/request' |
|||
// 库房提供的采购订单表
|
|||
export default { |
|||
|
|||
// 查询分页列表
|
|||
listPage: function(params) { |
|||
return request({ |
|||
url: '/purchaserequisitiontobacco/listPage', |
|||
method: 'post', |
|||
data: params, |
|||
headers: { |
|||
'Content-Type': 'application/json' |
|||
} |
|||
}) |
|||
}, |
|||
// 保存新增记录
|
|||
saveOrUpdate: function(params) { |
|||
return request({ |
|||
url: '/purchaserequisitiontobacco/save', |
|||
method: 'post', |
|||
data: params, |
|||
headers: { |
|||
'Content-Type': 'application/json' |
|||
} |
|||
}) |
|||
}, |
|||
// 通过sid查询一条记录
|
|||
fetchVoBySid: function(params) { |
|||
return request({ |
|||
url: '/purchaserequisitiontobacco/fetchVoBySid', |
|||
params: params |
|||
}) |
|||
} |
|||
} |
@ -0,0 +1,27 @@ |
|||
import request from '@/utils/request' |
|||
// 库房提供的采购订单表
|
|||
export default { |
|||
|
|||
// 查询分页列表
|
|||
listPage: function(params) { |
|||
return request({ |
|||
url: '/purchaserequisitiontobaccodetails/listPage', |
|||
method: 'post', |
|||
data: params, |
|||
headers: { |
|||
'Content-Type': 'application/json' |
|||
} |
|||
}) |
|||
}, |
|||
// 保存新增记录
|
|||
saveOrUpdate: function(params) { |
|||
return request({ |
|||
url: '/purchaserequisitiontobaccodetails/save', |
|||
method: 'post', |
|||
data: params, |
|||
headers: { |
|||
'Content-Type': 'application/json' |
|||
} |
|||
}) |
|||
} |
|||
} |
@ -0,0 +1,382 @@ |
|||
<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"> |
|||
<div style="margin-left: 10px;margin-right: 10px"> |
|||
<el-upload |
|||
ref="upload" |
|||
class="avatar-uploade" |
|||
accept=".xlsx" |
|||
:action="updateAction" |
|||
name="filename" |
|||
:file-list="fileList" |
|||
:on-success="handleSuccess" |
|||
:multiple="false" |
|||
:show-file-list="false" |
|||
:limit="1" |
|||
> |
|||
<el-button type="primary" size="small">上传《烟草系统采购订单及明细.xlsx》</el-button> |
|||
</el-upload> |
|||
</div> |
|||
<!-- <el-button type="primary" size="small" :disabled="candownload" @click="downCheckExcel">下载审核结果</el-button>--> |
|||
<div style="margin-left: 10px;margin-right: 10px"> |
|||
<el-upload |
|||
ref="upload" |
|||
class="avatar-uploade" |
|||
accept=".csv" |
|||
:action="updateActionDetails" |
|||
:data="currentOrderSid" |
|||
name="filename" |
|||
:file-list="fileListDetails" |
|||
:before-upload="beforeUploadDetail" |
|||
:on-success="handleSuccessDetail" |
|||
:multiple="true" |
|||
:show-file-list="false" |
|||
> |
|||
<el-button :disabled="!currentOrderSid.sid" type="primary" size="small">上传《报烟明细.csv》</el-button> |
|||
</el-upload> |
|||
</div> |
|||
<el-button type="success" size="small" @click="loadData()">重新加载订单数据</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.tdrName }}</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.purchasingOrgName }}</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.purchasingOrgName }}</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.storeList" :index="index" border style="width: 100%"> |
|||
<el-table-column type="expand"> |
|||
<template slot-scope="scope"> |
|||
<div> |
|||
<el-table :data="scope.row.detailsList" border style="width: 100%"> |
|||
<el-table-column label="卷烟代码" align="center" prop="ycode" /> |
|||
<el-table-column label="商品" align="center" prop="prodName" /> |
|||
<el-table-column label="批发价" align="center" prop="pfj" /> |
|||
<el-table-column label="要货量" align="center" prop="yhl" /> |
|||
<el-table-column label="订单量" align="center" prop="ddl" /> |
|||
<el-table-column label="金额" align="center" prop="price" /> |
|||
<el-table-column label="厂家名称" align="center" prop="cjmc" /> |
|||
<el-table-column label="零售指导价" align="center" prop="lszdj" /> |
|||
</el-table> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column fixed label="序号" width="80px" type="index" :index="index + 1" align="center" /> |
|||
<el-table-column label="烟草证编码" align="center" prop="ycode" /> |
|||
<el-table-column label="门店名称" align="center"> |
|||
<template slot-scope="scope"> |
|||
<span>[{{ scope.row.storeCode }}]{{ scope.row.storeName }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="金额(元)" align="center" prop="price" /> |
|||
<el-table-column label="明细汇总金额" align="center" prop="detailPrice" /> |
|||
<el-table-column label="金额比对" align="center"> |
|||
<template slot-scope="scope"> |
|||
<span v-if="parseFloat(scope.row.price).toFixed(2) == parseFloat(scope.row.detailPrice).toFixed(2)">相同</span> |
|||
<span v-else>不相符</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="烟草批次" align="center" prop="pc" /> |
|||
</el-table> |
|||
</el-form> |
|||
</div> |
|||
<!-- End 添加修改部分 --> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import req from '@/api/supervise/purchaserequisitiontobacco' |
|||
export default { |
|||
name: 'ToBaccopurchaseApplicationAdd', |
|||
data() { |
|||
return { |
|||
candownload: true, |
|||
submitdisabled: false, |
|||
viewTitle: '', |
|||
tableKey: 0, |
|||
index: 0, |
|||
updateAction: process.env.VUE_APP_BASE_API + '/purchaserequisitiontobacco/importOrderXlsx', |
|||
updateActionDetails: process.env.VUE_APP_BASE_API + '/purchaserequisitiontobaccodetails/importCsvBatch', |
|||
fileList: [], |
|||
fileListDetails: [], |
|||
deatilsNum: 0, |
|||
amountInTotal: '', // 合计金额 |
|||
currentOrderSid: { |
|||
sid: '' |
|||
}, |
|||
formobj: { |
|||
sid: '', |
|||
code: '', // 单号 |
|||
buyerName: '', // 采购人姓名 |
|||
buyerCode: '', // 采购人编码 |
|||
purchaseDate: '', // 采购日期 |
|||
arrivalDate: '', // 到货日期 |
|||
purchasingOrgName: '', // 采购组织名称 |
|||
purchasingOrgCode: '', // 采购组织编码 |
|||
purchasingDeptCode: '', // 采购部门名称 |
|||
purchasingDeptName: '', // 采购部门编码 |
|||
supplierName: '', // 供应商名称 |
|||
supplierCode: '', // 供应商编码 |
|||
logisticsCompanyName: '', // 物流公司名称 |
|||
logisticsCompanyCode: '', // 物流公司编码 |
|||
warehousePosition: '', // 仓位 |
|||
warehousePositionCode: '', // 仓位code |
|||
newCode: '', // 新订单编号 |
|||
oldCode: '', // 旧订单编号 |
|||
completionStatusKey: '', // 完成状态key |
|||
tdrCode: '', // 填单人 |
|||
tdrName: '', // 填单人 |
|||
storeList: [] // 采购商品明细列表 |
|||
}, |
|||
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 |
|||
tdrCode: '', // 填单人 |
|||
tdrName: '', // 填单人 |
|||
storeList: [] // 采购商品明细列表 |
|||
} |
|||
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) { |
|||
this.fileList = [] |
|||
const _this = this |
|||
if (resp.success) { |
|||
this.$message({ showClose: true, type: 'success', message: '导入成功' }) |
|||
_this.currentOrderSid.sid = resp.data |
|||
_this.loadData(resp.data) |
|||
} else { |
|||
this.$message({ showClose: true, type: 'error', message: resp.msg }) |
|||
} |
|||
}, |
|||
beforeUploadDetail(file) { |
|||
this.deatilsNum = 0 |
|||
}, |
|||
handleSuccessDetail(resp, file, fileList) { |
|||
// this.fileListDetails = [] |
|||
const _this = this |
|||
_this.deatilsNum++ |
|||
console.log('_this.deatilsNum: ' + _this.deatilsNum + '--- _this.fileListDetails.length= ' + fileList.length) |
|||
if (resp.success) { |
|||
this.$message({ showClose: true, type: 'success', message: '导入成功' }) |
|||
if (_this.deatilsNum == fileList.length) { |
|||
_this.loadData() |
|||
_this.fileListDetails = [] |
|||
} |
|||
} else { |
|||
this.$message({ showClose: true, type: 'error', message: resp.msg }) |
|||
_this.fileListDetails = [] |
|||
} |
|||
}, |
|||
loadData() { |
|||
const _this = this |
|||
req |
|||
.fetchVoBySid({ sid: _this.currentOrderSid.sid }) |
|||
.then(res => { |
|||
_this.formobj = res.data |
|||
console.log(',,1111', _this.formobj) |
|||
var aa = 0 |
|||
for (var i = 0; i < _this.formobj.storeList.length; i++) { |
|||
if (_this.formobj.storeList[i].price !== '') { |
|||
aa = parseFloat(aa) + parseFloat(_this.formobj.storeList[i].price) |
|||
} |
|||
} |
|||
_this.amountInTotal = aa.toFixed(2) |
|||
}) |
|||
.catch(e => { |
|||
console.log('EEEE:', e) |
|||
}) |
|||
}, |
|||
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