|
@@ -9,21 +9,21 @@
|
|
</template>
|
|
</template>
|
|
<!-- 操作区,位于 title 行的行尾 -->
|
|
<!-- 操作区,位于 title 行的行尾 -->
|
|
<template slot="extra">
|
|
<template slot="extra">
|
|
- <print :params="{allocateSn: $route.params.sn}" :disabled="localDataSource.length==0" @loading="spinning=true" @unloading="spinning=false"></print>
|
|
|
|
|
|
+ <print :params="{allocateReturnSn: $route.params.sn}" :disabled="localDataSource.length==0" @loading="spinning=true" @unloading="spinning=false"></print>
|
|
</template>
|
|
</template>
|
|
</a-page-header>
|
|
</a-page-header>
|
|
<a-card size="small" :bordered="false" v-if="basicInfoData" class="editGrap-cont">
|
|
<a-card size="small" :bordered="false" v-if="basicInfoData" class="editGrap-cont">
|
|
<a-collapse :activeKey="['0']">
|
|
<a-collapse :activeKey="['0']">
|
|
<a-collapse-panel key="0" header="基础信息">
|
|
<a-collapse-panel key="0" header="基础信息">
|
|
<a-descriptions :column="3">
|
|
<a-descriptions :column="3">
|
|
- <a-descriptions-item label="调拨退货对象">{{ (basicInfoData&&basicInfoData.targetName) || '--' }}</a-descriptions-item>
|
|
|
|
|
|
+ <a-descriptions-item label="调拨退货对象">{{ (basicInfoData&&basicInfoData.allocateReturnTypeName) || '--' }}</a-descriptions-item>
|
|
<a-descriptions-item label="调拨退货对象名称">{{ (basicInfoData&&basicInfoData.targetName) || '--' }}</a-descriptions-item>
|
|
<a-descriptions-item label="调拨退货对象名称">{{ (basicInfoData&&basicInfoData.targetName) || '--' }}</a-descriptions-item>
|
|
<a-descriptions-item label="调拨退货类型">
|
|
<a-descriptions-item label="调拨退货类型">
|
|
- <AllocateType id="allocateEdit-allocateTypeSn" style="width: 200px;" @change="changeAllocateType" v-model="basicInfoData.allocateTypeSn"></AllocateType>
|
|
|
|
|
|
+ <AllocateType id="allocateEdit-allocateReturnTypeSn" style="width: 200px;" @change="changeAllocateType" v-model="basicInfoData.allocateReturnTypeSn"></AllocateType>
|
|
</a-descriptions-item>
|
|
</a-descriptions-item>
|
|
- <a-descriptions-item label="是否抓单">{{ (basicInfoData&&basicInfoData.allocateNo) || '--' }}</a-descriptions-item>
|
|
|
|
|
|
+ <a-descriptions-item label="是否抓单">{{ (basicInfoData&&basicInfoData.grabFlagDictValue) || '--' }}</a-descriptions-item>
|
|
<a-descriptions-item label="备注">
|
|
<a-descriptions-item label="备注">
|
|
- {{ (basicInfoData&&basicInfoData.remark) }}
|
|
|
|
|
|
+ {{ (basicInfoData&&basicInfoData.remarks) }}
|
|
<a-icon type="form" title="编辑备注" @click="editRemark = true" style="color: dodgerblue;font-size: 14px;" />
|
|
<a-icon type="form" title="编辑备注" @click="editRemark = true" style="color: dodgerblue;font-size: 14px;" />
|
|
</a-descriptions-item>
|
|
</a-descriptions-item>
|
|
</a-descriptions>
|
|
</a-descriptions>
|
|
@@ -39,8 +39,8 @@
|
|
<a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
|
|
<a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
|
|
<a-row :gutter="15">
|
|
<a-row :gutter="15">
|
|
<a-col :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
- <a-form-item label="调拨单号" prop="productOrigCode">
|
|
|
|
- <a-input id="editGrap-productOrigCode" v-model.trim="queryParam.productOrigCode" placeholder="请输入调拨单号" allowClear />
|
|
|
|
|
|
+ <a-form-item label="调拨单号" prop="allocateNo">
|
|
|
|
+ <a-input id="editGrap-allocateNo" v-model.trim="queryParam.allocateNo" placeholder="请输入调拨单号" allowClear />
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
@@ -89,7 +89,14 @@
|
|
</template>
|
|
</template>
|
|
<!-- 操作 -->
|
|
<!-- 操作 -->
|
|
<template slot="action" slot-scope="text, record">
|
|
<template slot="action" slot-scope="text, record">
|
|
- <a-button size="small" type="primary" class="button-primary" @click="handleAdd(record)" id="editGrap-add-btn">添加</a-button>
|
|
|
|
|
|
+ <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>
|
|
</template>
|
|
</s-table>
|
|
</s-table>
|
|
</a-collapse-panel>
|
|
</a-collapse-panel>
|
|
@@ -102,8 +109,8 @@
|
|
<!-- 总计 -->
|
|
<!-- 总计 -->
|
|
<a-alert type="info" style="margin-bottom:10px">
|
|
<a-alert type="info" style="margin-bottom:10px">
|
|
<div slot="message">
|
|
<div slot="message">
|
|
- 退货总数量:<strong>{{ (productTotal&&(productTotal.totalQty || productTotal.totalQty==0)) ? productTotal.totalQty : '--' }}</strong> ,
|
|
|
|
- <span v-if="$hasPermissions('B_isShowPrice')">退货总金额(¥):<strong>{{ (productTotal&&(productTotal.totalPrice || productTotal.totalPrice==0)) ? productTotal.totalPrice : '--' }}</strong></span>
|
|
|
|
|
|
+ 退货总数量:<strong>{{ (basicInfoData&&(basicInfoData.totalQty || basicInfoData.totalQty==0)) ? basicInfoData.totalQty : '--' }}</strong> ,
|
|
|
|
+ <span v-if="$hasPermissions('B_isShowPrice')">退货总金额(¥):<strong>{{ (basicInfoData&&(basicInfoData.totalPrice || basicInfoData.totalPrice==0)) ? basicInfoData.totalPrice : '--' }}</strong></span>
|
|
</div>
|
|
</div>
|
|
</a-alert>
|
|
</a-alert>
|
|
<!-- 筛选条件 -->
|
|
<!-- 筛选条件 -->
|
|
@@ -152,7 +159,7 @@
|
|
<template slot="returnPrice" slot-scope="text, record">
|
|
<template slot="returnPrice" slot-scope="text, record">
|
|
<a-input-number
|
|
<a-input-number
|
|
size="small"
|
|
size="small"
|
|
- v-model="record.returnPrice"
|
|
|
|
|
|
+ v-model="record.price"
|
|
@blur="e => priceChange(e.target.value, record)"
|
|
@blur="e => priceChange(e.target.value, record)"
|
|
:precision="2"
|
|
:precision="2"
|
|
:min="0"
|
|
:min="0"
|
|
@@ -162,7 +169,7 @@
|
|
</template>
|
|
</template>
|
|
<!-- 操作 -->
|
|
<!-- 操作 -->
|
|
<template slot="action" slot-scope="text, record">
|
|
<template slot="action" slot-scope="text, record">
|
|
- <a-button size="small" type="primary" class="button-error" @click="handleDel(record)" id="editGrap-del-btn">删除</a-button>
|
|
|
|
|
|
+ <a-button size="small" type="link" class="button-error" @click="handleDel(record)" id="editGrap-del-btn">删除</a-button>
|
|
</template>
|
|
</template>
|
|
</s-table>
|
|
</s-table>
|
|
</a-collapse-panel>
|
|
</a-collapse-panel>
|
|
@@ -181,7 +188,7 @@
|
|
style="padding: 0 60px;">提交</a-button>
|
|
style="padding: 0 60px;">提交</a-button>
|
|
</div>
|
|
</div>
|
|
<!-- 导入产品 -->
|
|
<!-- 导入产品 -->
|
|
- <!-- <importGuideModal :openModal="openGuideModal" :params="{allocateSn: $route.params.sn}" @close="openGuideModal=false" @ok="handleGuideOk" /> -->
|
|
|
|
|
|
+ <!-- <importGuideModal :openModal="openGuideModal" :params="{allocateReturnSn: $route.params.sn}" @close="openGuideModal=false" @ok="handleGuideOk" /> -->
|
|
<!-- 修改基础信息 -->
|
|
<!-- 修改基础信息 -->
|
|
<a-modal
|
|
<a-modal
|
|
centered
|
|
centered
|
|
@@ -194,7 +201,7 @@
|
|
@cancle="editRemark = false"
|
|
@cancle="editRemark = false"
|
|
:width="600">
|
|
:width="600">
|
|
<a-textarea
|
|
<a-textarea
|
|
- v-model="basicInfoData.remark"
|
|
|
|
|
|
+ v-model="basicInfoData.remarks"
|
|
placeholder="请输入备注(最多120个字符)"
|
|
placeholder="请输入备注(最多120个字符)"
|
|
:maxLength="120"
|
|
:maxLength="120"
|
|
:auto-size="{ minRows: 3, maxRows: 5 }"
|
|
:auto-size="{ minRows: 3, maxRows: 5 }"
|
|
@@ -211,9 +218,18 @@
|
|
import { STable, VSelect } from '@/components'
|
|
import { STable, VSelect } from '@/components'
|
|
// import ImportGuideModal from './importGuideModal.vue'
|
|
// import ImportGuideModal from './importGuideModal.vue'
|
|
import print from './print.vue'
|
|
import print from './print.vue'
|
|
-import { queryStockProductPage } from '@/api/stock'
|
|
|
|
|
|
+import { allocDetailQueryPageForReturn } from '@/api/allocateBill'
|
|
import AllocateType from '@/views/common/allocateType.js'
|
|
import AllocateType from '@/views/common/allocateType.js'
|
|
-import { allocateBillSave, allocateBillDetailList, allocateBillDetailCount, allocateBillDetail, allocateBillDetailSave, allocateBillSubmit, allocateBillDetailDel, allocateBillDetailDelAll, allocateBillBatchInsert } from '@/api/allocateBill'
|
|
|
|
|
|
+import {
|
|
|
|
+ allocateReturnSave,
|
|
|
|
+ allocReturnDetailQueryPage,
|
|
|
|
+ allocateReturnQueryBySn,
|
|
|
|
+ allocReturnDetailInsert,
|
|
|
|
+ allocReturnDetailUpdate,
|
|
|
|
+ allocateReturnSubmit,
|
|
|
|
+ allocReturnDetailDelete
|
|
|
|
+ // allocateBillBatchInsert
|
|
|
|
+} from '@/api/allocateReturn'
|
|
|
|
|
|
export default {
|
|
export default {
|
|
components: { STable, VSelect, AllocateType, print },
|
|
components: { STable, VSelect, AllocateType, print },
|
|
@@ -223,7 +239,7 @@ export default {
|
|
queryParam: {
|
|
queryParam: {
|
|
productCode: '',
|
|
productCode: '',
|
|
productName: '',
|
|
productName: '',
|
|
- productOrigCode: ''
|
|
|
|
|
|
+ allocateNo: ''
|
|
},
|
|
},
|
|
chooseQueryParam: {
|
|
chooseQueryParam: {
|
|
productCode: '',
|
|
productCode: '',
|
|
@@ -241,12 +257,13 @@ export default {
|
|
// 加载数据方法 必须为 Promise 对象
|
|
// 加载数据方法 必须为 Promise 对象
|
|
loadData: parameter => {
|
|
loadData: parameter => {
|
|
this.disabled = true
|
|
this.disabled = true
|
|
- const dealerLevel = this.$route.params.dealerLevel == 'OTHER' ? undefined : this.$route.params.dealerLevel
|
|
|
|
- return queryStockProductPage(Object.assign(parameter, this.queryParam, { zeroQtyFlag: '0', dealerLevel: dealerLevel })).then(res => {
|
|
|
|
|
|
+ const otherParams = { allocateBill: { targetType: this.$route.params.targetType, targetSn: this.basicInfoData.targetSn } }
|
|
|
|
+ return allocDetailQueryPageForReturn(Object.assign(parameter, this.queryParam, otherParams)).then(res => {
|
|
const data = res.data
|
|
const data = res.data
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
data.list[i].no = no + i + 1
|
|
data.list[i].no = no + i + 1
|
|
|
|
+ data.list[i].returnPrice = data.list[i].price
|
|
}
|
|
}
|
|
this.loadDataSource = data.list || []
|
|
this.loadDataSource = data.list || []
|
|
this.disabled = false
|
|
this.disabled = false
|
|
@@ -258,14 +275,12 @@ export default {
|
|
// 加载数据方法 必须为 Promise 对象
|
|
// 加载数据方法 必须为 Promise 对象
|
|
chooseLoadData: parameter => {
|
|
chooseLoadData: parameter => {
|
|
this.chooseDisabled = true
|
|
this.chooseDisabled = true
|
|
- const params = Object.assign(parameter, this.chooseQueryParam, { allocateSn: this.$route.params.sn })
|
|
|
|
- return allocateBillDetailList(params).then(res => {
|
|
|
|
- this.getDetailCount()
|
|
|
|
|
|
+ const params = Object.assign(parameter, this.chooseQueryParam, { allocateReturnSn: this.$route.params.sn })
|
|
|
|
+ return allocReturnDetailQueryPage(params).then(res => {
|
|
const data = res.data
|
|
const data = res.data
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
data.list[i].no = no + i + 1
|
|
data.list[i].no = no + i + 1
|
|
- data.list[i].qtyBackups = data.list[i].qty
|
|
|
|
data.list[i].priceBackups = data.list[i].price
|
|
data.list[i].priceBackups = data.list[i].price
|
|
}
|
|
}
|
|
this.localDataSource = data.list || []
|
|
this.localDataSource = data.list || []
|
|
@@ -273,7 +288,6 @@ export default {
|
|
return data
|
|
return data
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- productTotal: null, // 合计
|
|
|
|
basicInfoData: null, // 基本信息
|
|
basicInfoData: null, // 基本信息
|
|
openGuideModal: false // 导入产品引导
|
|
openGuideModal: false // 导入产品引导
|
|
}
|
|
}
|
|
@@ -282,13 +296,13 @@ export default {
|
|
columns () {
|
|
columns () {
|
|
const arr = [
|
|
const arr = [
|
|
{ title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
|
|
{ title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
|
|
- { title: '调拨单号', dataIndex: 'productOrigCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
|
|
+ { title: '调拨单号', dataIndex: 'allocateNo', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '产品编码', dataIndex: 'productCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '产品编码', dataIndex: 'productCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '产品名称', dataIndex: 'productName', align: 'center', width: '29%', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
{ title: '产品名称', dataIndex: 'productName', align: 'center', width: '29%', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
{ title: '单位', dataIndex: 'productUnit', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '单位', dataIndex: 'productUnit', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
- { title: '调拨单价', dataIndex: 'lastStockCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
- { title: '调拨数量', dataIndex: 'currentStockQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
- { title: '剩余可退数量', dataIndex: 'productPrice', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
|
|
+ { title: '调拨单价', dataIndex: 'price', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? 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: '退货单价', scopedSlots: { customRender: 'returnPrice' }, width: '10%', align: 'center' },
|
|
{ title: '退货数量', dataIndex: 'returnQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
{ title: '退货数量', dataIndex: 'returnQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
|
|
@@ -298,16 +312,13 @@ export default {
|
|
chooseColumns () {
|
|
chooseColumns () {
|
|
const arr = [
|
|
const arr = [
|
|
{ title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
|
|
{ title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
|
|
- { title: '调拨单号', dataIndex: 'productOrigCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '产品编码', dataIndex: 'productEntity.code', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '产品名称', dataIndex: 'productEntity.name', align: 'center', width: '29%', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
- { title: '单位', dataIndex: 'productEntity.unit', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '调拨单价', dataIndex: 'lastStockCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
- { title: '调拨数量', dataIndex: 'currentStockQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
- { title: '剩余可退数量', dataIndex: 'productPrice', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
|
|
+ { title: '调拨单号', dataIndex: 'allocateNo', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { 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: '退货单价', scopedSlots: { customRender: 'returnPrice' }, width: '10%', align: 'center' },
|
|
{ title: '退货数量', dataIndex: 'returnQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
{ title: '退货数量', dataIndex: 'returnQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
- { title: '退货金额', dataIndex: 'returnAmount', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
|
|
+ { title: '退货金额', dataIndex: 'totalReturnPrice', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
|
|
]
|
|
]
|
|
return arr
|
|
return arr
|
|
@@ -318,14 +329,7 @@ export default {
|
|
handleEditRemark () {
|
|
handleEditRemark () {
|
|
const _this = this
|
|
const _this = this
|
|
const params = _this.basicInfoData
|
|
const params = _this.basicInfoData
|
|
- allocateBillSave({
|
|
|
|
- allocateSn: params.allocateSn,
|
|
|
|
- targetType: params.targetType,
|
|
|
|
- targetSn: params.targetSn,
|
|
|
|
- targetName: params.targetName,
|
|
|
|
- allocateTypeSn: params.allocateTypeSn,
|
|
|
|
- remark: params.remark
|
|
|
|
- }).then(res => {
|
|
|
|
|
|
+ allocateReturnSave(params).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
_this.$message.success(res.message)
|
|
_this.$message.success(res.message)
|
|
_this.getDetail()
|
|
_this.getDetail()
|
|
@@ -351,7 +355,7 @@ export default {
|
|
resetSearchForm () {
|
|
resetSearchForm () {
|
|
this.queryParam.productCode = ''
|
|
this.queryParam.productCode = ''
|
|
this.queryParam.productName = ''
|
|
this.queryParam.productName = ''
|
|
- this.queryParam.productOrigCode = ''
|
|
|
|
|
|
+ this.queryParam.allocateNo = ''
|
|
this.$refs.table.refresh(true)
|
|
this.$refs.table.refresh(true)
|
|
},
|
|
},
|
|
// 双击快速添加
|
|
// 双击快速添加
|
|
@@ -364,14 +368,14 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- // 导入产品
|
|
|
|
- handleGuideOk (obj) {
|
|
|
|
- allocateBillBatchInsert(obj).then(res => {
|
|
|
|
- if (res.status == 200) {
|
|
|
|
- this.$refs.chooseTable.refresh(true)
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
|
|
+ // // 导入产品
|
|
|
|
+ // handleGuideOk (obj) {
|
|
|
|
+ // allocateBillBatchInsert(obj).then(res => {
|
|
|
|
+ // if (res.status == 200) {
|
|
|
|
+ // this.$refs.chooseTable.refresh(true)
|
|
|
|
+ // }
|
|
|
|
+ // })
|
|
|
|
+ // },
|
|
// 已选产品 重置
|
|
// 已选产品 重置
|
|
chooseResetSearchForm () {
|
|
chooseResetSearchForm () {
|
|
this.chooseQueryParam.productCode = ''
|
|
this.chooseQueryParam.productCode = ''
|
|
@@ -381,26 +385,22 @@ export default {
|
|
// 添加/编辑
|
|
// 添加/编辑
|
|
handleAdd (row, isEdit, isRefresh) {
|
|
handleAdd (row, isEdit, isRefresh) {
|
|
const params = {
|
|
const params = {
|
|
- id: isEdit ? row.id : undefined,
|
|
|
|
- allocateSn: this.$route.params.sn,
|
|
|
|
- cost: isEdit ? row.cost : row.lastStockCost,
|
|
|
|
- price: isEdit ? row.price : row.productPrice,
|
|
|
|
- qty: isEdit ? row.qty : 1, // 添加时调出数量默认为1
|
|
|
|
- productSn: row.productSn
|
|
|
|
|
|
+ allocateReturnSn: this.$route.params.sn,
|
|
|
|
+ productSn: row.productSn,
|
|
|
|
+ price: isEdit ? row.price : row.returnPrice,
|
|
|
|
+ allocateNo: row.allocateNo,
|
|
|
|
+ allocateSn: row.allocateSn
|
|
}
|
|
}
|
|
|
|
+ const fun = isEdit ? allocReturnDetailUpdate : allocReturnDetailInsert
|
|
if (isEdit) { // 编辑
|
|
if (isEdit) { // 编辑
|
|
- // 清空数量时,值应保持未清空前的值,因数量不可为空
|
|
|
|
- if (!row.qty) {
|
|
|
|
- row.qty = row.qtyBackups
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
if (!row.price) {
|
|
if (!row.price) {
|
|
row.price = row.priceBackups
|
|
row.price = row.priceBackups
|
|
return
|
|
return
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ console.log(isEdit)
|
|
this.spinning = true
|
|
this.spinning = true
|
|
- allocateBillDetailSave(params).then(res => {
|
|
|
|
|
|
+ fun(params).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
this.$message.success(res.message)
|
|
this.$message.success(res.message)
|
|
if (isRefresh != 'noRefresh') {
|
|
if (isRefresh != 'noRefresh') {
|
|
@@ -410,6 +410,7 @@ export default {
|
|
this.spinning = false
|
|
this.spinning = false
|
|
} else {
|
|
} else {
|
|
this.spinning = false
|
|
this.spinning = false
|
|
|
|
+ row.price = row.priceBackups
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
@@ -423,14 +424,14 @@ export default {
|
|
centered: true,
|
|
centered: true,
|
|
onOk () {
|
|
onOk () {
|
|
if (isAll) { // 整单删除
|
|
if (isAll) { // 整单删除
|
|
- allocateBillDetailDelAll({ sn: _this.$route.params.sn }).then(res => {
|
|
|
|
- if (res.status == 200) {
|
|
|
|
- _this.$message.success(res.message)
|
|
|
|
- _this.refashPage()
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ // allocReturnDetailDeleteAll({ sn: _this.$route.params.sn }).then(res => {
|
|
|
|
+ // if (res.status == 200) {
|
|
|
|
+ // _this.$message.success(res.message)
|
|
|
|
+ // _this.refashPage()
|
|
|
|
+ // }
|
|
|
|
+ // })
|
|
} else { // 单个删除
|
|
} else { // 单个删除
|
|
- allocateBillDetailDel({ id: row.id }).then(res => {
|
|
|
|
|
|
+ allocReturnDetailDelete({ id: row.id }).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
_this.$message.success(res.message)
|
|
_this.$message.success(res.message)
|
|
_this.refashPage()
|
|
_this.refashPage()
|
|
@@ -444,7 +445,7 @@ export default {
|
|
handleSubmit () {
|
|
handleSubmit () {
|
|
const _this = this
|
|
const _this = this
|
|
_this.spinning = true
|
|
_this.spinning = true
|
|
- allocateBillSubmit({ sn: this.$route.params.sn }).then(res => {
|
|
|
|
|
|
+ allocateReturnSubmit({ allocateReturnSn: this.$route.params.sn }).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
this.$message.success(res.message)
|
|
this.$message.success(res.message)
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
@@ -459,25 +460,16 @@ export default {
|
|
// 基本信息
|
|
// 基本信息
|
|
getDetail () {
|
|
getDetail () {
|
|
this.spinning = true
|
|
this.spinning = true
|
|
- allocateBillDetail({ sn: this.$route.params.sn }).then(res => {
|
|
|
|
|
|
+ allocateReturnQueryBySn({ allocateReturnSn: this.$route.params.sn }).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
this.basicInfoData = res.data
|
|
this.basicInfoData = res.data
|
|
|
|
+ this.resetSearchForm()
|
|
} else {
|
|
} else {
|
|
this.basicInfoData = null
|
|
this.basicInfoData = null
|
|
}
|
|
}
|
|
this.spinning = false
|
|
this.spinning = false
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- // 合计
|
|
|
|
- getDetailCount () {
|
|
|
|
- allocateBillDetailCount({ allocateSn: this.$route.params.sn }).then(res => {
|
|
|
|
- if (res.status == 200) {
|
|
|
|
- this.productTotal = res.data
|
|
|
|
- } else {
|
|
|
|
- this.productTotal = null
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
// 返回列表
|
|
// 返回列表
|
|
handleBack () {
|
|
handleBack () {
|
|
this.$router.push({ name: 'transferReturnList', query: { closeLastOldTab: true } })
|
|
this.$router.push({ name: 'transferReturnList', query: { closeLastOldTab: true } })
|
|
@@ -485,8 +477,8 @@ export default {
|
|
// 已选产品 退货单价 change
|
|
// 已选产品 退货单价 change
|
|
priceChange (val, record) {
|
|
priceChange (val, record) {
|
|
// 光标移出,值发生改变再调用编辑接口
|
|
// 光标移出,值发生改变再调用编辑接口
|
|
- if (val != record.priceBackups) {
|
|
|
|
- this.handleAdd(record, 'edit', 'noRefresh')
|
|
|
|
|
|
+ if (Number(val) != Number(record.priceBackups)) {
|
|
|
|
+ this.handleAdd(record, true, 'noRefresh')
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 刷新当前页面
|
|
// 刷新当前页面
|
|
@@ -496,7 +488,6 @@ export default {
|
|
},
|
|
},
|
|
pageInit () {
|
|
pageInit () {
|
|
this.getDetail()
|
|
this.getDetail()
|
|
- this.resetSearchForm()
|
|
|
|
this.chooseResetSearchForm()
|
|
this.chooseResetSearchForm()
|
|
}
|
|
}
|
|
},
|
|
},
|