|
@@ -1,24 +1,24 @@
|
|
|
<template>
|
|
|
- <div class="salesReturnEdit-wrap">
|
|
|
+ <div class="purchaseReceiptEdit-wrap">
|
|
|
<a-spin :spinning="spinning" tip="Loading...">
|
|
|
- <a-page-header :ghost="false" :backIcon="false" class="salesReturnEdit-back">
|
|
|
+ <a-page-header :ghost="false" :backIcon="false" class="purchaseReceiptEdit-back">
|
|
|
<!-- 自定义的二级文字标题 -->
|
|
|
<template slot="subTitle">
|
|
|
- <a id="salesReturnEdit-back-btn" href="javascript:;" @click="handleBack">
|
|
|
+ <a id="purchaseReceiptEdit-back-btn" href="javascript:;" @click="handleBack">
|
|
|
<a-icon type="left" />
|
|
|
返回列表
|
|
|
</a>
|
|
|
<span style="margin: 0 15px;color: #666;font-weight: bold;">单号:{{ detailsData&&detailsData.sparePartsReturnNo }}</span>
|
|
|
<span style="margin: 0 10px;color: #666;">供应商:{{ detailsData && detailsData.supplier && detailsData.supplier.supplierName }}</span>
|
|
|
- <a-button type="link" size="small" class="button-default" @click="showDetail=!showDetail">
|
|
|
+ <a-button type="link" size="small" id="purchaseReceiptEdit-showDetail-btn" class="button-default" @click="showDetail=!showDetail">
|
|
|
<a-icon :type="showDetail ? 'eye-invisible' : 'eye'"/> {{ showDetail?'隐藏':'查看' }}信息
|
|
|
</a-button>
|
|
|
</template>
|
|
|
</a-page-header>
|
|
|
- <a-card size="small" :bordered="false" class="salesReturnEdit-cont" v-show="showDetail">
|
|
|
+ <a-card size="small" :bordered="false" class="purchaseReceiptEdit-cont" v-show="showDetail">
|
|
|
<div slot="title">
|
|
|
<span>基础信息</span>
|
|
|
- <div style="cursor:pointer;color: #00aaff;float:right;" @click.stop="handleEditBase" >
|
|
|
+ <div style="cursor:pointer;color: #00aaff;float:right;" id="purchaseReceiptEdit-btn" @click.stop="handleEditBase" >
|
|
|
<a-icon type="edit" /> 编辑基础信息
|
|
|
</div>
|
|
|
</div>
|
|
@@ -33,35 +33,35 @@
|
|
|
<a-descriptions-item label="销售类型">{{ (detailsData && detailsData.explainInfo) || '--' }}</a-descriptions-item>
|
|
|
</a-descriptions>
|
|
|
</a-card>
|
|
|
- <a-card size="small" :bordered="false" class="salesReturnEdit-cont">
|
|
|
+ <a-card size="small" :bordered="false" class="purchaseReceiptEdit-cont">
|
|
|
<div class="table-page-search-wrapper" style="display:flex;align-items: center;justify-content: space-between;">
|
|
|
<div style="flex-grow:1;">
|
|
|
- <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
|
|
|
+ <a-form layout="inline" id="purchaseReceiptEdit-form-btn" @keyup.enter.native="$refs.table.refresh(true)">
|
|
|
<a-row :gutter="15">
|
|
|
<a-col :md="6" :sm="24">
|
|
|
- <a-form-item label="产品编码"><a-input v-model.trim="productForm.productCode" allowClear placeholder="请输入产品编码" /></a-form-item>
|
|
|
+ <a-form-item label="产品编码"><a-input id="purchaseReceiptEdit-productCode" v-model.trim="productForm.productCode" allowClear placeholder="请输入产品编码" /></a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
- <a-form-item label="产品名称"><a-input v-model.trim="productForm.productName" allowClear placeholder="请输入产品名称" /></a-form-item>
|
|
|
+ <a-form-item label="产品名称"><a-input id="purchaseReceiptEdit-productName" v-model.trim="productForm.productName" allowClear placeholder="请输入产品名称" /></a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24" style="margin-bottom: 10px;">
|
|
|
- <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
|
|
|
- <a-button style="margin-left: 5px" @click="resetSearchForm">重置</a-button>
|
|
|
+ <a-button type="primary" id="purchaseReceiptEdit-refresh" @click="$refs.table.refresh(true)">查询</a-button>
|
|
|
+ <a-button style="margin-left: 5px" id="purchaseReceiptEdit-reset" @click="resetSearchForm">重置</a-button>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
</a-form>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="showBtn">
|
|
|
- <a-button id="bulkWarehousingOrderList-add" type="primary" class="button-warning" @click="handleAdd">新增产品</a-button>
|
|
|
- <a-button id="bulkWarehousingOrderList-ex" class="button-warning" @click="handleAdd">导入产品</a-button>
|
|
|
+ <a-button id="purchaseReceiptEdit-add" type="primary" class="button-warning" @click="handleAdd">新增产品</a-button>
|
|
|
+ <a-button id="purchaseReceiptEdit-ex" class="button-warning" @click="handleImport">导入产品</a-button>
|
|
|
<a-button
|
|
|
v-if="$hasPermissions('B_sparePartsBatchAudit')"
|
|
|
- id="bulkWarehousingOrderList-batchAudit"
|
|
|
+ id="purchaseReceiptEdit-queryQty"
|
|
|
type="primary"
|
|
|
class="button-warning"
|
|
|
:loading="loading"
|
|
|
- @click="handleBatchAudit">查询库存</a-button>
|
|
|
+ @click="handleQueryQty">查询库存</a-button>
|
|
|
<a-alert type="info">
|
|
|
<div slot="message" class="total-bar">
|
|
|
<span>采购数量:{{ statisticsObj && (statisticsObj.qty || statisticsObj.qty == 0) ? statisticsObj.qty : '--' }};</span>
|
|
@@ -81,7 +81,7 @@
|
|
|
<!--申请退货数量 -->
|
|
|
<template slot="qty" slot-scope="text, record">
|
|
|
<a-input-number
|
|
|
- id="salesReturn-qty"
|
|
|
+ id="purchaseReceiptEdit-qty"
|
|
|
size="small"
|
|
|
v-model="record.qty"
|
|
|
:precision="0"
|
|
@@ -100,14 +100,14 @@
|
|
|
v-if="$hasPermissions('B_purchaseReturnEdit')"
|
|
|
@click="handleEdit(record)"
|
|
|
class="button-info"
|
|
|
- id="purchaseReceiptList-edit-btn">编辑</a-button>
|
|
|
+ id="purchaseReceiptEdit-edit-btn">编辑</a-button>
|
|
|
<a-button
|
|
|
size="small"
|
|
|
type="link"
|
|
|
:loading="delLoading"
|
|
|
class="button-error"
|
|
|
@click="handleDel(record)"
|
|
|
- id="salesReturn-Del">删除</a-button>
|
|
|
+ id="purchaseReceiptEdit-del-btn">删除</a-button>
|
|
|
</template>
|
|
|
</s-table>
|
|
|
</a-card>
|
|
@@ -119,25 +119,27 @@
|
|
|
:disabled="spinning"
|
|
|
type="primary"
|
|
|
class="button-primary"
|
|
|
- @click="beforeSubmit"
|
|
|
- id="salesReturn-handleSubmit">提交</a-button>
|
|
|
+ @click="handleSubmit"
|
|
|
+ id="purchaseReceiptEdit-submit">提交</a-button>
|
|
|
</div>
|
|
|
<!-- 新增弹窗-->
|
|
|
- <add-modal v-drag :openModal="openModal" @ok="handleOk" @close="openModal=false" />
|
|
|
- <!-- 选择审核人员 -->
|
|
|
- <chooseDepartUserModal ref="chooseDepart" :openModal="openDepartUserModal" @close="openDepartUserModal = false" @submit="handleSubmit"></chooseDepartUserModal>
|
|
|
+ <add-modal v-drag :openModal="openAddModal" @ok="handleOk" @close="openAddModal=false" />
|
|
|
+ <!-- 导入弹窗 -->
|
|
|
+ <importGuideModal :openModal="openGuideModal" :params="{sparePartsSn: $route.params.sn}" @close="openGuideModal=false" @ok="hanldeOk" />
|
|
|
<!-- 编辑基础信息弹窗 -->
|
|
|
- <basic-info-modal v-drag :openModal="openBasicInfoModal" :itemSn="sparePartsReturnSn" @ok="getBasicsData" @close="openModal = false" />
|
|
|
+ <basic-info-modal v-drag :openModal="openBasicInfoModal" :itemSn="sparePartsReturnSn" @ok="getBasicsData" @close="openBasicInfoModal = false" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { commonMixin } from '@/utils/mixin'
|
|
|
+// 组件
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
import addModal from './addModal.vue'
|
|
|
-// import queryPart from './queryPart.vue'
|
|
|
import basicInfoModal from './basicInfoModal.vue'
|
|
|
-// import chooseDepartUserModal from './chooseDepartUserModal.vue'
|
|
|
+import importGuideModal from './importGuideModal.vue'
|
|
|
+
|
|
|
+// 接口
|
|
|
import {
|
|
|
sparePartsReturnQueryPage,
|
|
|
queryPageCount,
|
|
@@ -150,30 +152,39 @@ import {
|
|
|
export default {
|
|
|
name: 'PurchaseReturnEdit',
|
|
|
mixins: [commonMixin],
|
|
|
- components: { STable, VSelect, basicInfoModal, addModal },
|
|
|
+ components: { STable, VSelect, basicInfoModal, addModal, importGuideModal },
|
|
|
data () {
|
|
|
return {
|
|
|
spinning: false,
|
|
|
+ showDetail: false, // 是否显示基础信息
|
|
|
+ delLoading: false, // 删除loading
|
|
|
+ openAddModal: false, // 打开新增产品弹窗
|
|
|
+ openBasicInfoModal: false, // 打开编辑基础信息弹窗
|
|
|
+ openGuideModal: false, // 导入产品弹窗
|
|
|
+ detailsData: null, // 基础信息数据
|
|
|
+
|
|
|
isInster: false, // 是否正在添加产品
|
|
|
- openDepartUserModal: false, // 审核人员弹窗
|
|
|
- delLoading: false,
|
|
|
- showDetail: false,
|
|
|
+ addMoreLoading: false, // 防止多次添加 加载状态
|
|
|
+
|
|
|
+ // 查询参数
|
|
|
productForm: {
|
|
|
- productName: '',
|
|
|
- productCode: '',
|
|
|
- sparePartsNo: '',
|
|
|
- orderBy: 'sprd.CREATE_DATE DESC'
|
|
|
+ productCode: '', // 产品编码
|
|
|
+ productName: '' // 产品名称
|
|
|
},
|
|
|
+ statisticsObj: null, // 统计明细
|
|
|
+
|
|
|
sparePartsReturnSn: null,
|
|
|
sparePartsReturnNo: null,
|
|
|
chooseList: [],
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
|
this.productForm.sparePartsReturnSn = this.sparePartsReturnSn
|
|
|
+ // 获取列表数据 有分页
|
|
|
return sparePartsReturnQueryPage(Object.assign(parameter, this.productForm)).then(res => {
|
|
|
let data
|
|
|
if (res.status == 200) {
|
|
|
data = res.data
|
|
|
+ // 计算表格序号
|
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
|
data.list[i].no = no + i + 1
|
|
@@ -183,14 +194,12 @@ export default {
|
|
|
return data
|
|
|
})
|
|
|
},
|
|
|
- openBasicInfoModal: false, // 修改基础信息弹窗
|
|
|
- statisticsObj: null, // 统计明细
|
|
|
- detailsData: null, // 基础信息数据
|
|
|
- addMoreLoading: false, // 批量添加动画
|
|
|
- grabFlag: undefined
|
|
|
+
|
|
|
+ grabFlag: undefined // 备注
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
+ // 列表表头配置
|
|
|
columns () {
|
|
|
const _this = this
|
|
|
const arr = [
|
|
@@ -283,8 +292,18 @@ export default {
|
|
|
},
|
|
|
// 返回
|
|
|
handleBack () {
|
|
|
- this.$router.push({ path: `/purchasingManagement/purchaseReturn/list`, query: { closeLastOldTab: true } })
|
|
|
+ this.$router.push({ name: 'purchaseReceiptList', query: { closeLastOldTab: true } })
|
|
|
+ },
|
|
|
+ // 新增产品
|
|
|
+ handleAdd () {
|
|
|
+ this.openAddModal = true
|
|
|
},
|
|
|
+ // 导入产品
|
|
|
+ handleImport () {
|
|
|
+ this.openGuideModal = true
|
|
|
+ },
|
|
|
+ // 查询库存
|
|
|
+ handleQueryQty () {},
|
|
|
// 删除所选产品
|
|
|
handleDel (row) {
|
|
|
const _this = this
|
|
@@ -314,6 +333,7 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ // 获取产品列表
|
|
|
resetTable (flag) {
|
|
|
this.$refs.table.refresh(flag)
|
|
|
},
|
|
@@ -321,62 +341,8 @@ export default {
|
|
|
resetSearchForm (flag) {
|
|
|
this.productForm.productName = ''
|
|
|
this.productForm.productCode = ''
|
|
|
- this.productForm.sparePartsNo = ''
|
|
|
this.$refs.table.refresh(!!flag)
|
|
|
},
|
|
|
- // 已选产品 blur
|
|
|
- onCellBlur (val, record) {
|
|
|
- if (val * 1 > record.putQty * 1) {
|
|
|
- this.$message.warning('申请退货数量不能大于入库数量!')
|
|
|
- this.$refs.table.refresh(true)
|
|
|
- return
|
|
|
- }
|
|
|
- const ajax_data = {
|
|
|
- sparePartsReturnSn: this.sparePartsReturnSn,
|
|
|
- sparePartsReturnNo: this.sparePartsReturnNo,
|
|
|
- sparePartsDetailSn: record.sparePartsDetailSn,
|
|
|
- productSn: record.productSn,
|
|
|
- sparePartsReturnDetailSn: record.sparePartsReturnDetailSn,
|
|
|
- stockDetailSn: record.stockDetailSn,
|
|
|
- productCode: record.productCode,
|
|
|
- putQty: record.putQty, // 入库数量
|
|
|
- returnedQty: record.returnedQty, // 已退数量
|
|
|
- qty: val, // 申退数量
|
|
|
- cost: record.cost, // 成本
|
|
|
- stockBatchNo: record.stockBatchNo, // 批次号
|
|
|
- warehouseSn: record.warehouseSn, // 仓库sn
|
|
|
- warehouseLocationSn: record.warehouseLocationSn, // 仓位sn
|
|
|
- sparePartsNo: record.sparePartsNo,
|
|
|
- sparePartsSn: record.sparePartsSn
|
|
|
- }
|
|
|
- this.saveEdit(ajax_data)
|
|
|
- },
|
|
|
- // 添加或修改产品
|
|
|
- saveProduct (row) {
|
|
|
- if (this.isInster) {
|
|
|
- // 防止多次添加产品
|
|
|
- return
|
|
|
- }
|
|
|
- this.isInster = true
|
|
|
- const paramsData = {
|
|
|
- sparePartsReturnSn: this.sparePartsReturnSn,
|
|
|
- sparePartsReturnNo: this.sparePartsReturnNo,
|
|
|
- sparePartsDetailSn: row.sparePartsDetailSn,
|
|
|
- productSn: row.productSn,
|
|
|
- stockDetailSn: row.stockDetailSn,
|
|
|
- productCode: row.productCode,
|
|
|
- putQty: row.productQty, // 入库数量
|
|
|
- returnedQty: row.returnedQty, // 已退数量
|
|
|
- qty: row.qty, // 申退数量
|
|
|
- cost: row.productCost, // 成本
|
|
|
- stockBatchNo: row.sparePartsBatchNo, // 批次号
|
|
|
- warehouseSn: row.warehouseSn, // 仓库sn
|
|
|
- warehouseLocationSn: row.warehouseLocationSn, // 仓位sn
|
|
|
- sparePartsNo: row.sparePartsNo,
|
|
|
- sparePartsSn: row.sparePartsSn
|
|
|
- }
|
|
|
- this.saveEdit(paramsData)
|
|
|
- },
|
|
|
saveMoreProduct (data) {
|
|
|
if (this.addMoreLoading) {
|
|
|
// 防止多次添加产品
|
|
@@ -459,6 +425,7 @@ export default {
|
|
|
this.spinning = false
|
|
|
})
|
|
|
},
|
|
|
+ // 初始化
|
|
|
pageInit () {
|
|
|
this.supplierSn = this.$route.query.sn
|
|
|
this.sparePartsReturnSn = this.$route.query.returnSn
|
|
@@ -522,7 +489,7 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style lang="less">
|
|
|
-.salesReturnEdit-wrap {
|
|
|
+.purchaseReceiptEdit-wrap {
|
|
|
position: relative;
|
|
|
height: 100%;
|
|
|
padding-bottom: 51px;
|
|
@@ -536,7 +503,7 @@ export default {
|
|
|
align-items:center;
|
|
|
margin-bottom:10px;
|
|
|
}
|
|
|
- .salesReturnEdit-cont {
|
|
|
+ .purchaseReceiptEdit-cont {
|
|
|
margin-top: 6px;
|
|
|
.ant-divider-horizontal {
|
|
|
margin: 10px 0 24px;
|