|
@@ -94,23 +94,7 @@
|
|
</a-row>
|
|
</a-row>
|
|
</a-form-model>
|
|
</a-form-model>
|
|
</div>
|
|
</div>
|
|
- <div class="discount-box">
|
|
|
|
- <div>
|
|
|
|
- 折扣金额:
|
|
|
|
- <a-input-number
|
|
|
|
- id="discount"
|
|
|
|
- size="small"
|
|
|
|
- v-model.trim="detailData.discountAmount"
|
|
|
|
- :min="0"
|
|
|
|
- :precision="2"
|
|
|
|
- :max="999999"/>
|
|
|
|
- <a-button size="small" type="primary" class="button-primary" @click="salesDiscount">打折</a-button>
|
|
|
|
- </div>
|
|
|
|
- <div style="padding:0 10px;">
|
|
|
|
- 折扣:<strong>{{ detailData&&(detailData.discountRate || detailData.discountRate==0) ? detailData.discountRate+'%' : '--' }}</strong>;
|
|
|
|
- 折后总售价:<strong>{{ detailData&&(detailData.discountedAmount || detailData.discountedAmount==0) ? toThousands(detailData.discountedAmount) : '--' }}</strong>;
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
|
|
+
|
|
<!-- 已选配件列表 -->
|
|
<!-- 已选配件列表 -->
|
|
<s-table
|
|
<s-table
|
|
class="sTable"
|
|
class="sTable"
|
|
@@ -227,21 +211,33 @@
|
|
<!-- 总计 -->
|
|
<!-- 总计 -->
|
|
<div v-if="detailData" class="total-bar">
|
|
<div v-if="detailData" class="total-bar">
|
|
<div>
|
|
<div>
|
|
|
|
+ <div style="display: inline-block;">
|
|
|
|
+ 折扣金额:
|
|
|
|
+ <a-input-number
|
|
|
|
+ id="discount"
|
|
|
|
+ size="small"
|
|
|
|
+ v-model.trim="detailData.discountAmount"
|
|
|
|
+ @blur="salesDiscount"
|
|
|
|
+ :min="0"
|
|
|
|
+ :precision="2"
|
|
|
|
+ :max="999999"/>
|
|
|
|
+ 折扣:<span class="red">{{ detailData&&(detailData.discountRate || detailData.discountRate==0) ? detailData.discountRate+'%' : '--' }}</span>,
|
|
|
|
+ </div>
|
|
<div style="display: inline-block;">
|
|
<div style="display: inline-block;">
|
|
<span>共计 {{ detailData&&(detailData.totalCategory || detailData.totalCategory==0) ? detailData.totalCategory : '--' }} 款</span>
|
|
<span>共计 {{ detailData&&(detailData.totalCategory || detailData.totalCategory==0) ? detailData.totalCategory : '--' }} 款</span>
|
|
- <span> {{ detailData&&(detailData.totalQty || detailData.totalQty==0) ? detailData.totalQty : '--' }} 件产品,</span>
|
|
|
|
- 赠品总数量:<span class="red">{{ detailData&&(detailData.giftQty || detailData.giftQty==0) ? detailData.giftQty : '--' }}</span>,
|
|
|
|
|
|
+ <span> {{ detailData&&(detailData.totalQty || detailData.totalQty==0) ? detailData.totalQty : '--' }} 件产品</span>
|
|
|
|
+ <span>(赠品 {{ detailData&&(detailData.giftQty || detailData.giftQty==0) ? detailData.giftQty : '--' }} 件)</span>,
|
|
<template v-if="isCosts">
|
|
<template v-if="isCosts">
|
|
总成本价:<span class="red">{{ detailData&&(detailData.totalCost || detailData.totalCost==0) ? toThousands(detailData.totalCost) : '--' }}</span>,
|
|
总成本价:<span class="red">{{ detailData&&(detailData.totalCost || detailData.totalCost==0) ? toThousands(detailData.totalCost) : '--' }}</span>,
|
|
毛利:<span class="red">{{ detailData&&(detailData.grossProfit || detailData.grossProfit==0) ? toThousands(detailData.grossProfit) : '--' }}</span>,
|
|
毛利:<span class="red">{{ detailData&&(detailData.grossProfit || detailData.grossProfit==0) ? toThousands(detailData.grossProfit) : '--' }}</span>,
|
|
</template>
|
|
</template>
|
|
- 总售价:<span class="red">{{ detailData&&(detailData.totalAmount || detailData.totalAmount==0) ? toThousands(detailData.totalAmount) : '--' }}</span>;
|
|
|
|
|
|
+ 总售价:<span class="red">{{ detailData&&(detailData.totalAmount || detailData.totalAmount==0) ? toThousands(detailData.totalAmount) : '--' }}</span>,
|
|
</div>
|
|
</div>
|
|
<div class="totalPrice" style="display: inline-block;">
|
|
<div class="totalPrice" style="display: inline-block;">
|
|
折后合计:<strong>{{ detailData&&(detailData.discountedAmount || detailData.discountedAmount==0) ? toThousands(detailData.discountedAmount) : '--' }}</strong>
|
|
折后合计:<strong>{{ detailData&&(detailData.discountedAmount || detailData.discountedAmount==0) ? toThousands(detailData.discountedAmount) : '--' }}</strong>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <div>
|
|
|
|
|
|
+ <div style="padding:5px 0 0;">
|
|
<a-checkbox :value="0" :checked="tbForm.indexOf('AUDIT')>=0" @change="(e)=>{tbFormChange(e,0)}" id="salesQuery-tbsh">同步审核</a-checkbox>
|
|
<a-checkbox :value="0" :checked="tbForm.indexOf('AUDIT')>=0" @change="(e)=>{tbFormChange(e,0)}" id="salesQuery-tbsh">同步审核</a-checkbox>
|
|
<a-checkbox :value="1" :checked="tbForm.indexOf('STOCK_OUT')>=0" @change="(e)=>{tbFormChange(e,1)}" id="salesQuery-tbck">同步出库</a-checkbox>
|
|
<a-checkbox :value="1" :checked="tbForm.indexOf('STOCK_OUT')>=0" @change="(e)=>{tbFormChange(e,1)}" id="salesQuery-tbck">同步出库</a-checkbox>
|
|
<a-checkbox :value="2" :checked="tbForm.indexOf('SETTLE')>=0" @change="(e)=>{tbFormChange(e,2)}" id="salesQuery-tbsk">同步收款</a-checkbox>
|
|
<a-checkbox :value="2" :checked="tbForm.indexOf('SETTLE')>=0" @change="(e)=>{tbFormChange(e,2)}" id="salesQuery-tbsk">同步收款</a-checkbox>
|
|
@@ -277,6 +273,7 @@
|
|
<chooseProductModal
|
|
<chooseProductModal
|
|
ref="partQuery"
|
|
ref="partQuery"
|
|
:showModal="openChooseProduct"
|
|
:showModal="openChooseProduct"
|
|
|
|
+ :checkedList = "checkedProductList"
|
|
@viewRecord="hanldSalesRecord"
|
|
@viewRecord="hanldSalesRecord"
|
|
@close="openChooseProduct=false"
|
|
@close="openChooseProduct=false"
|
|
@add="insterProduct"
|
|
@add="insterProduct"
|
|
@@ -285,6 +282,7 @@
|
|
<chooseShelfProduct
|
|
<chooseShelfProduct
|
|
v-if="showShelfModal"
|
|
v-if="showShelfModal"
|
|
ref="chooseShelfProduct"
|
|
ref="chooseShelfProduct"
|
|
|
|
+ @viewRecord="hanldSalesRecord"
|
|
@add="insterProduct"
|
|
@add="insterProduct"
|
|
@plAdd="plInsterProduct"
|
|
@plAdd="plInsterProduct"
|
|
:baseData="shelfInfo"
|
|
:baseData="shelfInfo"
|
|
@@ -305,7 +303,7 @@ import productSalesRecordModal from './productSalesRecordModal.vue'
|
|
import { stockByProductSn } from '@/api/stock'
|
|
import { stockByProductSn } from '@/api/stock'
|
|
import { queryByCustomerSn } from '@/api/shelf'
|
|
import { queryByCustomerSn } from '@/api/shelf'
|
|
import { salesDetail, salesWriteSubmit, salesWriteDiscount, salesDetailPrint, salesDetailExport, salesDel } from '@/api/sales'
|
|
import { salesDetail, salesWriteSubmit, salesWriteDiscount, salesDetailPrint, salesDetailExport, salesDel } from '@/api/sales'
|
|
-import { salesDetailList, salesDetailInsert, salesDetailInsertBatch, salesDetailUpdatePrice, salesDetailUpdateQty, salesDetailDel, salesDetailDelAll, salesDetailInsertImport } from '@/api/salesDetail'
|
|
|
|
|
|
+import { salesDetailList, salesDetailInsert, salesDetailInsertBatch, salesDetailUpdatePrice, salesDetailUpdateQty, salesDetailDel, salesDetailDelAll, salesDetailInsertImport, queryCheckedList } from '@/api/salesDetail'
|
|
import outInDetialModal from './outInDetialModal.vue'
|
|
import outInDetialModal from './outInDetialModal.vue'
|
|
import chooseShelfProduct from './chooseShelfProduct.vue'
|
|
import chooseShelfProduct from './chooseShelfProduct.vue'
|
|
import PrintPanel from '@/views/common/printPanel.vue'
|
|
import PrintPanel from '@/views/common/printPanel.vue'
|
|
@@ -334,6 +332,7 @@ export default {
|
|
openSettleModal: false, // 打开收款弹框
|
|
openSettleModal: false, // 打开收款弹框
|
|
enableFundAccount: false, // 是否开启资金账户管理
|
|
enableFundAccount: false, // 是否开启资金账户管理
|
|
showShelfModal: false, // 货架产品弹框
|
|
showShelfModal: false, // 货架产品弹框
|
|
|
|
+ checkedProductList: [], // 已选所有产品
|
|
delLoading: false,
|
|
delLoading: false,
|
|
detailData: { discountAmount: 0, id: null, salesBillSn: '' }, // 订单基础数据
|
|
detailData: { discountAmount: 0, id: null, salesBillSn: '' }, // 订单基础数据
|
|
dataSource: [],
|
|
dataSource: [],
|
|
@@ -351,7 +350,7 @@ export default {
|
|
this.disabled = true
|
|
this.disabled = true
|
|
this.spinning = true
|
|
this.spinning = true
|
|
this.productForm.salesBillSn = this.$route.params.sn
|
|
this.productForm.salesBillSn = this.$route.params.sn
|
|
- console.log(111)
|
|
|
|
|
|
+ this.getChoosedList({salesBillSn: this.$route.params.sn})
|
|
return salesDetailList(Object.assign(parameter, this.productForm)).then(res => {
|
|
return salesDetailList(Object.assign(parameter, this.productForm)).then(res => {
|
|
let data
|
|
let data
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
@@ -371,7 +370,8 @@ export default {
|
|
},
|
|
},
|
|
printerType: 'NEEDLE', // 打印机类型
|
|
printerType: 'NEEDLE', // 打印机类型
|
|
isCosts: false, // 是否显示成本价
|
|
isCosts: false, // 是否显示成本价
|
|
- shelfInfo: null // 是否有货架
|
|
|
|
|
|
+ shelfInfo: null, // 是否有货架
|
|
|
|
+ discountAmountBak: null
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -423,11 +423,11 @@ export default {
|
|
if(e.key == 3){
|
|
if(e.key == 3){
|
|
this.showShelfModal=true
|
|
this.showShelfModal=true
|
|
}
|
|
}
|
|
- if(e.key == 2){
|
|
|
|
|
|
+ if(e.key == 2){ // 清空列表
|
|
this.delSalerOrder()
|
|
this.delSalerOrder()
|
|
}
|
|
}
|
|
- if(e.key == 1){
|
|
|
|
- // this.delJijian()
|
|
|
|
|
|
+ if(e.key == 1){ // 删除急件
|
|
|
|
+ this.delSalerOrder(1)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 打印预览/快捷打印
|
|
// 打印预览/快捷打印
|
|
@@ -467,6 +467,12 @@ export default {
|
|
this.openSalesRecordModal = true
|
|
this.openSalesRecordModal = true
|
|
this.$refs.salseRecord.getDetail(this.detailData.buyerSn, row.productSn, row)
|
|
this.$refs.salseRecord.getDetail(this.detailData.buyerSn, row.productSn, row)
|
|
},
|
|
},
|
|
|
|
+ // 查询已选所以产品
|
|
|
|
+ getChoosedList(params){
|
|
|
|
+ queryCheckedList(params).then(res => {
|
|
|
|
+ this.checkedProductList = res.data || []
|
|
|
|
+ })
|
|
|
|
+ },
|
|
// 更新产品列表
|
|
// 更新产品列表
|
|
updateData (priceType) {
|
|
updateData (priceType) {
|
|
// 价格类型变更
|
|
// 价格类型变更
|
|
@@ -582,6 +588,9 @@ export default {
|
|
},
|
|
},
|
|
// 打折
|
|
// 打折
|
|
salesDiscount () {
|
|
salesDiscount () {
|
|
|
|
+ if(this.discountAmountBak == this.detailData.discountAmount){
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
this.spinning = true
|
|
this.spinning = true
|
|
salesWriteDiscount({
|
|
salesWriteDiscount({
|
|
discountAmount: this.detailData.discountAmount || 0,
|
|
discountAmount: this.detailData.discountAmount || 0,
|
|
@@ -590,54 +599,28 @@ export default {
|
|
}).then(res => {
|
|
}).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
this.getOrderDetail(true)
|
|
this.getOrderDetail(true)
|
|
- this.spinning = false
|
|
|
|
} else {
|
|
} else {
|
|
this.spinning = false
|
|
this.spinning = false
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- // 删除销售单
|
|
|
|
- delSalerOrder () {
|
|
|
|
|
|
+ // 清空已选产品
|
|
|
|
+ delSalerOrder (oosFlag) {
|
|
const _this = this
|
|
const _this = this
|
|
this.$confirm({
|
|
this.$confirm({
|
|
title: '提示',
|
|
title: '提示',
|
|
- content: '确认要清空已选产品列表吗?',
|
|
|
|
|
|
+ content: oosFlag==1?'确认要删除所有急件吗?删除后不可恢复。':'确认要清空已选产品列表吗?',
|
|
centered: true,
|
|
centered: true,
|
|
closable: true,
|
|
closable: true,
|
|
onOk () {
|
|
onOk () {
|
|
_this.spinning = true
|
|
_this.spinning = true
|
|
- salesDel({ id: _this.orderId }).then(res => {
|
|
|
|
- if (res.status == 200) {
|
|
|
|
- _this.$message.success(res.message)
|
|
|
|
- _this.handleBack()
|
|
|
|
- }
|
|
|
|
- _this.spinning = false
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- // 删除已选产品
|
|
|
|
- delSalerDetailAll () {
|
|
|
|
- const _this = this
|
|
|
|
- this.$confirm({
|
|
|
|
- title: '提示',
|
|
|
|
- content: '确认要整单删除吗?',
|
|
|
|
- centered: true,
|
|
|
|
- closable: true,
|
|
|
|
- onOk () {
|
|
|
|
- _this.delLoading = true
|
|
|
|
- _this.spinning = true
|
|
|
|
- salesDetailDelAll({ salesBillSn: _this.detailData.salesBillSn }).then(res => {
|
|
|
|
|
|
+ let params = { id: _this.orderId, oosFlag: oosFlag==1 ? 1 : undefined }
|
|
|
|
+ console.log(params,oosFlag==1)
|
|
|
|
+ salesDel(params).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
_this.getOrderDetail(true)
|
|
_this.getOrderDetail(true)
|
|
- _this.productForm = {
|
|
|
|
- productName: '',
|
|
|
|
- productCode: '',
|
|
|
|
- orderBy: 'sales_bill_detail.CREATE_DATE desc'
|
|
|
|
- }
|
|
|
|
|
|
+ _this.$message.success(res.message)
|
|
}
|
|
}
|
|
- _this.$message.info(res.message)
|
|
|
|
- _this.delLoading = false
|
|
|
|
_this.spinning = false
|
|
_this.spinning = false
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -779,6 +762,7 @@ export default {
|
|
salesDetail({ id: vm.$route.params.id }).then(res => {
|
|
salesDetail({ id: vm.$route.params.id }).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
vm.detailData = res.data
|
|
vm.detailData = res.data
|
|
|
|
+ vm.discountAmountBak = vm.detailData.discountAmount
|
|
if (flag) {
|
|
if (flag) {
|
|
const buyerSn = (vm.detailData && vm.detailData.buyerSn && vm.detailData.sourceType && vm.detailData.sourceType == 'PURCHASE') ? '' : vm.detailData.buyerSn
|
|
const buyerSn = (vm.detailData && vm.detailData.buyerSn && vm.detailData.sourceType && vm.detailData.sourceType == 'PURCHASE') ? '' : vm.detailData.buyerSn
|
|
const priceType = vm.$route.params.priceType
|
|
const priceType = vm.$route.params.priceType
|
|
@@ -787,6 +771,7 @@ export default {
|
|
vm.resetForm()
|
|
vm.resetForm()
|
|
}else{
|
|
}else{
|
|
vm.spinning = false
|
|
vm.spinning = false
|
|
|
|
+ vm.checkedProductList = []
|
|
}
|
|
}
|
|
// 查询关联的客户货架信息
|
|
// 查询关联的客户货架信息
|
|
if (vm.detailData && vm.detailData.buyerSn) {
|
|
if (vm.detailData && vm.detailData.buyerSn) {
|
|
@@ -863,7 +848,7 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
setTableH () {
|
|
setTableH () {
|
|
- this.tableHeight = window.innerHeight - (this.showSearch ? 42 : 0) - 330
|
|
|
|
|
|
+ this.tableHeight = window.innerHeight - (this.showSearch ? 42 : 0) - 310
|
|
},
|
|
},
|
|
pageInit () {
|
|
pageInit () {
|
|
const vm = this
|
|
const vm = this
|
|
@@ -954,6 +939,7 @@ export default {
|
|
}
|
|
}
|
|
.red{
|
|
.red{
|
|
color: #f5452e;
|
|
color: #f5452e;
|
|
|
|
+ font-size: 14px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
&:last-child{
|
|
&:last-child{
|