|
@@ -70,62 +70,71 @@
|
|
|
</div>
|
|
|
|
|
|
<!-- alert -->
|
|
|
- <div style="margin-bottom: 10px;display: flex;align-items: center;" v-if="detailData">
|
|
|
- <div style="display: flex;align-items: center;">
|
|
|
- <a-button id="dispatch-plAdd" type="primary" :disabled="newLoading" class="button-info" @click="handlePlAdd">批量添加</a-button>
|
|
|
- <a-button
|
|
|
- id="dispatch-plPurchase"
|
|
|
- type="primary"
|
|
|
- :disabled="newLoading"
|
|
|
- class="button-info"
|
|
|
- v-if="showConvertPromoGifts"
|
|
|
- @click="handlePlPurchase">批量转采购额</a-button>
|
|
|
- <a-button
|
|
|
- id="dispatch-plCancel"
|
|
|
- type="primary"
|
|
|
- v-if="hasNormalProduct"
|
|
|
- ghost
|
|
|
- style="margin-left:6px;"
|
|
|
- :disabled="newLoading"
|
|
|
- @click="handlePlCancel">批量取消</a-button>
|
|
|
- <a-button
|
|
|
- id="dispatch-cancelAll"
|
|
|
- type="primary"
|
|
|
- v-if="hasPrompActive&&hasNoPushedActive"
|
|
|
- ghost
|
|
|
- style="margin-left:6px;"
|
|
|
- :disabled="newLoading"
|
|
|
- @click="handleAllCancel">整单取消</a-button>
|
|
|
- <a-tooltip placement="top" v-if="hasPrompActive&&hasNoPushedActive" style="margin-left:6px;">
|
|
|
- <template slot="title">
|
|
|
- <span>参加促销活动的产品,不能单独取消,只能整单取消。</span>
|
|
|
- </template>
|
|
|
- <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="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>;
|
|
|
- 已取消数量:<strong>{{ detailData&&(detailData.totalCancelQty || detailData.totalCancelQty==0) ? detailData.totalCancelQty : '--' }}</strong>;
|
|
|
- 已下推数量:<strong>{{ detailData&&(detailData.totalPushedQty || detailData.totalPushedQty==0) ? detailData.totalPushedQty : '--' }}</strong>;
|
|
|
- 待下推数量:<strong>{{ detailData&&(detailData.totalUnpushedQty || detailData.totalUnpushedQty==0) ? detailData.totalUnpushedQty : '--' }}</strong>;
|
|
|
- <span v-if="$hasPermissions('B_salesDispatch_salesPrice')">总售价:<strong>{{ detailData&&(detailData.totalAmount || detailData.totalAmount==0) ? toThousands(detailData.totalAmount) : '--' }}</strong>;</span>
|
|
|
- <span v-if="$hasPermissions('B_salesDispatch_costPrice')">总成本:<strong>{{ detailData&&(detailData.totalCost || detailData.totalCost==0) ? toThousands(detailData.totalCost) : '--' }}</strong>;</span>
|
|
|
- <span v-if="$hasPermissions('B_salesDispatch_costPrice')&&$hasPermissions('B_salesDispatch_salesPrice')">总毛利:<strong>{{ detailData&&(detailData.grossProfit || detailData.grossProfit==0) ? toThousands(detailData.grossProfit) : '--' }}</strong>;</span>
|
|
|
- <span v-if="$hasPermissions('B_salesDispatch_salesPrice')">已取消金额:<strong>{{ detailData&&(detailData.totalCancelAmount || detailData.totalCancelAmount==0) ? toThousands(detailData.totalCancelAmount) : '--' }}</strong>;</span>
|
|
|
- <span v-if="$hasPermissions('B_salesDispatch_salesPrice')">已下推金额:<strong>{{ detailData&&(detailData.totalPushedAmount || detailData.totalPushedAmount==0) ? toThousands(detailData.totalPushedAmount) :'--' }}</strong>;</span>
|
|
|
- <span v-if="$hasPermissions('B_salesDispatch_salesPrice')">待下推金额:<strong>{{ detailData&&(detailData.totalUnpushedAmount || detailData.totalUnpushedAmount==0) ? toThousands(detailData.totalUnpushedAmount) : '--' }}</strong>;</span>
|
|
|
- <span v-if="$hasPermissions('B_salesDispatch_salesPrice')&&detailData&&detailData.totalConvertPromoGiftsAmount" style="color:red;">促销产品转采购额金额:<strong>{{ toThousands(detailData.totalConvertPromoGiftsAmount) }}</strong>;</span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <div style="display: flex;align-items: center;">
|
|
|
+ <span v-if="selectedRowKeys.length">已选 {{ selectedRowKeys.length }} 项</span>
|
|
|
+ <a-button id="dispatch-plAdd" type="primary" :disabled="newLoading" class="button-info" @click="handlePlAdd">批量添加</a-button>
|
|
|
+ <a-button
|
|
|
+ id="dispatch-plPurchase"
|
|
|
+ type="primary"
|
|
|
+ :disabled="newLoading"
|
|
|
+ class="button-info"
|
|
|
+ v-if="showConvertPromoGifts"
|
|
|
+ @click="handlePlPurchase">批量转采购额</a-button>
|
|
|
+ <a-button
|
|
|
+ id="dispatch-plCancel"
|
|
|
+ type="primary"
|
|
|
+ v-if="hasNormalProduct"
|
|
|
+ ghost
|
|
|
+ style="margin-left:6px;"
|
|
|
+ :disabled="newLoading"
|
|
|
+ @click="handlePlCancel">批量取消</a-button>
|
|
|
|
|
|
+ <a-button
|
|
|
+ id="dispatch-cancelAll"
|
|
|
+ type="primary"
|
|
|
+ v-if="hasPrompActive&&hasNoPushedActive"
|
|
|
+ ghost
|
|
|
+ style="margin-left:6px;"
|
|
|
+ :disabled="newLoading"
|
|
|
+ @click="handleAllCancel">整单取消</a-button>
|
|
|
+ <a-tooltip placement="top" v-if="hasPrompActive&&hasNoPushedActive" style="margin-left:6px;">
|
|
|
+ <template slot="title">
|
|
|
+ <span>参加促销活动的产品,不能单独取消,只能整单取消。</span>
|
|
|
+ </template>
|
|
|
+ <a-icon style="font-size: 14px;" type="question-circle" />
|
|
|
+ </a-tooltip>
|
|
|
+ <v-select
|
|
|
+ v-if="hasJGtire"
|
|
|
+ :disabled="stockDisabled"
|
|
|
+ style="margin-left: 15px;width:150px;"
|
|
|
+ v-model="stockType"
|
|
|
+ id="dispatch-stockType"
|
|
|
+ code="TIRE_STOCK_TYPE"
|
|
|
+ placeholder="请选择库存类型"
|
|
|
+ @change="stockTypeChange"
|
|
|
+ ></v-select>
|
|
|
+ <a-button
|
|
|
+ v-if="hasJGtire && stockType=='LOCK_STOCK'"
|
|
|
+ @click="confirPurchaseModal"
|
|
|
+ :loading="loading"
|
|
|
+ type="primary"
|
|
|
+ style="margin-left: 6px"
|
|
|
+ class="button-info"
|
|
|
+ id="dispatch-updateStock">轮胎转采购单</a-button>
|
|
|
+ </div>
|
|
|
+ <div style="padding:10px 0;" v-if="detailData">
|
|
|
+ 总销售数量:<strong>{{ detailData&&(detailData.totalQty || detailData.totalQty==0) ? detailData.totalQty : '--' }}</strong>;
|
|
|
+ 已取消数量:<strong>{{ detailData&&(detailData.totalCancelQty || detailData.totalCancelQty==0) ? detailData.totalCancelQty : '--' }}</strong>;
|
|
|
+ 已下推数量:<strong>{{ detailData&&(detailData.totalPushedQty || detailData.totalPushedQty==0) ? detailData.totalPushedQty : '--' }}</strong>;
|
|
|
+ 待下推数量:<strong>{{ detailData&&(detailData.totalUnpushedQty || detailData.totalUnpushedQty==0) ? detailData.totalUnpushedQty : '--' }}</strong>;
|
|
|
+ <span v-if="$hasPermissions('B_salesDispatch_salesPrice')">总售价:<strong>{{ detailData&&(detailData.totalAmount || detailData.totalAmount==0) ? toThousands(detailData.totalAmount) : '--' }}</strong>;</span>
|
|
|
+ <span v-if="$hasPermissions('B_salesDispatch_costPrice')">总成本:<strong>{{ detailData&&(detailData.totalCost || detailData.totalCost==0) ? toThousands(detailData.totalCost) : '--' }}</strong>;</span>
|
|
|
+ <span v-if="$hasPermissions('B_salesDispatch_costPrice')&&$hasPermissions('B_salesDispatch_salesPrice')">总毛利:<strong>{{ detailData&&(detailData.grossProfit || detailData.grossProfit==0) ? toThousands(detailData.grossProfit) : '--' }}</strong>;</span>
|
|
|
+ <span v-if="$hasPermissions('B_salesDispatch_salesPrice')">已取消金额:<strong>{{ detailData&&(detailData.totalCancelAmount || detailData.totalCancelAmount==0) ? toThousands(detailData.totalCancelAmount) : '--' }}</strong>;</span>
|
|
|
+ <span v-if="$hasPermissions('B_salesDispatch_salesPrice')">已下推金额:<strong>{{ detailData&&(detailData.totalPushedAmount || detailData.totalPushedAmount==0) ? toThousands(detailData.totalPushedAmount) :'--' }}</strong>;</span>
|
|
|
+ <span v-if="$hasPermissions('B_salesDispatch_salesPrice')">待下推金额:<strong>{{ detailData&&(detailData.totalUnpushedAmount || detailData.totalUnpushedAmount==0) ? toThousands(detailData.totalUnpushedAmount) : '--' }}</strong>;</span>
|
|
|
+ <span v-if="$hasPermissions('B_salesDispatch_salesPrice')&&detailData&&detailData.totalConvertPromoGiftsAmount" style="color:red;">促销产品转采购额金额:<strong>{{ toThousands(detailData.totalConvertPromoGiftsAmount) }}</strong>;</span>
|
|
|
+ </div>
|
|
|
<a-spin :spinning="spinning" tip="Loading...">
|
|
|
<ve-table
|
|
|
border-y
|
|
@@ -234,7 +243,10 @@ export default {
|
|
|
selectedRowKeys: [], // 已选数据
|
|
|
colspanNums: 16, // 列合并数量
|
|
|
hasNormalProduct: false, // 是否有正常产品
|
|
|
- showLockStockQty: false // 是否显示锁定库存列
|
|
|
+ showLockStockQty: false, // 是否显示锁定库存列
|
|
|
+ stockType: undefined, // 默认锁定库存
|
|
|
+ hasJGtire: false, // 是否轮胎产品
|
|
|
+ stockDisabled: false
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -524,6 +536,10 @@ export default {
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
+ // 修改库存类型
|
|
|
+ stockTypeChange (val) {
|
|
|
+ this.$emit('updateStockType', val)
|
|
|
+ },
|
|
|
// 查询列表
|
|
|
async searchTable () {
|
|
|
this.selectedRowKeys = []
|
|
@@ -602,6 +618,8 @@ export default {
|
|
|
const productName = (item.productEntity && item.productEntity.name) || (item.dealerProductEntity && item.dealerProductEntity.name)
|
|
|
const productOrigCode = (item.productEntity && item.productEntity.origCode) || (item.dealerProductEntity && item.dealerProductEntity.origCode)
|
|
|
const productOrigUnit = (item.productEntity && item.productEntity.unit) || (item.dealerProductEntity && item.dealerProductEntity.unit)
|
|
|
+ const productBrand = (item.productEntity && item.productEntity.productBrandName) || (item.dealerProductEntity && item.dealerProductEntity.productBrandName)
|
|
|
+ const productType3 = (item.productEntity && item.productEntity.productTypeName3) || (item.dealerProductEntity && item.dealerProductEntity.productTypeName3)
|
|
|
item.productCode = productCode || '--'
|
|
|
item.productName = productName || '--'
|
|
|
item.productOrigCode = productOrigCode == ' ' ? '--' : productOrigCode
|
|
@@ -613,6 +631,13 @@ export default {
|
|
|
} else {
|
|
|
item.maxConvertNums = 0
|
|
|
}
|
|
|
+
|
|
|
+ // 判断是否有箭冠轮胎产品
|
|
|
+ if (productBrand && productBrand.indexOf('箭冠') >= 0 && productBrand && productType3.indexOf('轮胎') >= 0 && !this.stockType) {
|
|
|
+ this.hasJGtire = true
|
|
|
+ this.stockType = 'LOCK_STOCK'
|
|
|
+ }
|
|
|
+
|
|
|
// 转采购额数量
|
|
|
item.bakConvertPromoGiftsQty = item.convertPromoGiftsQty
|
|
|
|