|
|
@ -6,6 +6,23 @@ |
|
|
|
<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 添加修改按钮 --> |
|
|
@ -13,123 +30,88 @@ |
|
|
|
</div> |
|
|
|
<!-- 标题按钮部分结束 --> |
|
|
|
<!-- Start 新增修改部分 --> |
|
|
|
<div class="listconadd" style="padding: 10px;"> |
|
|
|
<el-card class="box-card"> |
|
|
|
<div slot="header" class="clearfix"> |
|
|
|
<span>采购订单excel文件上传</span> |
|
|
|
<el-button style="float: right; padding: 3px 0" type="text" @click="handleDownload">下载Excel示例表样</el-button> |
|
|
|
</div> |
|
|
|
<el-row> |
|
|
|
<el-col :span="8"> |
|
|
|
<div> |
|
|
|
<el-upload |
|
|
|
ref="upload" |
|
|
|
class="upload-demo" |
|
|
|
accept=".xls" |
|
|
|
:action="updateAction" |
|
|
|
:before-upload="handleBeforeUpload" |
|
|
|
:on-progress="handleProgress" |
|
|
|
:on-success="handleSuccess" |
|
|
|
:file-list="fileList" |
|
|
|
:auto-upload="false" |
|
|
|
:multiple="false" |
|
|
|
:limit="1" |
|
|
|
> |
|
|
|
<el-button slot="trigger" size="small" type="primary">选取文件</el-button> |
|
|
|
<el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">上传到服务器</el-button> |
|
|
|
</el-upload> |
|
|
|
</div> |
|
|
|
</el-col> |
|
|
|
<el-col :span="16"> |
|
|
|
<div>上传采购订单的Excel文件,文件名以订单号开头,类似《90002303240037石家庄朋硕家居用品有限公司.xls》。</div> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-card> |
|
|
|
<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"> |
|
|
|
<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="4" class="tleftb"><span>订单编号</span></el-col> |
|
|
|
<el-col :span="8" class="trightb"> |
|
|
|
<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="4" class="tleftb"><span>填单人</span></el-col> |
|
|
|
<el-col :span="8" class="trightb"> |
|
|
|
<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="4" class="tleftb"><span>供货单位</span></el-col> |
|
|
|
<el-col :span="8" class="trightb"> |
|
|
|
<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="4" class="tleftb"><span>仓位</span></el-col> |
|
|
|
<el-col :span="8" class="trightb"> |
|
|
|
<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="4" class="tleftb"><span>采购员</span></el-col> |
|
|
|
<el-col :span="8" class="trightb"> |
|
|
|
<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="4" class="tleftb"><span>入库单位</span></el-col> |
|
|
|
<el-col :span="8" class="trightb"> |
|
|
|
<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-row> |
|
|
|
<el-row> |
|
|
|
<el-col :span="4" class="tleftb"><span>要货单位</span></el-col> |
|
|
|
<el-col :span="8" class="trightb"> |
|
|
|
<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="4" class="tleftb"><span>入库仓位</span></el-col> |
|
|
|
<el-col :span="8" class="trightb"> |
|
|
|
<el-form-item> |
|
|
|
<span>{{ formobj.warehousePosition }}</span> |
|
|
|
<span>{{ formobj.expiryDate }}</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-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-col :span="4" class="tleftb"><span>到货日期</span></el-col> |
|
|
|
<el-col :span="8" class="trightb"> |
|
|
|
<el-form-item> |
|
|
|
<span>{{ formobj.arrivalDate }}</span> |
|
|
|
<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-col :span="3" class="tleftb"><span>入库仓位</span></el-col> |
|
|
|
<el-col :span="5" class="trightb"> |
|
|
|
<el-form-item> |
|
|
|
<span>{{ formobj.expiryDate }}</span> |
|
|
|
<span>{{ formobj.warehousePosition }}</span> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" class="tleftb"><span>完成状态</span></el-col> |
|
|
|
<el-col :span="8" class="trightb"> |
|
|
|
<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> |
|
|
@ -142,108 +124,17 @@ |
|
|
|
<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" width="200"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.proCode }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="商品名称" align="center" width="200"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.proName }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="规格型号" align="center" width="150"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.content }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="数量" align="center" width="150"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.number }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="包装数量" align="center" width="150"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.packageNumber }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="包内数量" align="center" width="150"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.packageInsideNumber }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="包装规格" align="center" width="150"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.packageSpec }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="单位" align="center" width="200"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.unit }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="包装价格(元)" align="center" width="150"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.packagePrice }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="包合计(元)" align="center" width="150"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.packageTotalPrice }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="单价(元)" align="center" width="150"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.unitPrice }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="含税单价(元)" align="center" width="150"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.unitPriceTax }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="合计(元)" align="center" width="120"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.totalPrice }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="商品品类名称" align="center" width="150"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.category }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="商品品类编码" align="center" width="150"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.categoryKey }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="品牌名称" align="center" width="150"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.brand }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="品牌编码" align="center" width="150"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.brandCode }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="发货日期" align="center" width="150"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.issuanceDate }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="零售金额" align="center" width="150"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.retailAmount }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<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> |
|
|
@ -255,16 +146,41 @@ |
|
|
|
<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"> |
|
|
|
<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> |
|
|
@ -274,6 +190,7 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import req from '@/api/supervise/purchaserequisition' |
|
|
|
import reqPro from '@/api/supervise/purchaserequisitionpro' |
|
|
|
export default { |
|
|
|
name: 'PurchaserequisitionUploadxlsx', |
|
|
|
data() { |
|
|
@ -312,6 +229,13 @@ |
|
|
|
completionStatusKey: '', // 完成状态key |
|
|
|
pros: [] // 采购商品明细列表 |
|
|
|
}, |
|
|
|
prolist: [], |
|
|
|
supplierCheckState: 0, |
|
|
|
supplierCheckMsg: '等待检测', |
|
|
|
supplierChecklist: [], |
|
|
|
proCheckState: 0, |
|
|
|
proCheckMsg: '等待检测', |
|
|
|
proChecklist: [], |
|
|
|
rules: {} |
|
|
|
} |
|
|
|
}, |
|
|
@ -349,16 +273,6 @@ |
|
|
|
this.$router.go(-1) |
|
|
|
// this.$emit('doback') |
|
|
|
}, |
|
|
|
handleBeforeUpload(file) { |
|
|
|
console.log('handleBeforeUpload', file) |
|
|
|
req.checkCodeByFileName(file.name).then(res => { |
|
|
|
console.log('eeee', res) |
|
|
|
return false |
|
|
|
}) |
|
|
|
}, |
|
|
|
submitUpload() { |
|
|
|
this.$refs.upload.submit() |
|
|
|
}, |
|
|
|
handleProgress(event, file, fileList) { |
|
|
|
// this.progressFlag = true; // 显示进度条 |
|
|
|
// this.loadProgress = parseInt(event.percent); // 动态获取文件上传进度 |
|
|
@ -378,38 +292,38 @@ |
|
|
|
// _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 + ' 毫秒。' |
|
|
|
// 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 |
|
|
|
// // }) |
|
|
|
}, |
|
|
|
// // 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() |
|
|
@ -451,6 +365,7 @@ |
|
|
|
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, |
|
|
@ -458,21 +373,9 @@ |
|
|
|
message: '导入成功' |
|
|
|
}) |
|
|
|
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 |
|
|
|
} |
|
|
|
|
|
|
|
console.log(',,1111', this.formobj.code) |
|
|
|
if (this.formobj.code) { |
|
|
|
this.candownload = false |
|
|
|
} |
|
|
|
this.loadProList() |
|
|
|
this.checkPro() |
|
|
|
this.checkSupplier() |
|
|
|
} else { |
|
|
|
this.$message({ |
|
|
|
showClose: true, |
|
|
@ -481,6 +384,59 @@ |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
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, '提示', { |
|
|
|