Browse Source

采购订单

master
liupopo 2 years ago
parent
commit
309a3ad8c7
  1. 8
      supervise-customer-ui/src/router/modules/codemenu.js
  2. 488
      supervise-customer-ui/src/views/purchaserequisition/listofcheck/index.vue
  3. 2
      yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/supplierbankinfo/PurchaseRequisitionCheckVo.java
  4. 8
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/purchaserequisition/PurchaseRequisitionRest.java
  5. 11
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/purchaserequisition/PurchaseRequisitionService.java
  6. 11
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/supplierbankinfo/SupplierBankInfoService.java

8
supervise-customer-ui/src/router/modules/codemenu.js

@ -317,6 +317,14 @@ const codemenu = [{
title: '上传采购订单',
noCache: true
}
},{
path: '/purchaserequisition/listofcheck',
component: () => import('@/views/purchaserequisition/listofcheck/index.vue'),
name: 'purchaserequisitionlistofcheck',
meta: {
title: '采购申请',
noCache: true
}
}]
}]
export default codemenu

488
supervise-customer-ui/src/views/purchaserequisition/listofcheck/index.vue

@ -0,0 +1,488 @@
<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="upload-demo"
accept=".xls"
:action="updateAction"
:file-list="fileList"
:on-progress="handleProgress"
:on-success="handleSuccess"
:multiple="false"
:show-file-list="false"
:limit="1"
>
<el-button type="primary" size="small">上传采购订单excel文件</el-button>
</el-upload>
</div>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
<!-- end 添加修改按钮 -->
<!-- end 详情按钮 -->
</div>
<!-- 标题按钮部分结束 -->
<!-- Start 新增修改部分 -->
<div class="listconadd" style="padding: 20px;">
<el-collapse v-model="collOrderInfoActiveNames">
<el-collapse-item title="订单详情" name="1">
<el-form ref="form_obj" :model="formobj" :rules="rules" label-position="right" class="formadd" style="padding: 0px;">
<div class="title">
<div>采购订单信息</div>
</div>
<el-row>
<el-col :span="3" class="tleftb"><span>订单编号</span></el-col>
<el-col :span="5" class="trightb">
<el-form-item>
<span>{{ formobj.code }}</span>
</el-form-item>
</el-col>
<el-col :span="3" class="tleftb"><span>填单人</span></el-col>
<el-col :span="5" class="trightb">
<el-form-item>
<span>{{ formobj.buyerName }}</span>
</el-form-item>
</el-col>
<el-col :span="3" class="tleftb"><span>填单时间</span></el-col>
<el-col :span="5" class="trightb">
<el-form-item>
<span>{{ formobj.purchaseDate }}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="3" class="tleftb"><span>供货单位</span></el-col>
<el-col :span="5" class="trightb">
<el-form-item>
<span>{{ formobj.supplierName }}</span>
</el-form-item>
</el-col>
<el-col :span="3" class="tleftb"><span>仓位</span></el-col>
<el-col :span="5" class="trightb">
<el-form-item>
<span>{{ formobj.warehousePosition }}</span>
</el-form-item>
</el-col>
<el-col :span="3" class="tleftb"><span>到货日期</span></el-col>
<el-col :span="5" class="trightb">
<el-form-item>
<span>{{ formobj.arrivalDate }}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="3" class="tleftb"><span>采购员</span></el-col>
<el-col :span="5" class="trightb">
<el-form-item>
<span>{{ formobj.buyerName }}</span>
</el-form-item>
</el-col>
<el-col :span="3" class="tleftb"><span>入库单位</span></el-col>
<el-col :span="5" class="trightb">
<el-form-item>
<span>{{ formobj.purchasingDeptName }}</span>
</el-form-item>
</el-col>
<el-col :span="3" class="tleftb"><span>单据到效期</span></el-col>
<el-col :span="5" class="trightb">
<el-form-item>
<span>{{ formobj.expiryDate }}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="3" class="tleftb"><span>要货单位</span></el-col>
<el-col :span="5" class="trightb">
<el-form-item>
<span>{{ formobj.purchasingDeptName }}</span>
</el-form-item>
</el-col>
<el-col :span="3" class="tleftb"><span>入库仓位</span></el-col>
<el-col :span="5" class="trightb">
<el-form-item>
<span>{{ formobj.warehousePosition }}</span>
</el-form-item>
</el-col>
<el-col :span="3" class="tleftb"><span>完成状态</span></el-col>
<el-col :span="5" class="trightb">
<el-form-item>
<span>{{ formobj.completionStatus }}</span>
</el-form-item>
</el-col>
</el-row>
<div class="title">
<div>采购商品明细</div>
<div>
<span style="padding-right: 20px">合计数量:{{ totalQuantity }}</span>
<span>合计金额:{{ amountInTotal }}</span>
</div>
</div>
<el-table :data="prolist" :index="index" border style="width: 100%">
<el-table-column fixed label="序号" width="60px" type="index" :index="index + 1" align="center" />
<el-table-column label="商品代码" align="center" width="100" prop="proCode" />
<el-table-column label="商品名称" align="center" prop="proName" />
<el-table-column label="品类编码" align="center" width="100" prop="categoryKey" />
<el-table-column label="品类名称" align="center" width="100" prop="category" />
<el-table-column label="品牌编码" align="center" width="100" prop="brandCode" />
<el-table-column label="品牌名称" align="center" width="100" prop="brand" />
<el-table-column label="合计(元)" align="center" width="150" prop="totalPrice" />
<el-table-column label="数量" align="center" width="100" prop="number" />
<el-table-column label="包装规格" align="center" width="150" prop="packageSpec" />
</el-table>
</el-form>
</el-collapse-item>
</el-collapse>
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>供应商信息检测</span>
<el-button style="float: right; padding: 3px 0" type="text" @click="handleDownload">重新检测</el-button>
</div>
<div>
<div v-if="supplierCheckState==0">{{ supplierCheckMsg }}</div>
<div v-else-if="supplierCheckState==1">
<el-table :data="supplierChecklist" :index="index" border style="width: 100%">
<el-table-column fixed label="序号" width="60px" type="index" :index="index + 1" align="center" />
<el-table-column label="供应商编码" align="center" width="150" prop="supplierCode" />
<el-table-column label="供应商名称" align="center" prop="supplierName" />
<el-table-column label="供应商统一编码" align="center" width="150" prop="supplierCodeUnified" />
<el-table-column label="状态" align="center" width="150" prop="resState" />
<el-table-column label="检测结果" align="center" width="300" prop="msg" />
</el-table>
</div>
<div v-else> <el-alert title="供应商信息正常!" show-icon type="success" effect="dark" :closable="false" /></div>
</div>
</el-card>
<el-card class="box-card" style="margin-top: 5px;">
<div slot="header" class="clearfix">
<span>商品信息检测</span>
<el-button style="float: right; padding: 3px 0" type="text" @click="handleDownload">重新检测</el-button>
</div>
<div>
<div v-if="proCheckState==0">{{ proCheckMsg }}</div>
<div v-else-if="proCheckState==1">
<el-table :data="proChecklist" :index="index" border style="width: 100%">
<el-table-column fixed label="序号" width="60px" type="index" :index="index + 1" align="center" />
<el-table-column label="商品代码" align="center" width="100" prop="productCode" />
<el-table-column label="商品名称" align="center" prop="productName" />
<el-table-column label="品类编码" align="center" width="100" prop="categoryCode" />
<el-table-column label="品类名称" align="center" width="100" prop="categoryName" />
<el-table-column label="品牌编码" align="center" width="100" prop="brandCode" />
<el-table-column label="品牌名称" align="center" width="100" prop="brandName" />
<el-table-column label="状态" align="center" width="150" prop="resState" />
<el-table-column label="检测结果" align="center" width="300" prop="msg" />
</el-table>
</div>
<div v-else> <el-alert title="所有商品信息正常!" show-icon type="success" effect="dark" :closable="false" /></div>
</div>
</el-card>
</div>
<!-- End 添加修改部分 -->
</div>
</template>
<script>
import req from '@/api/supervise/purchaserequisition'
import reqPro from '@/api/supervise/purchaserequisitionpro'
export default {
name: 'PurchaserequisitionUploadxlsx',
data() {
return {
collOrderInfoActiveNames: '1',
candownload: true,
submitdisabled: false,
viewTitle: '',
tableKey: 0,
index: 0,
updateAction: '/api/customer/v1/purchaserequisition/uploadXlsxFile',
fileList: [],
totalQuantity: '', //
amountInTotal: '', //
formobj: {
sid: '',
code: '', //
buyerName: '', //
buyerCode: '', //
purchaseDate: '', //
arrivalDate: '', //
purchasingOrgName: '', //
purchasingOrgCode: '', //
purchasingDeptCode: '', //
purchasingDeptName: '', //
supplierName: '', //
supplierCode: '', //
logisticsCompanyName: '', //
logisticsCompanyCode: '', //
expiryDate: '', //
warehousePosition: '', //
warehousePositionCode: '', // code
newCode: '', //
oldCode: '', //
completionStatus: '', //
completionStatusKey: '', // key
pros: [] //
},
prolist: [],
supplierCheckState: 0,
supplierCheckMsg: '等待检测',
supplierChecklist: [],
proCheckState: 0,
proCheckMsg: '等待检测',
proChecklist: [],
rules: {}
}
},
created() {},
methods: {
handleReturn() {
this.formobj = {
sid: '',
code: '', //
buyerName: '', //
buyerCode: '', //
purchaseDate: '', //
arrivalDate: '', //
purchasingOrgName: '', //
purchasingOrgCode: '', //
purchasingDeptCode: '', //
purchasingDeptName: '', //
supplierName: '', //
supplierCode: '', //
logisticsCompanyName: '', //
logisticsCompanyCode: '', //
expiryDate: '', //
warehousePosition: '', //
warehousePositionCode: '', // code
newCode: '', //
oldCode: '', //
completionStatus: '', //
completionStatusKey: '', // key
pros: [] //
}
this.totalQuantity = ''
this.amountInTotal = ''
this.$refs['form_obj'].resetFields()
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
// this.$emit('doback')
},
handleProgress(event, file, fileList) {
// this.progressFlag = true; //
// this.loadProgress = parseInt(event.percent); //
// if (this.loadProgress >= 100) {
// this.loadProgress = 100
// setTimeout( () => {this.progressFlag = false}, 1000) //
// }
// const _this = this
// this.fullscreenloading = this.$loading({
// lock: true,
// text: '',
// spinner: 'el-icon-loading',
// background: 'rgba(0, 0, 0, 0.7)'
// })
// console.log('111', event.percent)
// if (event.percent >= 100) {
// _this.fullscreenloading.text = ''
// }
},
// handleSuccess(resp, file, fileList) {
// // if (this.fullscreenloading) this.fullscreenloading.close()
// // this.fullscreenloading = null
// console.log('222', resp)
// // const rdata = resp.data
// // const _this = this
// // _this.fullscreenloading.text = ''
// // _this.uploadResultMesssage = '' + rdata.allNum + ' ' + rdata.validNum + ' ' + rdata.durations + ' '
// // kchz()
// // .then(res => {
// // if (this.fullscreenloading) this.fullscreenloading.close()
// // this.fullscreenloading = null
// // console.log('333', res)
// // _this.hzFilePath = res.data
// // })
// // .catch(e => {
// // if (this.fullscreenloading) this.fullscreenloading.close()
// // this.fullscreenloading = null
// // })
// // // kchzyc()
// // // .then(res => {
// // // if (this.fullscreenloading) this.fullscreenloading.close()
// // // this.fullscreenloading = null
// // // console.log('444', res)
// // // _this.ychzFilePath = res.data
// // // })
// // // .catch(e => {
// // // if (this.fullscreenloading) this.fullscreenloading.close()
// // // this.fullscreenloading = null
// // // })
// },
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) {
this.totalQuantity = this.formobj.pros.length
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 = []
if (resp.success) {
this.$message({
showClose: true,
type: 'success',
message: '导入成功'
})
this.formobj = resp.data
this.loadProList()
this.checkPro()
this.checkSupplier()
} else {
this.$message({
showClose: true,
type: 'error',
message: resp.msg
})
}
},
loadProList() {
if (this.formobj.sid) {
reqPro.listByMainSid(this.formobj.sid).then(resp => {
this.prolist = resp.data
this.totalQuantity = this.prolist.length
var aa = 0
for (var i = 0; i < this.prolist.length; i++) {
if (this.prolist[i].totalPrice !== '') {
aa = parseFloat(aa) + parseFloat(this.prolist[i].totalPrice)
}
}
this.amountInTotal = aa
})
}
},
checkPro() {
if (this.formobj.sid) {
this.proCheckMsg = '正在对订单的商品信息进行检测...'
reqPro.checkByMainSid(this.formobj.sid).then(resp => {
this.proChecklist = resp.data
if (this.proChecklist.length > 0) {
this.proCheckState = 1
} else {
this.proCheckState = 2
if (this.formobj.purchaseState === '0' && this.supplierCheckState === 2) {
this.updatePurchaseStateSucess()
}
}
this.loadProList()
})
}
},
checkSupplier() {
if (this.formobj.sid) {
this.supplierCheckMsg = '正在检测供应商信息...'
req.checkSupplier(this.formobj.sid).then(resp => {
this.supplierChecklist = resp.data
if (this.supplierChecklist.length > 0) {
this.supplierCheckState = 1
} else {
this.supplierCheckState = 2
if (this.formobj.purchaseState === '0' && this.proCheckState === 2) {
this.updatePurchaseStateSucess()
}
}
})
}
},
updatePurchaseStateSucess() {
req.updatePurchaseStateSucess(this.formobj.sid).then(resp => {
this.formobj.purchaseState = '1'
})
},
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>

2
yxt_supervise/supervise-customer/supervise-customer-api/src/main/java/com/yxt/supervise/customer/api/supplierbankinfo/PurchaseRequisitionCheckVo.java

@ -16,7 +16,7 @@ public class PurchaseRequisitionCheckVo {
private String supplierName;
private String supplierCodeUnified;
private int resState = 0; // 0=正常;1=无供应商信息;2=供应商编码不符;3=有在途;4=供应商索引编码重复;5=没有对应订单;6=供应商没审核
private int resState = 0; // 0=正常;1=无供应商信息;2=索引与供应商关联错误;3=有在途;4=供应商索引编码重复;5=没有对应订单;6=供应商没审核
private String msg;
public String getPrSid() {

8
yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/purchaserequisition/PurchaseRequisitionRest.java

@ -96,4 +96,12 @@ public class PurchaseRequisitionRest implements PurchaseRequisitionFeign {
purchaseRequisitionService.updatePurchaseStateSucess(sid);
return rb.success();
}
@ApiOperation("上传后待提交给银行的订单列表")
@GetMapping("/listOfCheck")
public ResultBean<List<PurchaseRequisition>> listOfCheck() {
ResultBean rb = ResultBean.fireFail();
List<PurchaseRequisition> pv = purchaseRequisitionService.listOfCheck();
return rb.success().setData(pv);
}
}

11
yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/purchaserequisition/PurchaseRequisitionService.java

@ -298,4 +298,15 @@ public class PurchaseRequisitionService extends MybatisBaseService<PurchaseRequi
uw.eq("sid", sid);
this.update(uw);
}
public List<PurchaseRequisition> listOfCheck() {
List<PurchaseRequisition> list = listByState("1");
return list;
}
private List<PurchaseRequisition> listByState(String state) {
QueryWrapper<PurchaseRequisition> qw = new QueryWrapper<>();
qw.eq("state", state);
return baseMapper.selectList(qw);
}
}

