|
@@ -103,7 +103,13 @@
|
|
|
<a-icon style="font-size: 14px;" type="question-circle" />
|
|
|
</a-tooltip>
|
|
|
<span style="margin-left: 10px;" v-if="selectedRowKeys.length">已选 {{ selectedRowKeys.length }} 项</span>
|
|
|
- <a-button @click="showPurchaseModal" type="primary" style="margin-left: 15px" class="button-info" id="dispatch-updateStock">整单转采购单</a-button>
|
|
|
+ <a-button
|
|
|
+ @click="confirPurchaseModal"
|
|
|
+ :loading="loading"
|
|
|
+ type="primary"
|
|
|
+ style="margin-left: 15px"
|
|
|
+ class="button-info"
|
|
|
+ id="dispatch-updateStock">整单转采购单</a-button>
|
|
|
</div>
|
|
|
<div style="padding-left: 20px;">
|
|
|
总销售数量:<strong>{{ detailData&&(detailData.totalQty || detailData.totalQty==0) ? detailData.totalQty : '--' }}</strong>;
|
|
@@ -142,7 +148,7 @@
|
|
|
<!-- 活动规则详情 -->
|
|
|
<detailModal :openModal="openDetailModal" :itemSn="detailSn" @close="closeDetailModal"></detailModal>
|
|
|
<!-- 转采购单 -->
|
|
|
- <toPurchaseModal :openModal="openPurchaseModal" ref="purchaseModal"></toPurchaseModal>
|
|
|
+ <toPurchaseModal :openModal="openPurchaseModal" @ok="showLockStockQty = true" @close="openPurchaseModal=false" ref="purchaseModal"></toPurchaseModal>
|
|
|
</a-spin>
|
|
|
|
|
|
</div>
|
|
@@ -157,7 +163,7 @@ import toPurchaseModal from './toPurchaseModal'
|
|
|
import chooseWarehouse from '@/views/common/chooseWarehouse'
|
|
|
// 接口
|
|
|
import { salesDetailAllList, salesPromoDetailCount, salesDetaiCount } from '@/api/salesDetailNew'
|
|
|
-import { salesPromoQueryList } from '@/api/salesNew'
|
|
|
+import { salesPromoQueryList, getCreatePurchaseFlag } from '@/api/salesNew'
|
|
|
|
|
|
export default {
|
|
|
name: 'QueryPart',
|
|
@@ -179,6 +185,7 @@ export default {
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
+ loading: false,
|
|
|
advanced: true, // 高级搜索 展开/关闭
|
|
|
openDetailModal: false, // 活动规则详情弹框
|
|
|
openPurchaseModal: false, // 转采购单弹框
|
|
@@ -226,7 +233,8 @@ export default {
|
|
|
disableSelectedRowKeys: [], // 禁用数据
|
|
|
selectedRowKeys: [], // 已选数据
|
|
|
colspanNums: 16, // 列合并数量
|
|
|
- hasNormalProduct: false // 是否有正常产品
|
|
|
+ hasNormalProduct: false, // 是否有正常产品
|
|
|
+ showLockStockQty: false // 是否显示锁定库存列
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -418,7 +426,12 @@ export default {
|
|
|
this.colspanNums = this.colspanNums + 8
|
|
|
arr = arr.concat([
|
|
|
{ title: '单位', field: 'productOrigUnit', key: 'i', width: 80, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
|
|
|
- { title: '可用库存', field: 'stockQty', width: 80, key: 'j', align: 'center', fixed: 'right', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } },
|
|
|
+ { title: '可用库存', field: 'stockQty', width: 80, key: 'j', align: 'center', fixed: 'right', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } }
|
|
|
+ ])
|
|
|
+ if (this.showLockStockQty) {
|
|
|
+ arr.push({ title: '锁定库存', field: 'lockStockQty', width: 80, key: 'jk', align: 'center', fixed: 'right', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } })
|
|
|
+ }
|
|
|
+ arr = arr.concat([
|
|
|
{ title: '销售数量', field: 'qty', width: 80, key: 'k', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } },
|
|
|
{ title: '已取消', field: 'cancelQty', width: 80, key: 'o', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } },
|
|
|
{ title: '已下推', field: 'pushedQty', width: 80, key: 'p', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } },
|
|
@@ -637,6 +650,8 @@ export default {
|
|
|
this.detailData = detailData
|
|
|
// 获取活动列表
|
|
|
this.getActiveList()
|
|
|
+ // 是否转过采购单
|
|
|
+ this.hasCreatePurchaseFlag()
|
|
|
},
|
|
|
// 清空选项
|
|
|
clearSelectTable () {
|
|
@@ -760,10 +775,41 @@ export default {
|
|
|
|
|
|
this.$emit('cancelProduct', obj)
|
|
|
},
|
|
|
- // 打开整单转采购单
|
|
|
+ // 确认整单转采购单
|
|
|
+ confirPurchaseModal () {
|
|
|
+ this.loading = true
|
|
|
+ getCreatePurchaseFlag({ salesBillSn: this.salesBillSn }).then(res => {
|
|
|
+ if (res.status == '200') {
|
|
|
+ // 没有转过
|
|
|
+ if (res.data == 0) {
|
|
|
+ this.showPurchaseModal()
|
|
|
+ } else {
|
|
|
+ // 转过,弹确认框
|
|
|
+ const _this = this
|
|
|
+ this.$confirm({
|
|
|
+ title: '提示',
|
|
|
+ content: '已转过采购单,是否再次转单?',
|
|
|
+ centered: true,
|
|
|
+ closable: true,
|
|
|
+ onOk () {
|
|
|
+ _this.showPurchaseModal()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 打开转采购单弹框
|
|
|
showPurchaseModal () {
|
|
|
this.openPurchaseModal = true
|
|
|
this.$refs.purchaseModal.setDetail(this.detailData)
|
|
|
+ },
|
|
|
+ // 是否转过采购单
|
|
|
+ hasCreatePurchaseFlag () {
|
|
|
+ getCreatePurchaseFlag({ salesBillSn: this.salesBillSn }).then(res => {
|
|
|
+ this.showLockStockQty = res.data && res.data == 1
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|