|
@@ -52,58 +52,58 @@
|
|
|
</a-card>
|
|
|
<!-- 选择产品 -->
|
|
|
<a-card size="small" title="选择产品" :bordered="false" class="editGrap-cont">
|
|
|
- <!-- 筛选条件 -->
|
|
|
- <div class="table-page-search-wrapper" style="display:flex;align-items: center;">
|
|
|
- <div style="margin-bottom: 10px;padding-right: 20px;">
|
|
|
- <a-button
|
|
|
- type="primary"
|
|
|
- class="button-info"
|
|
|
- id="salesEdit-plDel-btn"
|
|
|
- @click="handleBatchAdd">批量添加</a-button>
|
|
|
- <span>已选{{ selectTotal }}项</span>
|
|
|
- </div>
|
|
|
- <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="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-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-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="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-row>
|
|
|
- </a-form>
|
|
|
- </div>
|
|
|
- <!-- 列表 -->
|
|
|
- <s-table
|
|
|
- class="sTable"
|
|
|
- ref="table"
|
|
|
- size="small"
|
|
|
- index="0"
|
|
|
- tableId="table1"
|
|
|
- :rowKey="(record) => record.allocateNo +'-'+ record.productSn"
|
|
|
- :columns="columns"
|
|
|
- :customRow="handleClickRow"
|
|
|
- :data="loadData"
|
|
|
- :row-selection="{ columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: !record.refundableQty } }) }"
|
|
|
- @rowSelection="rowSelectionFun"
|
|
|
- :scroll="{ y: 300 }"
|
|
|
- :defaultLoadData="false"
|
|
|
- bordered>
|
|
|
- <!-- 退货单价 -->
|
|
|
- <template slot="returnPrice" slot-scope="text, record">
|
|
|
+ <!-- 筛选条件 -->
|
|
|
+ <div class="table-page-search-wrapper" style="display:flex;align-items: center;">
|
|
|
+ <div style="margin-bottom: 10px;padding-right: 20px;">
|
|
|
+ <a-button
|
|
|
+ type="primary"
|
|
|
+ class="button-info"
|
|
|
+ id="salesEdit-plDel-btn"
|
|
|
+ @click="handleBatchAdd">批量添加</a-button>
|
|
|
+ <span>已选{{ selectTotal }}项</span>
|
|
|
+ </div>
|
|
|
+ <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="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-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-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="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-row>
|
|
|
+ </a-form>
|
|
|
+ </div>
|
|
|
+ <!-- 列表 -->
|
|
|
+ <s-table
|
|
|
+ class="sTable"
|
|
|
+ ref="table"
|
|
|
+ size="small"
|
|
|
+ index="0"
|
|
|
+ tableId="table1"
|
|
|
+ :rowKey="(record) => record.allocateNo +'-'+ record.productSn"
|
|
|
+ :columns="columns"
|
|
|
+ :customRow="handleClickRow"
|
|
|
+ :data="loadData"
|
|
|
+ :row-selection="{ columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: !record.refundableQty } }) }"
|
|
|
+ @rowSelection="rowSelectionFun"
|
|
|
+ :scroll="{ y: 300 }"
|
|
|
+ :defaultLoadData="false"
|
|
|
+ bordered>
|
|
|
+ <!-- 退货单价 -->
|
|
|
+ <!-- <template slot="returnPrice" slot-scope="text, record">
|
|
|
<div @dblclick.stop>
|
|
|
<a-input-number
|
|
|
size="small"
|
|
@@ -114,89 +114,101 @@
|
|
|
placeholder="请输入"
|
|
|
style="width: 100%;" />
|
|
|
</div>
|
|
|
- </template>
|
|
|
- <!-- 操作 -->
|
|
|
- <template slot="action" slot-scope="text, record">
|
|
|
- <a-button
|
|
|
- size="small"
|
|
|
- v-if="record.refundableQty"
|
|
|
- type="link"
|
|
|
- class="button-primary"
|
|
|
- @click="handleAdd(record)"
|
|
|
- id="editGrap-add-btn">添加</a-button>
|
|
|
- <span v-else>--</span>
|
|
|
- </template>
|
|
|
- </s-table>
|
|
|
+ </template> -->
|
|
|
+ <!-- 操作 -->
|
|
|
+ <template slot="action" slot-scope="text, record">
|
|
|
+ <a-button
|
|
|
+ size="small"
|
|
|
+ v-if="record.refundableQty"
|
|
|
+ type="link"
|
|
|
+ class="button-primary"
|
|
|
+ @click="handleAdd(record)"
|
|
|
+ id="editGrap-add-btn">添加</a-button>
|
|
|
+ <span v-else>--</span>
|
|
|
+ </template>
|
|
|
+ </s-table>
|
|
|
</a-card>
|
|
|
<!-- 已选产品 -->
|
|
|
<a-card size="small" title="已选产品" :bordered="false" class="editGrap-cont">
|
|
|
- <!-- 总计 -->
|
|
|
- <a-alert type="info" style="margin-bottom:10px">
|
|
|
- <div slot="message">
|
|
|
- 退货总数量:<strong>{{ (basicInfoData&&(basicInfoData.totalQty || basicInfoData.totalQty==0)) ? basicInfoData.totalQty : '--' }}</strong> ;
|
|
|
- <span>退货总金额:<strong>{{ (basicInfoData&&(basicInfoData.totalPrice || basicInfoData.totalPrice==0)) ? toThousands(basicInfoData.totalPrice) : '--' }}</strong>;</span>
|
|
|
- </div>
|
|
|
- </a-alert>
|
|
|
- <!-- 筛选条件 -->
|
|
|
- <a-row :gutter="15">
|
|
|
- <a-col :span="17">
|
|
|
- <div class="table-page-search-wrapper">
|
|
|
- <a-form layout="inline" @keyup.enter.native="$refs.chooseTable.refresh(true)">
|
|
|
- <a-row :gutter="15">
|
|
|
- <a-col :md="9" :sm="24">
|
|
|
- <a-form-item label="产品编码" prop="productCode">
|
|
|
- <a-input id="editGrap-productCode" v-model.trim="chooseQueryParam.productCode" placeholder="请输入产品编码" allowClear />
|
|
|
- </a-form-item>
|
|
|
- </a-col>
|
|
|
- <a-col :md="9" :sm="24">
|
|
|
- <a-form-item label="产品名称" prop="productName">
|
|
|
- <a-input id="editGrap-productName" v-model.trim="chooseQueryParam.productName" placeholder="请输入产品名称" allowClear />
|
|
|
- </a-form-item>
|
|
|
- </a-col>
|
|
|
- <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
|
|
|
- <a-button type="primary" @click="$refs.chooseTable.refresh(true)" :disabled="chooseDisabled" id="storeTransferOutList-refresh">查询</a-button>
|
|
|
- <a-button style="margin-left: 8px" @click="chooseResetSearchForm" :disabled="chooseDisabled" id="storeTransferOutList-reset">重置</a-button>
|
|
|
- </a-col>
|
|
|
- </a-row>
|
|
|
- </a-form>
|
|
|
- </div>
|
|
|
- </a-col>
|
|
|
- <a-col :span="7" style="text-align: right;">
|
|
|
- <!-- <a-button size="small" id="editGrap-import-btn" @click="openGuideModal=true">导入产品</a-button> -->
|
|
|
- <!-- <a-button size="small" type="danger" style="margin-left: 5px" @click.stop="handleDel('', 'all')" id="chainTransferOutEdit-del-all-btn">整单删除</a-button> -->
|
|
|
- </a-col>
|
|
|
- </a-row>
|
|
|
- <!-- 列表 -->
|
|
|
- <s-table
|
|
|
- class="sTable"
|
|
|
- ref="chooseTable"
|
|
|
+ <!-- 总计 -->
|
|
|
+ <a-alert type="info" style="margin-bottom:10px">
|
|
|
+ <div slot="message">
|
|
|
+ 退货总数量:<strong>{{ (basicInfoData&&(basicInfoData.totalQty || basicInfoData.totalQty==0)) ? basicInfoData.totalQty : '--' }}</strong> ;
|
|
|
+ <span>退货总金额:<strong>{{ (basicInfoData&&(basicInfoData.totalPrice || basicInfoData.totalPrice==0)) ? toThousands(basicInfoData.totalPrice) : '--' }}</strong>;</span>
|
|
|
+ </div>
|
|
|
+ </a-alert>
|
|
|
+ <!-- 筛选条件 -->
|
|
|
+ <a-row :gutter="15">
|
|
|
+ <a-col :span="17">
|
|
|
+ <div class="table-page-search-wrapper">
|
|
|
+ <a-form layout="inline" @keyup.enter.native="$refs.chooseTable.refresh(true)">
|
|
|
+ <a-row :gutter="15">
|
|
|
+ <a-col :md="9" :sm="24">
|
|
|
+ <a-form-item label="产品编码" prop="productCode">
|
|
|
+ <a-input id="editGrap-productCode" v-model.trim="chooseQueryParam.productCode" placeholder="请输入产品编码" allowClear />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="9" :sm="24">
|
|
|
+ <a-form-item label="产品名称" prop="productName">
|
|
|
+ <a-input id="editGrap-productName" v-model.trim="chooseQueryParam.productName" placeholder="请输入产品名称" allowClear />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
|
|
|
+ <a-button type="primary" @click="$refs.chooseTable.refresh(true)" :disabled="chooseDisabled" id="storeTransferOutList-refresh">查询</a-button>
|
|
|
+ <a-button style="margin-left: 8px" @click="chooseResetSearchForm" :disabled="chooseDisabled" id="storeTransferOutList-reset">重置</a-button>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ </a-form>
|
|
|
+ </div>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="7" style="text-align: right;">
|
|
|
+ <!-- <a-button size="small" id="editGrap-import-btn" @click="openGuideModal=true">导入产品</a-button> -->
|
|
|
+ <!-- <a-button size="small" type="danger" style="margin-left: 5px" @click.stop="handleDel('', 'all')" id="chainTransferOutEdit-del-all-btn">整单删除</a-button> -->
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ <!-- 列表 -->
|
|
|
+ <s-table
|
|
|
+ class="sTable"
|
|
|
+ ref="chooseTable"
|
|
|
+ size="small"
|
|
|
+ index="1"
|
|
|
+ tableId="table2"
|
|
|
+ :rowKey="(record) => record.no"
|
|
|
+ rowKeyName="no"
|
|
|
+ :columns="chooseColumns"
|
|
|
+ :data="chooseLoadData"
|
|
|
+ :scroll="{ y: 300 }"
|
|
|
+ :defaultLoadData="false"
|
|
|
+ bordered>
|
|
|
+ <!-- 退货单价 -->
|
|
|
+ <!-- <template slot="returnPrice" slot-scope="text, record">
|
|
|
+ <a-input-number
|
|
|
+ size="small"
|
|
|
+ v-model="record.price"
|
|
|
+ @blur="e => priceChange(e.target.value, record)"
|
|
|
+ :precision="2"
|
|
|
+ :min="0"
|
|
|
+ :max="99999999"
|
|
|
+ placeholder="请输入"
|
|
|
+ style="width: 100%;" />
|
|
|
+ </template> -->
|
|
|
+ <!-- 退货数量 -->
|
|
|
+ <template slot="returnQty" slot-scope="text, record,index">
|
|
|
+ <a-input-number
|
|
|
size="small"
|
|
|
- index="1"
|
|
|
- tableId="table2"
|
|
|
- :rowKey="(record) => record.no"
|
|
|
- rowKeyName="no"
|
|
|
- :columns="chooseColumns"
|
|
|
- :data="chooseLoadData"
|
|
|
- :scroll="{ y: 300 }"
|
|
|
- :defaultLoadData="false"
|
|
|
- bordered>
|
|
|
- <!-- 退货单价 -->
|
|
|
- <template slot="returnPrice" slot-scope="text, record">
|
|
|
- <a-input-number
|
|
|
- size="small"
|
|
|
- v-model="record.price"
|
|
|
- @blur="e => priceChange(e.target.value, record)"
|
|
|
- :precision="2"
|
|
|
- :min="0"
|
|
|
- :max="99999999"
|
|
|
- placeholder="请输入"
|
|
|
- style="width: 100%;" />
|
|
|
- </template>
|
|
|
- <!-- 操作 -->
|
|
|
- <template slot="action" slot-scope="text, record">
|
|
|
- <a-button size="small" type="link" class="button-error" @click="handleDel(record)" id="editGrap-del-btn">删除</a-button>
|
|
|
- </template>
|
|
|
- </s-table>
|
|
|
+ v-model="record.returnQty"
|
|
|
+ @blur="e => returnQtyChange(e.target.value, record,index)"
|
|
|
+ :precision="0"
|
|
|
+ :min="0"
|
|
|
+ :max="record.returnQty"
|
|
|
+ placeholder="请输入"
|
|
|
+ style="width: 100%;" />
|
|
|
+ </template>
|
|
|
+ <!-- 操作 -->
|
|
|
+ <template slot="action" slot-scope="text, record">
|
|
|
+ <a-button size="small" type="link" class="button-error" @click="handleDel(record)" id="editGrap-del-btn">删除</a-button>
|
|
|
+ </template>
|
|
|
+ </s-table>
|
|
|
</a-card>
|
|
|
<!--</a-spin>-->
|
|
|
</div>
|
|
@@ -278,15 +290,13 @@ export default {
|
|
|
loading: false,
|
|
|
chooseDisabled: false, // 查询、重置按钮是否可操作
|
|
|
advanced: false, // 高级搜索 展开/关闭
|
|
|
- targetType: '',
|
|
|
allocateReturnSn: '',
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
|
this.disabled = true
|
|
|
- const warehouseSn = this.basicInfoData.warehouseSn
|
|
|
- const targetSn = this.basicInfoData.targetSn
|
|
|
+ const targetSn = this.basicInfoData.targetSn
|
|
|
const allocateNo = this.queryParam.allocateNo
|
|
|
- const otherParams = { allocateBill: { targetType: this.targetType , targetSn:targetSn, allocateNo: allocateNo } }
|
|
|
+ const otherParams = { allocateBill: { targetType: this.basicInfoData.targetType, targetSn: targetSn, allocateNo: allocateNo } }
|
|
|
return allocDetailQueryPageForReturn(Object.assign(parameter, this.queryParam, otherParams)).then(res => {
|
|
|
const data = res.data
|
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
@@ -338,11 +348,11 @@ export default {
|
|
|
{ title: '单位', dataIndex: 'productUnit', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
{ title: '调拨数量', dataIndex: 'qty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
{ title: '剩余可退数量', dataIndex: 'refundableQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '退货单价', scopedSlots: { customRender: 'returnPrice' }, width: '10%', align: 'center' },
|
|
|
+ { title: '退货单价', dataIndex: 'returnPrice', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
{ title: '退货数量', dataIndex: 'returnQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
|
|
|
]
|
|
|
- arr.splice(5,0,{ title: '调拨单价', dataIndex: 'price', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
|
|
|
+ arr.splice(5, 0, { title: '调拨单价', dataIndex: 'price', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
|
|
|
return arr
|
|
|
},
|
|
|
chooseColumns () {
|
|
@@ -353,11 +363,11 @@ export default {
|
|
|
{ title: '产品编码', dataIndex: 'product.code', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
{ title: '产品名称', dataIndex: 'product.name', align: 'center', width: '29%', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
{ title: '单位', dataIndex: 'product.unit', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '退货单价', scopedSlots: { customRender: 'returnPrice' }, width: '10%', align: 'center' },
|
|
|
- { title: '退货数量', dataIndex: 'returnQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '退货单价', dataIndex: 'price', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+ { title: '退货数量', scopedSlots: { customRender: 'returnQty' }, width: '10%', align: 'center' },
|
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
|
|
|
]
|
|
|
- arr.splice(7,0,{ title: '退货金额', dataIndex: 'totalReturnPrice', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') }})
|
|
|
+ arr.splice(7, 0, { title: '退货金额', dataIndex: 'totalReturnPrice', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
|
|
|
return arr
|
|
|
}
|
|
|
},
|
|
@@ -434,7 +444,7 @@ export default {
|
|
|
_this.editRemark = false
|
|
|
},
|
|
|
// 修改仓库
|
|
|
- updateWarehouse(warehouseSn){
|
|
|
+ updateWarehouse (warehouseSn) {
|
|
|
this.basicInfoData.warehouseSn = warehouseSn
|
|
|
this.handleEditRemark()
|
|
|
},
|
|
@@ -503,7 +513,8 @@ export default {
|
|
|
productSn: row.productSn,
|
|
|
price: isEdit ? row.price : row.returnPrice,
|
|
|
allocateNo: row.allocateNo,
|
|
|
- allocateSn: row.allocateSn
|
|
|
+ allocateSn: row.allocateSn,
|
|
|
+ returnableQty: row.returnQty
|
|
|
}
|
|
|
const fun = isEdit ? allocReturnDetailUpdate : allocReturnDetailInsert
|
|
|
if (isEdit) { // 编辑
|
|
@@ -605,12 +616,10 @@ export default {
|
|
|
handleBack () {
|
|
|
this.$router.push({ name: 'transferReturnList', query: { closeLastOldTab: true } })
|
|
|
},
|
|
|
- // 已选产品 退货单价 change
|
|
|
- priceChange (val, record) {
|
|
|
- // 光标移出,值发生改变再调用编辑接口
|
|
|
- if (Number(val) != Number(record.oldPrice)) {
|
|
|
- this.handleAdd(record, true, 'noRefresh')
|
|
|
- }
|
|
|
+ // 已选产品 退货数量 change
|
|
|
+ returnQtyChange (val, row, pos) {
|
|
|
+ this.localDataSource[pos].returnQty = Number(val)
|
|
|
+ this.handleAdd(row, true, 'noRefresh')
|
|
|
},
|
|
|
// 刷新当前页面
|
|
|
refashPage () {
|
|
@@ -619,7 +628,6 @@ export default {
|
|
|
this.$refs.chooseTable.refresh()
|
|
|
},
|
|
|
pageInit () {
|
|
|
- this.targetType = this.$route.params.targetType
|
|
|
this.allocateReturnSn = this.$route.params.sn
|
|
|
this.getDetail()
|
|
|
this.chooseResetSearchForm()
|