|
@@ -13,108 +13,110 @@
|
|
|
</template>
|
|
|
</a-page-header>
|
|
|
<!-- 选择产品 -->
|
|
|
- <div class="purchaseReturnEdit-cont">
|
|
|
- <a-collapse :activeKey="['1']">
|
|
|
- <a-collapse-panel key="1" header="选择产品">
|
|
|
- <!-- 筛选条件 -->
|
|
|
- <div class="table-page-search-wrapper">
|
|
|
- <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
|
|
|
- <a-row :gutter="15">
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
- <a-form-item label="产品编码" prop="productCode">
|
|
|
- <a-input id="bulkReturnGoodsEdit-productCode" v-model.trim="queryParam.productCode" placeholder="请输入产品编码" allowClear />
|
|
|
- </a-form-item>
|
|
|
- </a-col>
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
- <a-form-item label="产品名称" prop="productName">
|
|
|
- <a-input id="bulkReturnGoodsEdit-productName" v-model.trim="queryParam.productName" placeholder="请输入产品名称" allowClear />
|
|
|
- </a-form-item>
|
|
|
- </a-col>
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
- <a-form-model-item label="仓库">
|
|
|
- <a-select
|
|
|
- placeholder="请选择仓库"
|
|
|
- id="bulkReturnGoodsEdit-warehouseSn"
|
|
|
- allowClear
|
|
|
- v-model="queryParam.warehouseSn"
|
|
|
- :showSearch="true"
|
|
|
- option-filter-prop="children"
|
|
|
- :filter-option="filterOption">
|
|
|
- <a-select-option v-for="item in warehouseList" :key="item.warehouseSn" :value="item.warehouseSn">{{ item.name }}</a-select-option>
|
|
|
- </a-select>
|
|
|
- </a-form-model-item>
|
|
|
- </a-col>
|
|
|
- <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
|
|
|
- <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="bulkReturnGoodsEdit-refresh">查询</a-button>
|
|
|
- <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="bulkReturnGoodsEdit-reset">重置</a-button>
|
|
|
- </a-col>
|
|
|
- </a-row>
|
|
|
- </a-form>
|
|
|
- </div>
|
|
|
- <!-- 列表 -->
|
|
|
- <s-table
|
|
|
- class="sTable"
|
|
|
- ref="table"
|
|
|
- size="small"
|
|
|
- :rowKey="(record) => record.id"
|
|
|
- :columns="columns"
|
|
|
- :data="loadData"
|
|
|
- :defaultLoadData="false"
|
|
|
- :pageSize="10"
|
|
|
- :scroll="{ y: 149 }"
|
|
|
- bordered>
|
|
|
- <!-- 数量 -->
|
|
|
- <template slot="returnQty" slot-scope="text, record">
|
|
|
- <a-input-number
|
|
|
- size="small"
|
|
|
- id="purchaseReturnEdit-returnQty"
|
|
|
- v-model="record.returnQty"
|
|
|
- :precision="0"
|
|
|
- :min="1"
|
|
|
- :max="record.refundableQty"
|
|
|
- placeholder="请输入"
|
|
|
- style="width: 100%;" />
|
|
|
- </template>
|
|
|
- <!-- 单价 -->
|
|
|
- <template slot="returnPrice" slot-scope="text, record">
|
|
|
- <a-input-number
|
|
|
- size="small"
|
|
|
- id="purchaseReturnEdit-returnPrice"
|
|
|
- v-model="record.returnPrice"
|
|
|
- :precision="2"
|
|
|
- :min="0"
|
|
|
- :max="999999"
|
|
|
- placeholder="请输入"
|
|
|
- style="width: 100%;" />
|
|
|
- </template>
|
|
|
- <!-- 操作 -->
|
|
|
- <template slot="action" slot-scope="text, record">
|
|
|
- <span v-if="record.refundableQty==0">--</span>
|
|
|
- <a-button
|
|
|
- v-else
|
|
|
- size="small"
|
|
|
- type="link"
|
|
|
- class="button-primary"
|
|
|
- @click="handleAdd(record)"
|
|
|
- id="purchaseReturnEdit-add-btn">添加</a-button>
|
|
|
- </template>
|
|
|
- </s-table>
|
|
|
- </a-collapse-panel>
|
|
|
- </a-collapse>
|
|
|
- </div>
|
|
|
+ <a-card size="small" :bordered="false" class="purchaseReturnEdit-cont">
|
|
|
+ <div class="purchaseReturnEdit-cont">
|
|
|
+ <a-collapse :activeKey="['1']">
|
|
|
+ <a-collapse-panel key="1" header="选择产品">
|
|
|
+ <!-- 筛选条件 -->
|
|
|
+ <div class="table-page-search-wrapper">
|
|
|
+ <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
|
|
|
+ <a-row :gutter="15">
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="产品编码" prop="productCode">
|
|
|
+ <a-input id="bulkReturnGoodsEdit-productCode" v-model.trim="queryParam.productCode" placeholder="请输入产品编码" allowClear />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="产品名称" prop="productName">
|
|
|
+ <a-input id="bulkReturnGoodsEdit-productName" v-model.trim="queryParam.productName" placeholder="请输入产品名称" allowClear />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-model-item label="仓库">
|
|
|
+ <a-select
|
|
|
+ placeholder="请选择仓库"
|
|
|
+ id="bulkReturnGoodsEdit-warehouseSn"
|
|
|
+ allowClear
|
|
|
+ v-model="queryParam.warehouseSn"
|
|
|
+ :showSearch="true"
|
|
|
+ option-filter-prop="children"
|
|
|
+ :filter-option="filterOption">
|
|
|
+ <a-select-option v-for="item in warehouseList" :key="item.warehouseSn" :value="item.warehouseSn">{{ item.name }}</a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
|
|
|
+ <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="bulkReturnGoodsEdit-refresh">查询</a-button>
|
|
|
+ <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="bulkReturnGoodsEdit-reset">重置</a-button>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ </a-form>
|
|
|
+ </div>
|
|
|
+ <!-- 列表 -->
|
|
|
+ <s-table
|
|
|
+ class="sTable"
|
|
|
+ ref="table"
|
|
|
+ size="small"
|
|
|
+ :rowKey="(record) => record.id"
|
|
|
+ :columns="columns"
|
|
|
+ :data="loadData"
|
|
|
+ :defaultLoadData="false"
|
|
|
+ :pageSize="10"
|
|
|
+ :scroll="{ y: 149 }"
|
|
|
+ bordered>
|
|
|
+ <!-- 数量 -->
|
|
|
+ <template slot="returnQty" slot-scope="text, record">
|
|
|
+ <a-input-number
|
|
|
+ size="small"
|
|
|
+ id="purchaseReturnEdit-returnQty"
|
|
|
+ v-model="record.returnQty"
|
|
|
+ :precision="0"
|
|
|
+ :min="1"
|
|
|
+ :max="record.refundableQty"
|
|
|
+ placeholder="请输入"
|
|
|
+ style="width: 100%;" />
|
|
|
+ </template>
|
|
|
+ <!-- 单价 -->
|
|
|
+ <template slot="returnPrice" slot-scope="text, record">
|
|
|
+ <a-input-number
|
|
|
+ size="small"
|
|
|
+ id="purchaseReturnEdit-returnPrice"
|
|
|
+ v-model="record.returnPrice"
|
|
|
+ :precision="2"
|
|
|
+ :min="0"
|
|
|
+ :max="999999"
|
|
|
+ placeholder="请输入"
|
|
|
+ style="width: 100%;" />
|
|
|
+ </template>
|
|
|
+ <!-- 操作 -->
|
|
|
+ <template slot="action" slot-scope="text, record">
|
|
|
+ <span v-if="record.refundableQty==0">--</span>
|
|
|
+ <a-button
|
|
|
+ v-else
|
|
|
+ size="small"
|
|
|
+ type="link"
|
|
|
+ class="button-primary"
|
|
|
+ @click="handleAdd(record)"
|
|
|
+ id="purchaseReturnEdit-add-btn">添加</a-button>
|
|
|
+ </template>
|
|
|
+ </s-table>
|
|
|
+ </a-collapse-panel>
|
|
|
+ </a-collapse>
|
|
|
+ </div>
|
|
|
+ </a-card>
|
|
|
<!-- 已选产品 -->
|
|
|
<a-card size="small" :bordered="false" class="purchaseReturnEdit-cont">
|
|
|
<a-collapse :activeKey="['1']">
|
|
|
<a-collapse-panel key="1">
|
|
|
<template slot="header">
|
|
|
已选产品
|
|
|
- <a-button
|
|
|
+ <!-- <a-button
|
|
|
size="small"
|
|
|
type="primary"
|
|
|
class="button-error"
|
|
|
id="purchaseReturnEdit-delAll-btn"
|
|
|
@click.stop="handleDel('', 'all')"
|
|
|
- style="margin-right: 10px;float: right;">整单删除</a-button>
|
|
|
+ style="margin-right: 10px;float: right;">整单删除</a-button> -->
|
|
|
</template>
|
|
|
<!-- 总计 -->
|
|
|
<a-alert type="info" style="margin-bottom:10px">
|
|
@@ -188,6 +190,10 @@
|
|
|
@blur="e => costBlur(e.target.value, record)"
|
|
|
style="width: 100%;" />
|
|
|
</template>
|
|
|
+ <!-- 退货金额合计 amount-->
|
|
|
+ <template slot="amount" slot-scope="text, record">
|
|
|
+ {{ (record.cost * record.qty).toFixed(2) }}
|
|
|
+ </template>
|
|
|
<!-- 操作 -->
|
|
|
<template slot="action" slot-scope="text, record">
|
|
|
<a-button size="small" type="link" class="button-error" @click="handleDel(record)" id="purchaseReturnEdit-del-btn">删除</a-button>
|
|
@@ -272,18 +278,24 @@ export default {
|
|
|
// 表头
|
|
|
chooseColumns: [
|
|
|
{ title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
|
|
|
- { title: '采购单号', dataIndex: 'purchaseBillNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
{ title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
{ title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '仓库', dataIndex: 'warehouseName', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '仓位', dataIndex: 'warehouseLocationName', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
{ title: '单位', dataIndex: 'dealerProductEntity.unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
{ title: '退货单价', scopedSlots: { customRender: 'price' }, width: '10%', align: 'center' },
|
|
|
{ title: '退货数量', scopedSlots: { customRender: 'qty' }, width: '10%', align: 'center' },
|
|
|
{ title: '退货金额', scopedSlots: { customRender: 'amount' }, width: '6%', align: 'center' },
|
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
|
|
|
],
|
|
|
+ chooseDisabled: false,
|
|
|
+ chooseQueryParam: {
|
|
|
+ productCode: '',
|
|
|
+ productName: ''
|
|
|
+ },
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
chooseLoadData: parameter => {
|
|
|
- return purchaseReturnDetailList(Object.assign(parameter, { purchaseReturnSn: this.$route.params.sn, orderBy: 'qpls_purchase_return_bill_detail.CREATE_DATE desc' })).then(res => {
|
|
|
+ return purchaseReturnDetailList(Object.assign(parameter, this.chooseQueryParam, { purchaseReturnSn: this.$route.params.sn, orderBy: 'qpls_purchase_return_bill_detail.CREATE_DATE desc' })).then(res => {
|
|
|
const data = res.data
|
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
@@ -314,13 +326,18 @@ export default {
|
|
|
_this.spinning = false
|
|
|
})
|
|
|
},
|
|
|
- // 重置
|
|
|
resetSearchForm () {
|
|
|
- this.queryParam.purchaseBillNo = ''
|
|
|
this.queryParam.productCode = ''
|
|
|
this.queryParam.productName = ''
|
|
|
+ this.queryParam.warehouseSn = undefined
|
|
|
this.$refs.table.refresh(true)
|
|
|
},
|
|
|
+ // 已选产品 重置
|
|
|
+ chooseResetSearchForm () {
|
|
|
+ this.chooseQueryParam.productCode = ''
|
|
|
+ this.chooseQueryParam.productName = ''
|
|
|
+ this.$refs.chooseTable.refresh(true)
|
|
|
+ },
|
|
|
// 添加/编辑
|
|
|
handleAdd (row, isEdit) {
|
|
|
// 添加时退货数量字段名为returnQty,编辑时退货数量字段名为qty
|
|
@@ -332,13 +349,10 @@ export default {
|
|
|
this.$message.warning('请输入退货数量')
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
const params = {
|
|
|
id: isEdit ? row.id : undefined,
|
|
|
purchaseReturnSn: this.$route.params.sn,
|
|
|
- purchaseBillSn: row.purchaseBillSn,
|
|
|
- purchaseBillNo: row.purchaseBillNo,
|
|
|
- purchaseBillDetailSn: row.purchaseBillDetailSn,
|
|
|
+ purchaseReturnDetailSn: row.purchaseReturnDetailSn,
|
|
|
qty: isEdit ? row.qty : row.returnQty, // 退货数量
|
|
|
productSn: row.productSn,
|
|
|
productCode: row.productCode,
|
|
@@ -403,7 +417,6 @@ export default {
|
|
|
purchaseReturnDelAll({ purchaseReturnSn: _this.$route.params.sn }).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
_this.$message.success(res.message)
|
|
|
- // _this.$refs.table.refresh()
|
|
|
_this.$refs.chooseTable.refresh()
|
|
|
_this.spinning = false
|
|
|
} else {
|
|
@@ -415,7 +428,6 @@ export default {
|
|
|
purchaseReturnDetailDel({ id: row.id }).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
_this.$message.success(res.message)
|
|
|
- // _this.$refs.table.refresh()
|
|
|
_this.$refs.chooseTable.refresh()
|
|
|
_this.spinning = false
|
|
|
} else {
|