11
yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/supplierbankinfo/SupplierBankInfoService.java

@ -311,7 +311,6 @@ public class SupplierBankInfoService extends MybatisBaseService<SupplierBankInfo
vo.setSupplierCodeUnified(supplierOnlyCode);
vo.setMsg("没有该供应商信息");
list.add(vo);
return list;
} else {
String sbiCodeUnified = sbi.getCodeUnified();
String sbiSid = sbi.getSid();
@ -338,14 +337,20 @@ public class SupplierBankInfoService extends MybatisBaseService<SupplierBankInfo
vo.setSupplierCodeUnified(supplierOnlyCode);
vo.setMsg("该供应商没有审核");
list.add(vo);
return list;
}
return list;
}
SupplierIndex si = silist.get(0);
SupplierBankInfo supplierBankInfo = this.fetchBySid(si.getPSid());
if (supplierBankInfo == null) {
PurchaseRequisitionCheckVo vo = new PurchaseRequisitionCheckVo(prSid, prCode, 2);
vo.setSupplierCode(supplierCode);
vo.setSupplierName(supplierName);
vo.setSupplierCodeUnified(supplierOnlyCode);
vo.setMsg("索引与供应商关联错误");
list.add(vo);
return list;
}
Integer purchaseRequisition = supplierBankInfo.getPurchaseRequisition();

Loading…
Cancel
Save