|
@@ -40,25 +40,35 @@
|
|
|
<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-col :md="5" :sm="24">
|
|
|
<a-form-item label="调拨单号" prop="allocateNo">
|
|
|
<a-input id="editGrap-allocateNo" v-model.trim="queryParam.allocateNo" placeholder="请输入调拨单号" allowClear />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
+ <a-col :md="5" :sm="24">
|
|
|
<a-form-item label="产品编码" prop="productCode">
|
|
|
<a-input id="editGrap-productCode" v-model.trim="queryParam.productCode" placeholder="请输入产品编码" allowClear />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
+ <a-col :md="5" :sm="24">
|
|
|
<a-form-item label="产品名称" prop="productName">
|
|
|
<a-input id="editGrap-productName" v-model.trim="queryParam.productName" placeholder="请输入产品名称" allowClear />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
- <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
|
|
|
+ <a-col :md="4" :sm="24" style="margin-bottom: 10px;">
|
|
|
<a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="storeTransferOutList-refresh">查询</a-button>
|
|
|
<a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="storeTransferOutList-reset">重置</a-button>
|
|
|
</a-col>
|
|
|
+ <a-col :md="5" :sm="24" style="margin-bottom: 10px;text-align: right;">
|
|
|
+ <span>已选{{ selectTotal }}项</span>
|
|
|
+ <a-button
|
|
|
+ style="margin:0 15px;"
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ class="button-info"
|
|
|
+ id="salesEdit-plDel-btn"
|
|
|
+ @click="handleBatchAdd">批量添加</a-button>
|
|
|
+ </a-col>
|
|
|
</a-row>
|
|
|
</a-form>
|
|
|
</div>
|
|
@@ -73,6 +83,8 @@
|
|
|
:columns="columns"
|
|
|
:customRow="handleClickRow"
|
|
|
:data="loadData"
|
|
|
+ :row-selection="{ columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: !record.refundableQty } }) }"
|
|
|
+ @rowSelection="rowSelectionFun"
|
|
|
:scroll="{ y: 300 }"
|
|
|
:defaultLoadData="false"
|
|
|
bordered>
|
|
@@ -230,8 +242,8 @@ import {
|
|
|
allocReturnDetailInsert,
|
|
|
allocReturnDetailUpdate,
|
|
|
allocateReturnSubmit,
|
|
|
- allocReturnDetailDelete
|
|
|
- // allocateBillBatchInsert
|
|
|
+ allocReturnDetailDelete,
|
|
|
+ allocReturnDetailInsertBatch
|
|
|
} from '@/api/allocateReturn'
|
|
|
|
|
|
export default {
|
|
@@ -295,10 +307,14 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
basicInfoData: null, // 基本信息
|
|
|
- openGuideModal: false // 导入产品引导
|
|
|
+ openGuideModal: false, // 导入产品引导
|
|
|
+ rowSelectionInfo: null
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
+ selectTotal () {
|
|
|
+ return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length || 0
|
|
|
+ },
|
|
|
columns () {
|
|
|
const arr = [
|
|
|
{ title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
|
|
@@ -331,6 +347,63 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 表格选中项
|
|
|
+ rowSelectionFun (obj) {
|
|
|
+ this.rowSelectionInfo = obj || null
|
|
|
+ },
|
|
|
+ // 批量添加
|
|
|
+ handleBatchAdd () {
|
|
|
+ const _this = this
|
|
|
+ if (!_this.rowSelectionInfo || (_this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys.length < 1)) {
|
|
|
+ _this.$message.warning('请在选择要添加的产品后再进行批量操作!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const obj = []
|
|
|
+ _this.rowSelectionInfo && _this.rowSelectionInfo.selectedRows.map(item => {
|
|
|
+ obj.push({
|
|
|
+ 'allocateNo': item.allocateNo,
|
|
|
+ 'allocateSn': item.allocateSn,
|
|
|
+ 'oldPrice': item.oldPrice,
|
|
|
+ 'price': item.returnPrice,
|
|
|
+ 'productSn': item.productSn,
|
|
|
+ 'productCode': item.productCode
|
|
|
+ })
|
|
|
+ })
|
|
|
+ this.$confirm({
|
|
|
+ title: '提示',
|
|
|
+ content: '已选产品' + obj.length + '项,确认要批量添加吗?',
|
|
|
+ centered: true,
|
|
|
+ onOk () {
|
|
|
+ _this.spinning = true
|
|
|
+ allocReturnDetailInsertBatch({
|
|
|
+ allocateReturnSn: _this.$route.params.sn,
|
|
|
+ detailDtoList: obj
|
|
|
+ }).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ _this.$refs.table.clearSelected() // 清空表格选中项
|
|
|
+ _this.getDetail(true)
|
|
|
+ _this.$refs.chooseTable.refresh()
|
|
|
+ if (res.data.failMessage.length) {
|
|
|
+ _this.showFailMessage(res.data)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ _this.spinning = false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ showFailMessage (data) {
|
|
|
+ const h = this.$createElement
|
|
|
+ const htmlStr = [h('p', data.message)]
|
|
|
+ for (let i = 0; i < data.failMessage.length; i++) {
|
|
|
+ htmlStr.push(h('p', data.failMessage[i]))
|
|
|
+ }
|
|
|
+ this.$info({
|
|
|
+ title: '操作提示',
|
|
|
+ content: h('div', {}, htmlStr),
|
|
|
+ centered: true
|
|
|
+ })
|
|
|
+ },
|
|
|
// 修改备注
|
|
|
handleEditRemark () {
|
|
|
const _this = this
|
|
@@ -366,6 +439,7 @@ export default {
|
|
|
this.queryParam.productName = ''
|
|
|
this.queryParam.allocateNo = ''
|
|
|
this.$refs.table.refresh(true)
|
|
|
+ this.$refs.table.clearSelected() // 清空表格选中项
|
|
|
},
|
|
|
// 双击快速添加
|
|
|
handleClickRow (record) {
|