|
@@ -70,6 +70,7 @@
|
|
|
<div style="margin-bottom: 10px;display: flex;align-items: center;" v-if="detailData">
|
|
|
<div style="display: flex;align-items: center;">
|
|
|
<a-button type="primary" :disabled="newLoading" class="button-info" @click="handlePlAdd">批量添加</a-button>
|
|
|
+ <a-button type="primary" :disabled="newLoading" class="button-info" @click="handlePlPurchase">批量转采购额</a-button>
|
|
|
<a-button type="primary" v-if="hasNormalProduct" ghost style="margin-left:6px;" :disabled="newLoading" @click="handlePlCancel">批量取消</a-button>
|
|
|
<a-button 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;">
|
|
@@ -91,6 +92,7 @@
|
|
|
<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">促销产品转采购额金额:<strong>{{ toThousands(detailData.totalConvertPromoGiftsAmount) }}</strong>;</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
@@ -206,6 +208,9 @@ export default {
|
|
|
hasNoPushedActive(){
|
|
|
return this.detailData&&this.detailData.totalPushedQty==0||!this.detailData.totalPushedQty
|
|
|
},
|
|
|
+ hasConvertPromoGifts(){
|
|
|
+ return this.detailData&&this.detailData.totalConvertPromoGiftsAmount > 0
|
|
|
+ },
|
|
|
checkboxOption () {
|
|
|
return {
|
|
|
disableSelectedRowKeys: this.disableSelectedRowKeys,
|
|
@@ -255,7 +260,7 @@ export default {
|
|
|
</div>
|
|
|
)
|
|
|
}
|
|
|
- // 输入框
|
|
|
+ // 取消数量输入框
|
|
|
const inputFormat = function(record,data,h) {
|
|
|
if(record.unpushedQty>0){
|
|
|
return (
|
|
@@ -274,6 +279,30 @@ export default {
|
|
|
}
|
|
|
return '--'
|
|
|
}
|
|
|
+ // 转采购额数量输入框
|
|
|
+ const inputFormat1 = function(record,data,h) {
|
|
|
+ if(record.unpushedQty>0){
|
|
|
+ // 已选
|
|
|
+ if(_this.selectedRowKeys.includes(record.id)){
|
|
|
+ return (
|
|
|
+ <div>
|
|
|
+ <a-input-number
|
|
|
+ size="small"
|
|
|
+ value={record.convertPromoGiftsQty}
|
|
|
+ onChange={e => _this.convertPromoGiftsChange(e,record)}
|
|
|
+ precision={0}
|
|
|
+ min={0}
|
|
|
+ max={record.unpushedQty}
|
|
|
+ style="width: 100%;"
|
|
|
+ placeholder="请输入" />
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+ }else{
|
|
|
+ return record.convertPromoGiftsQty || 0
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return '--'
|
|
|
+ }
|
|
|
// 操作按钮
|
|
|
const actionFormat = function(record,data,h) {
|
|
|
if(record.unpushedQty>0){
|
|
@@ -312,6 +341,7 @@ export default {
|
|
|
{_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.total&&record.total.lossAmount ? (<span>优惠金额:<strong>{record.total.lossAmount}</strong>;</span>):('')}
|
|
|
{_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.total&&record.total.cgejyAmount>0 ? (<span>采购额结余:<strong>{_this.toThousands(record.total.cgejyAmount)}</strong>;</span>):('')}
|
|
|
{_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.total&&record.total.cgejyAmount<0 ? (<span>采购额超出:<strong>{_this.toThousands(record.total.cgeccAmount)}</strong>;</span>):('')}
|
|
|
+ {_this.$hasPermissions('B_salesEdit_salesPrice') ? (<span>促销产品转采购额金额:<strong>{record.total&&record.total.convertPromoGiftsAmount||'--'}</strong>;</span>):('')}
|
|
|
{record.expenseAccountFlag!='WAIT' ? record.expenseAccountFlagDictValue : ''}
|
|
|
</div>
|
|
|
</div>
|
|
@@ -346,8 +376,13 @@ export default {
|
|
|
{ title: '已下推', field: 'pushedQty', width: 80,key: "p", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field])} },
|
|
|
{ title: '待下推', field: 'unpushedQty', width: 80,key: "q", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field])} },
|
|
|
{ title: '取消数量', field: 'cancelNums', width: 80,key: "r", align: 'center',fixed: 'right',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return inputFormat(row,row[column.field],h)} },
|
|
|
- { title: '操作', field: 'action', width: 80,key: "s", align: 'center',fixed: 'right',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return actionFormat(row,row[column.field],h)} },
|
|
|
])
|
|
|
+ if(this.hasConvertPromoGifts){
|
|
|
+ arr.push({ title: '转采购额数量', field: 'convertPromoGiftsQty', width: 80,key: "r", align: 'center',fixed: 'right',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => {
|
|
|
+ return inputFormat1(row,row[column.field],h)
|
|
|
+ } })
|
|
|
+ }
|
|
|
+ arr.push({ title: '操作', field: 'action', width: 80,key: "s", align: 'center',fixed: 'right',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return actionFormat(row,row[column.field],h)} })
|
|
|
|
|
|
return arr
|
|
|
}
|
|
@@ -383,6 +418,10 @@ export default {
|
|
|
record.cancelNums = v
|
|
|
this.dataSource.splice()
|
|
|
},
|
|
|
+ convertPromoGiftsChange(v,record){
|
|
|
+ record.convertPromoGiftsQty = v
|
|
|
+ this.dataSource.splice()
|
|
|
+ },
|
|
|
// 选择单元格
|
|
|
selectedRowChange({ row, isSelected, selectedRowKeys }){
|
|
|
// console.log(row, isSelected, selectedRowKeys);
|
|
@@ -534,6 +573,41 @@ export default {
|
|
|
this.$message.warning('库存为0,不可添加!')
|
|
|
}
|
|
|
},
|
|
|
+ // 批量转采购额
|
|
|
+ handlePlPurchase(){
|
|
|
+ const _this = this
|
|
|
+ const chooseList = this.selectedRowKeys
|
|
|
+ if (chooseList.length == 0) {
|
|
|
+ _this.$message.warning('请先选择产品!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const chooseRow = this.dataSource.filter(item => chooseList.includes(item.id) && item.convertPromoGiftsFlag==1)
|
|
|
+ const noChooseRow = this.dataSource.filter(item => chooseList.includes(item.id) && item.convertPromoGiftsFlag==0)
|
|
|
+ const obj = []
|
|
|
+ const noObj = []
|
|
|
+ chooseRow && chooseRow.map(item => {
|
|
|
+ obj.push(item.salesBillDetailSn)
|
|
|
+ })
|
|
|
+ noChooseRow && noChooseRow.map(item => {
|
|
|
+ noObj.push(item.productCode)
|
|
|
+ })
|
|
|
+
|
|
|
+ if(obj.length){
|
|
|
+ this.$confirm({
|
|
|
+ title: '提示',
|
|
|
+ content: <div><div style="text-align:center;padding:10px 0;font-weight:bold;">确定将选中的促销产品转成采购额吗?</div><div style="font-size:12px;color:#999;padding:10px 0;">
|
|
|
+当该销售单完结后,可将采购额转成费用报销单。</div>{noObj.length?<div><div>总共选择了 {chooseList.length} 个产品,其中 {obj.length} 个产品可转采购额。</div><div> 产品 ({noObj.toString()}) 不可转采购额!</div></div>:''}</div>,
|
|
|
+ centered: true,
|
|
|
+ closable: true,
|
|
|
+ class: 'confirm-center',
|
|
|
+ onOk () {
|
|
|
+ _this.$emit('convertPromoGifts', obj)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ _this.$message.warning('所选产品都不可转采购额!')
|
|
|
+ }
|
|
|
+ },
|
|
|
// 批量添加
|
|
|
handlePlAdd () {
|
|
|
const _this = this
|