|
@@ -22,8 +22,8 @@
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-form>
|
|
</a-form>
|
|
<div style="border-top:1px solid #eee;padding-top:10px;">
|
|
<div style="border-top:1px solid #eee;padding-top:10px;">
|
|
- <a-button type="primary" :loading="loading" class="button-info" @click="plSetQty">批量设置良品数量</a-button>
|
|
|
|
- <a-button type="primary" :loading="loading" class="button-error" @click="plSetQty">批量设置返库数量</a-button>
|
|
|
|
|
|
+ <a-button type="primary" :loading="loading" class="button-info" @click="plSetQty(1)">批量设置良品数量</a-button>
|
|
|
|
+ <a-button type="primary" :loading="loading" class="button-error" @click="plSetQty(2)">批量设置返库数量</a-button>
|
|
<div style="float:right;color:#999;margin-top:8px;">说明:红色行表示收货时新增的产品</div>
|
|
<div style="float:right;color:#999;margin-top:8px;">说明:红色行表示收货时新增的产品</div>
|
|
</div>
|
|
</div>
|
|
<!-- 已选配件列表 -->
|
|
<!-- 已选配件列表 -->
|
|
@@ -51,7 +51,7 @@
|
|
:min="0"
|
|
:min="0"
|
|
:max="record.receiveQty"
|
|
:max="record.receiveQty"
|
|
placeholder="请输入"
|
|
placeholder="请输入"
|
|
- @blur="e => updateBatchGoodQty(e.target.value, record)"
|
|
|
|
|
|
+ @blur="e => updateGoodQty(e.target.value, record)"
|
|
style="width: 100%;" />
|
|
style="width: 100%;" />
|
|
</template>
|
|
</template>
|
|
<!-- 返库数量 -->
|
|
<!-- 返库数量 -->
|
|
@@ -80,6 +80,9 @@
|
|
@click="handleSubmit()"
|
|
@click="handleSubmit()"
|
|
id="salesReturn-handleSubmit">提交</a-button>
|
|
id="salesReturn-handleSubmit">提交</a-button>
|
|
</div>
|
|
</div>
|
|
|
|
+
|
|
|
|
+ <!-- 选中批量操作 -->
|
|
|
|
+ <chooseTypeModal :openModal="openTypeModal" :type="actionType" @close="openTypeModal=false" @confirm="plconfirm"></chooseTypeModal>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -87,21 +90,23 @@
|
|
import { commonMixin } from '@/utils/mixin'
|
|
import { commonMixin } from '@/utils/mixin'
|
|
import { STable, VSelect } from '@/components'
|
|
import { STable, VSelect } from '@/components'
|
|
import { salesReturnDetail, salesReturnCheck } from '@/api/salesReturn'
|
|
import { salesReturnDetail, salesReturnCheck } from '@/api/salesReturn'
|
|
-import { salesReturnDetailList, salesReturnDetailUpdateBackStockQty, salesReturnDetailUpdateBatchGoodQty } from '@/api/salesReturnDetail'
|
|
|
|
|
|
+import { salesReturnDetailList, updateBatchBackStockQty, updateBatchGoodQty } from '@/api/salesReturnDetail'
|
|
|
|
+import chooseTypeModal from './chooseTypeModal.vue'
|
|
export default {
|
|
export default {
|
|
name: 'SalesReturnCheck',
|
|
name: 'SalesReturnCheck',
|
|
mixins: [commonMixin],
|
|
mixins: [commonMixin],
|
|
components: {
|
|
components: {
|
|
STable,
|
|
STable,
|
|
- VSelect
|
|
|
|
|
|
+ VSelect,
|
|
|
|
+ chooseTypeModal
|
|
},
|
|
},
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
spinning: false,
|
|
spinning: false,
|
|
tableHeight: 0, // 表格高度
|
|
tableHeight: 0, // 表格高度
|
|
- orderId: null,
|
|
|
|
orderSn: null,
|
|
orderSn: null,
|
|
- buyerSn: null,
|
|
|
|
|
|
+ openTypeModal: false,
|
|
|
|
+ actionType: '',
|
|
disabled: false,
|
|
disabled: false,
|
|
isInster: false, // 是否正在添加产品
|
|
isInster: false, // 是否正在添加产品
|
|
ordeDetail: { discountAmount: 0 },
|
|
ordeDetail: { discountAmount: 0 },
|
|
@@ -111,13 +116,17 @@ export default {
|
|
productForm: {
|
|
productForm: {
|
|
salesReturnBillSn: ''
|
|
salesReturnBillSn: ''
|
|
},
|
|
},
|
|
|
|
+ queryParam: {
|
|
|
|
+ productCode: '',
|
|
|
|
+ productName: ''
|
|
|
|
+ },
|
|
chooseLoadData: [],
|
|
chooseLoadData: [],
|
|
// 加载数据方法 必须为 Promise 对象
|
|
// 加载数据方法 必须为 Promise 对象
|
|
loadData: parameter => {
|
|
loadData: parameter => {
|
|
this.disabled = true
|
|
this.disabled = true
|
|
// 查询总计
|
|
// 查询总计
|
|
this.productForm.salesReturnBillSn = this.$route.params.sn
|
|
this.productForm.salesReturnBillSn = this.$route.params.sn
|
|
- return salesReturnDetailList(Object.assign(parameter, this.productForm)).then(res => {
|
|
|
|
|
|
+ return salesReturnDetailList(Object.assign(parameter, this.productForm, this.queryParam)).then(res => {
|
|
let data
|
|
let data
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
data = res.data
|
|
data = res.data
|
|
@@ -135,26 +144,22 @@ export default {
|
|
return data
|
|
return data
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- rowSelectionInfo: null,
|
|
|
|
- queryParam: {
|
|
|
|
- productCode: '',
|
|
|
|
- productName: ''
|
|
|
|
- }
|
|
|
|
|
|
+ rowSelectionInfo: null
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
columns () {
|
|
columns () {
|
|
const arr = [
|
|
const arr = [
|
|
- { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
|
|
|
|
- { title: '产品编码', dataIndex: 'productEntity.code', align: 'center', width: '23%', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '产品名称', dataIndex: 'productEntity.name', width: '25%', align: 'left', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '单位', dataIndex: 'productEntity.unit', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
|
|
+ { title: '序号', dataIndex: 'no', width: '6%', align: 'center' },
|
|
|
|
+ { title: '产品编码', dataIndex: 'productEntity.code', align: 'center', width: '20%', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '产品名称', dataIndex: 'productEntity.name', width: '28%', align: 'left', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '单位', dataIndex: 'productEntity.unit', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '申请退货数量', dataIndex: 'qty', align: 'center', width: '10%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
{ title: '申请退货数量', dataIndex: 'qty', align: 'center', width: '10%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
{ title: '仓库实收数量', dataIndex: 'receiveQty', align: 'center', width: '10%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
{ title: '仓库实收数量', dataIndex: 'receiveQty', align: 'center', width: '10%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
{ title: '坏件数量', dataIndex: 'badQty', align: 'center', width: '10%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
{ title: '坏件数量', dataIndex: 'badQty', align: 'center', width: '10%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
{ title: '良品数量', dataIndex: 'goodQty', width: '10%', align: 'center', scopedSlots: { customRender: 'goodQty' } },
|
|
{ title: '良品数量', dataIndex: 'goodQty', width: '10%', align: 'center', scopedSlots: { customRender: 'goodQty' } },
|
|
{ title: '返库数量', dataIndex: 'backStockQty', width: '10%', align: 'center', scopedSlots: { customRender: 'backStockQty' } },
|
|
{ title: '返库数量', dataIndex: 'backStockQty', width: '10%', align: 'center', scopedSlots: { customRender: 'backStockQty' } },
|
|
- { title: '退货原因', dataIndex: 'returnReasonDictValue', width: '25%', align: 'left', customRender: function (text) { return text || '--' } }
|
|
|
|
|
|
+ { title: '退货原因', dataIndex: 'returnReasonDictValue', width: '20%', align: 'center', customRender: function (text) { return text || '--' } }
|
|
]
|
|
]
|
|
return arr
|
|
return arr
|
|
}
|
|
}
|
|
@@ -169,38 +174,53 @@ export default {
|
|
this.$router.push({ name: 'receiveCheckList' })
|
|
this.$router.push({ name: 'receiveCheckList' })
|
|
},
|
|
},
|
|
// 批量设置
|
|
// 批量设置
|
|
- plSetQty () {
|
|
|
|
|
|
+ plSetQty (type) {
|
|
const _this = this
|
|
const _this = this
|
|
if (!_this.rowSelectionInfo || (_this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys.length < 1)) {
|
|
if (!_this.rowSelectionInfo || (_this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys.length < 1)) {
|
|
_this.$message.warning('请先选择产品!')
|
|
_this.$message.warning('请先选择产品!')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- this.$confirm({
|
|
|
|
- title: '提示',
|
|
|
|
- content: '确认要批量返库吗?',
|
|
|
|
- centered: true,
|
|
|
|
- onOk () {
|
|
|
|
- const obj = []
|
|
|
|
- _this.rowSelectionInfo && _this.rowSelectionInfo.selectedRows.map(item => {
|
|
|
|
- obj.push({
|
|
|
|
- salesReturnDetailSn: item.salesReturnDetailSn,
|
|
|
|
- backStockQty: item.qty
|
|
|
|
- })
|
|
|
|
|
|
+ this.actionType = type
|
|
|
|
+ this.openTypeModal = true
|
|
|
|
+ },
|
|
|
|
+ // 批量修改数量
|
|
|
|
+ plconfirm (val) {
|
|
|
|
+ const _this = this
|
|
|
|
+ const obj = []
|
|
|
|
+ _this.rowSelectionInfo && _this.rowSelectionInfo.selectedRows.map(item => {
|
|
|
|
+ if (this.actionType == 1) {
|
|
|
|
+ obj.push({
|
|
|
|
+ salesReturnDetailSn: item.salesReturnDetailSn,
|
|
|
|
+ goodQty: val == 1 ? item.receiveQty : 0
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ obj.push({
|
|
|
|
+ salesReturnDetailSn: item.salesReturnDetailSn,
|
|
|
|
+ backStockQty: val == 1 ? item.goodQty : 0
|
|
})
|
|
})
|
|
- console.log(obj)
|
|
|
|
- _this.submitCheck(obj)
|
|
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
+ console.log(obj)
|
|
|
|
+ const fun = this.actionType == 1 ? updateBatchGoodQty : updateBatchBackStockQty
|
|
|
|
+ this.spinning = true
|
|
|
|
+ fun(obj).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ this.resetSearchForm(true)
|
|
|
|
+ this.$message.success(res.message)
|
|
|
|
+ }
|
|
|
|
+ this.spinning = false
|
|
|
|
+ this.openTypeModal = false
|
|
|
|
+ })
|
|
},
|
|
},
|
|
// 修改良品数量
|
|
// 修改良品数量
|
|
- updateBatchGoodQty (val, record) {
|
|
|
|
|
|
+ updateGoodQty (val, record) {
|
|
// 光标移出,值发生改变再调用编辑接口
|
|
// 光标移出,值发生改变再调用编辑接口
|
|
if (val && val != record.goodQtyBackups) {
|
|
if (val && val != record.goodQtyBackups) {
|
|
this.spinning = true
|
|
this.spinning = true
|
|
- salesReturnDetailUpdateBatchGoodQty({
|
|
|
|
|
|
+ updateBatchGoodQty([{
|
|
salesReturnDetailSn: record.salesReturnDetailSn,
|
|
salesReturnDetailSn: record.salesReturnDetailSn,
|
|
goodQty: record.goodQty
|
|
goodQty: record.goodQty
|
|
- }).then(res => {
|
|
|
|
|
|
+ }]).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
this.resetSearchForm(true)
|
|
this.resetSearchForm(true)
|
|
this.$message.success(res.message)
|
|
this.$message.success(res.message)
|
|
@@ -219,10 +239,10 @@ export default {
|
|
// 光标移出,值发生改变再调用编辑接口
|
|
// 光标移出,值发生改变再调用编辑接口
|
|
if (val && val != record.backStockQtyBackups) {
|
|
if (val && val != record.backStockQtyBackups) {
|
|
this.spinning = true
|
|
this.spinning = true
|
|
- salesReturnDetailUpdateBackStockQty({
|
|
|
|
|
|
+ updateBatchBackStockQty([{
|
|
salesReturnDetailSn: record.salesReturnDetailSn,
|
|
salesReturnDetailSn: record.salesReturnDetailSn,
|
|
backStockQty: record.backStockQty
|
|
backStockQty: record.backStockQty
|
|
- }).then(res => {
|
|
|
|
|
|
+ }]).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
this.resetSearchForm(true)
|
|
this.resetSearchForm(true)
|
|
this.$message.success(res.message)
|
|
this.$message.success(res.message)
|
|
@@ -245,19 +265,33 @@ export default {
|
|
},
|
|
},
|
|
// 重置
|
|
// 重置
|
|
resetSearchForm (flag) {
|
|
resetSearchForm (flag) {
|
|
|
|
+ this.rowSelectionInfo = null
|
|
|
|
+ this.$refs.table.clearTable()
|
|
|
|
+ this.queryParam = {
|
|
|
|
+ productCode: '',
|
|
|
|
+ productName: ''
|
|
|
|
+ }
|
|
this.$refs.table.refresh(!!flag)
|
|
this.$refs.table.refresh(!!flag)
|
|
- this.getOrderDetail()
|
|
|
|
},
|
|
},
|
|
- // 提交销售单
|
|
|
|
|
|
+ // 提交品检
|
|
handleSubmit () {
|
|
handleSubmit () {
|
|
- this.spinning = true
|
|
|
|
- salesReturnCheck({ salesReturnBillSn: this.orderSn }).then(res => {
|
|
|
|
- if (res.status == 200) {
|
|
|
|
- this.handleBack()
|
|
|
|
- this.$message.success(res.message)
|
|
|
|
- this.spinning = false
|
|
|
|
- } else {
|
|
|
|
- this.spinning = false
|
|
|
|
|
|
+ const _this = this
|
|
|
|
+ this.$confirm({
|
|
|
|
+ title: '提示',
|
|
|
|
+ content: '提交后将无法修改,确认提交吗?',
|
|
|
|
+ centered: true,
|
|
|
|
+ closable: true,
|
|
|
|
+ onOk () {
|
|
|
|
+ _this.spinning = true
|
|
|
|
+ salesReturnCheck({ salesReturnBillSn: _this.orderSn }).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ _this.handleBack()
|
|
|
|
+ _this.$message.success(res.message)
|
|
|
|
+ _this.spinning = false
|
|
|
|
+ } else {
|
|
|
|
+ _this.spinning = false
|
|
|
|
+ }
|
|
|
|
+ })
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
@@ -267,7 +301,6 @@ export default {
|
|
_this.setTableH()
|
|
_this.setTableH()
|
|
})
|
|
})
|
|
this.orderSn = this.$route.params.sn
|
|
this.orderSn = this.$route.params.sn
|
|
- this.buyerSn = this.$route.params.buyerSn
|
|
|
|
this.rowSelectionInfo = null
|
|
this.rowSelectionInfo = null
|
|
this.$refs.table.clearTable()
|
|
this.$refs.table.clearTable()
|
|
this.getOrderDetail()
|
|
this.getOrderDetail()
|