|
@@ -72,6 +72,7 @@
|
|
<!-- alert -->
|
|
<!-- alert -->
|
|
<div style="margin-bottom: 10px;display: flex;align-items: center;" v-if="detailData">
|
|
<div style="margin-bottom: 10px;display: flex;align-items: center;" v-if="detailData">
|
|
<div style="display: flex;align-items: center;">
|
|
<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-plAdd" type="primary" :disabled="newLoading" class="button-info" @click="handlePlAdd">批量添加</a-button>
|
|
<a-button
|
|
<a-button
|
|
id="dispatch-plPurchase"
|
|
id="dispatch-plPurchase"
|
|
@@ -102,14 +103,25 @@
|
|
</template>
|
|
</template>
|
|
<a-icon style="font-size: 14px;" type="question-circle" />
|
|
<a-icon style="font-size: 14px;" type="question-circle" />
|
|
</a-tooltip>
|
|
</a-tooltip>
|
|
- <span style="margin-left: 10px;" v-if="selectedRowKeys.length">已选 {{ selectedRowKeys.length }} 项</span>
|
|
|
|
|
|
+ <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
|
|
<a-button
|
|
|
|
+ v-if="hasJGtire && stockType=='LOCK_STOCK'"
|
|
@click="confirPurchaseModal"
|
|
@click="confirPurchaseModal"
|
|
:loading="loading"
|
|
:loading="loading"
|
|
type="primary"
|
|
type="primary"
|
|
- style="margin-left: 15px"
|
|
|
|
|
|
+ style="margin-left: 6px"
|
|
class="button-info"
|
|
class="button-info"
|
|
- id="dispatch-updateStock">整单转采购单</a-button>
|
|
|
|
|
|
+ id="dispatch-updateStock">轮胎转采购单</a-button>
|
|
|
|
+
|
|
</div>
|
|
</div>
|
|
<div style="padding-left: 20px;">
|
|
<div style="padding-left: 20px;">
|
|
总销售数量:<strong>{{ detailData&&(detailData.totalQty || detailData.totalQty==0) ? detailData.totalQty : '--' }}</strong>;
|
|
总销售数量:<strong>{{ detailData&&(detailData.totalQty || detailData.totalQty==0) ? detailData.totalQty : '--' }}</strong>;
|
|
@@ -236,7 +248,10 @@ export default {
|
|
selectedRowKeys: [], // 已选数据
|
|
selectedRowKeys: [], // 已选数据
|
|
colspanNums: 16, // 列合并数量
|
|
colspanNums: 16, // 列合并数量
|
|
hasNormalProduct: false, // 是否有正常产品
|
|
hasNormalProduct: false, // 是否有正常产品
|
|
- showLockStockQty: false // 是否显示锁定库存列
|
|
|
|
|
|
+ showLockStockQty: false, // 是否显示锁定库存列
|
|
|
|
+ stockType: undefined, // 默认锁定库存
|
|
|
|
+ hasJGtire: false, // 是否轮胎产品
|
|
|
|
+ stockDisabled: false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -573,6 +588,18 @@ export default {
|
|
} else {
|
|
} else {
|
|
item.maxConvertNums = 0
|
|
item.maxConvertNums = 0
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ const productBrand = (item.productEntity && item.productEntity.productBrandName) || (item.dealerProductEntity && item.dealerProductEntity.productBrandName)
|
|
|
|
+ const productType3 = (item.productEntity && item.productEntity.productTypeName3) || (item.dealerProductEntity && item.dealerProductEntity.productTypeName3)
|
|
|
|
+ // 判断是否有箭冠轮胎产品
|
|
|
|
+ if (productBrand && productBrand.indexOf('箭冠') >= 0 && productBrand && productType3.indexOf('轮胎') >= 0) {
|
|
|
|
+ this.hasJGtire = true
|
|
|
|
+ // 默认锁定库存类型
|
|
|
|
+ if (!this.stockType) {
|
|
|
|
+ this.stockType = 'LOCK_STOCK'
|
|
|
|
+ this.stockTypeChange('LOCK_STOCK')
|
|
|
|
+ }
|
|
|
|
+ }
|
|
// 转采购额数量
|
|
// 转采购额数量
|
|
item.bakConvertPromoGiftsQty = item.convertPromoGiftsQty
|
|
item.bakConvertPromoGiftsQty = item.convertPromoGiftsQty
|
|
|
|
|
|
@@ -618,15 +645,22 @@ export default {
|
|
clearSelectTable () {
|
|
clearSelectTable () {
|
|
this.selectedRowKeys = []
|
|
this.selectedRowKeys = []
|
|
},
|
|
},
|
|
|
|
+ // 修改库存类型
|
|
|
|
+ stockTypeChange (val) {
|
|
|
|
+ this.$emit('updateStockType', val)
|
|
|
|
+ },
|
|
// 添加
|
|
// 添加
|
|
handleAdd (row) {
|
|
handleAdd (row) {
|
|
- if (row && row.productEntity && row.productEntity.productBrandName == '箭冠' && row.productEntity.productTypeName3 == '轮胎') {
|
|
|
|
|
|
+ const isLt = row && row.productEntity && row.productEntity.productBrandName == '箭冠' && row.productEntity.productTypeName3 == '轮胎'
|
|
|
|
+ // 如果库存类型是锁定库存 且 轮胎产品
|
|
|
|
+ if (this.stockType && this.stockType == 'LOCK_STOCK' && isLt) {
|
|
if (!row.lockStockQty) {
|
|
if (!row.lockStockQty) {
|
|
this.$message.warning('锁定库存为0,不可添加!')
|
|
this.$message.warning('锁定库存为0,不可添加!')
|
|
} else {
|
|
} else {
|
|
this.$emit('addProduct', [row.salesBillDetailSn])
|
|
this.$emit('addProduct', [row.salesBillDetailSn])
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
|
|
+ // 库存类型可用库存或非轮胎产品
|
|
if (row.stockQty > 0) { // 可用库存大于0才可添加
|
|
if (row.stockQty > 0) { // 可用库存大于0才可添加
|
|
this.$emit('addProduct', [row.salesBillDetailSn])
|
|
this.$emit('addProduct', [row.salesBillDetailSn])
|
|
} else {
|
|
} else {
|
|
@@ -681,10 +715,18 @@ export default {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
- // 库存为0的产品,不包括箭冠轮胎产品
|
|
|
|
- const noStockRow = this.dataSource.filter(item => chooseList.includes(item.id) && !item.stockQty && item.productEntity && item.productEntity.productBrandName != '箭冠' && item.productEntity.productTypeName3 != '轮胎')
|
|
|
|
- // 锁定库存为0的产品,只判断箭冠轮胎产品
|
|
|
|
- const noLockStockRow = this.dataSource.filter(item => chooseList.includes(item.id) && item.productEntity && item.productEntity.productBrandName == '箭冠' && item.productEntity.productTypeName3 == '轮胎' && !item.lockStockQty)
|
|
|
|
|
|
+ let noStockRow = []
|
|
|
|
+ let noLockStockRow = []
|
|
|
|
+ // 库存类型是 锁定库存
|
|
|
|
+ if (this.stockType && this.stockType == 'LOCK_STOCK') {
|
|
|
|
+ // 库存为0的产品,不包括箭冠轮胎产品
|
|
|
|
+ noStockRow = this.dataSource.filter(item => chooseList.includes(item.id) && !item.stockQty && item.productEntity && item.productEntity.productBrandName != '箭冠' && item.productEntity.productTypeName3 != '轮胎')
|
|
|
|
+ // 锁定库存为0的产品,只判断箭冠轮胎产品
|
|
|
|
+ noLockStockRow = this.dataSource.filter(item => chooseList.includes(item.id) && item.productEntity && item.productEntity.productBrandName == '箭冠' && item.productEntity.productTypeName3 == '轮胎' && !item.lockStockQty)
|
|
|
|
+ } else {
|
|
|
|
+ // 库存类型是 可用库存
|
|
|
|
+ noStockRow = this.dataSource.filter(item => chooseList.includes(item.id) && !item.stockQty)
|
|
|
|
+ }
|
|
|
|
|
|
// 库存为0产品编码列表
|
|
// 库存为0产品编码列表
|
|
const noObj = []
|
|
const noObj = []
|