|
@@ -89,7 +89,7 @@
|
|
|
style="margin:0 15px;"
|
|
|
type="primary"
|
|
|
ghost
|
|
|
- id="salesEdit-plDel-btn"> 批量操作 <a-icon type="down" /> </a-button>
|
|
|
+ id="salesEdit-plDel-btn"> 仓库设置 <a-icon type="down" /> </a-button>
|
|
|
</a-dropdown>
|
|
|
<a-button
|
|
|
type="default"
|
|
@@ -216,7 +216,7 @@
|
|
|
<!-- 导入产品 -->
|
|
|
<importGuideModal :openModal="openGuideModal" :params="{salesBillSn: $route.params.sn}" @close="closeGuideModel" @ok="hanldeOk" />
|
|
|
<!-- 仓库设置 -->
|
|
|
- <setWarehouse :show="openWarehouseModal" @ok="chooseCustomOk" @cancel="openWarehouseModal=false"></setWarehouse>
|
|
|
+ <setWarehouse :show="openWarehouseModal" @ok="chooseWarehouseOk" @cancel="openWarehouseModal=false"></setWarehouse>
|
|
|
<!-- 价格更新弹窗 -->
|
|
|
<setPriceModal :show="priceUpdateModal" @ok="updatePrice" @cancel="priceUpdateModal=false"></setPriceModal>
|
|
|
</div>
|
|
@@ -232,7 +232,7 @@ import ImportGuideModal from './importGuideModal.vue'
|
|
|
import setWarehouse from './setWarehouse.vue'
|
|
|
import setPriceModal from './setPriceModal.vue'
|
|
|
import chooseWarehouse from '@/views/common/chooseWarehouse'
|
|
|
-import { salesModify, salesDetailBySn, salesWriteSubmit, getPromoacActiveList, deleteAll, submitCheck, updateBatch } from '@/api/sales'
|
|
|
+import { salesModify, salesDetailBySn, salesWriteSubmit, getPromoacActiveList, deleteAll, submitCheck, updateBatch, updateWarehouse } from '@/api/sales'
|
|
|
import { salesDetailStockList, salesDetailInsert, salesDetailUpdateQty, salesDetailDel, salesDetailBatchDel, salesDetailDelAll, addPromoGoods, salesBatchInsert } from '@/api/salesDetail'
|
|
|
export default {
|
|
|
name: 'SalesEdit',
|
|
@@ -279,6 +279,7 @@ export default {
|
|
|
},
|
|
|
openGuideModal: false, // 导入产品引导
|
|
|
queryParam: {
|
|
|
+ warehouseSn: undefined,
|
|
|
productCode: '',
|
|
|
productName: ''
|
|
|
},
|
|
@@ -312,6 +313,28 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ chooseWarehouseOk (sn) {
|
|
|
+ const _this = this
|
|
|
+ const snArr = []
|
|
|
+ _this.rowSelectionInfo.selectedRows.forEach(item => {
|
|
|
+ snArr.push(item.salesBillDetailSn)
|
|
|
+ })
|
|
|
+ const ajax_data = {
|
|
|
+ warehouseSn: sn,
|
|
|
+ salesBillDetailSnList: snArr,
|
|
|
+ salesBillSn: this.$route.params.sn
|
|
|
+ }
|
|
|
+ _this.spinning = true
|
|
|
+ updateWarehouse(ajax_data).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ _this.openWarehouseModal = false
|
|
|
+ _this.resetSearchForm(true)
|
|
|
+ _this.$refs.promotable.resetCurForm()
|
|
|
+ _this.$message.success(res.message)
|
|
|
+ }
|
|
|
+ _this.spinning = false
|
|
|
+ })
|
|
|
+ },
|
|
|
// 选择仓库
|
|
|
handleWarehouse (val) {
|
|
|
this.warehouseSn = val
|
|
@@ -322,7 +345,7 @@ export default {
|
|
|
warehouseSn: val
|
|
|
}).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
- _this.$refs.partQuery.resetCurForm(val)
|
|
|
+ _this.$refs.partQuery.resetCurForm()
|
|
|
_this.$refs.table.refresh(true)
|
|
|
_this.spinning = false
|
|
|
} else {
|
|
@@ -332,8 +355,13 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
handleMenuClick (e) {
|
|
|
+ const _this = this
|
|
|
if (e.key == 0) { // 仓库设置
|
|
|
- this.openWarehouseModal = true
|
|
|
+ if (!_this.rowSelectionInfo || (_this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys.length < 1)) {
|
|
|
+ _this.$message.warning('请先选择要设置的产品!')
|
|
|
+ } else {
|
|
|
+ _this.openWarehouseModal = true
|
|
|
+ }
|
|
|
} else if (e.key == 1) { // 删除已选项
|
|
|
this.handleBatchDel()
|
|
|
} else {
|
|
@@ -423,12 +451,14 @@ export default {
|
|
|
chooseResetSearchForm () {
|
|
|
this.queryParam.productCode = ''
|
|
|
this.queryParam.productName = ''
|
|
|
+ this.queryParam.warehouseSn = undefined
|
|
|
this.$refs.table.refresh(true)
|
|
|
},
|
|
|
// 重置
|
|
|
resetSearchForm (flag) {
|
|
|
this.queryParam.productCode = ''
|
|
|
this.queryParam.productName = ''
|
|
|
+ this.queryParam.warehouseSn = undefined
|
|
|
this.$refs.table.refresh(!!flag)
|
|
|
this.getPromoacActiveList()
|
|
|
this.getOrderDetail(false)
|
|
@@ -512,7 +542,8 @@ export default {
|
|
|
purchaseBillNo: this.detailData.purchaseBillNo,
|
|
|
stockSn: row.stockSn,
|
|
|
promotableFlag: row.isJoinActivityProduct || 0, // 可促销标记 有活动的传1,没活动的传0
|
|
|
- promotionFlag: promotionFlag // 促销标记 正品传0,促销品传1
|
|
|
+ promotionFlag: promotionFlag, // 促销标记 正品传0,促销品传1
|
|
|
+ warehouseSn: row.warehouseSn
|
|
|
}).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
this.resetSearchForm()
|
|
@@ -532,7 +563,7 @@ export default {
|
|
|
if (res.status == 200) {
|
|
|
this.detailData = res.data
|
|
|
if (flag) {
|
|
|
- this.$refs.partQuery.pageInit(this.detailData && this.detailData.buyerSn || '', this.warehouseSn)
|
|
|
+ this.$refs.partQuery.pageInit(this.detailData && this.detailData.buyerSn || '')
|
|
|
}
|
|
|
}
|
|
|
})
|