|
@@ -35,7 +35,7 @@
|
|
|
<a-button v-if="detailData&&detailData.totalCategory" id="salesNewOrderEdit-add-btn" type="link" @click="openChooseProduct=true"><a-icon type="plus" />添加产品</a-button>
|
|
|
<a-divider type="vertical" v-if="detailData&&detailData.totalCategory" />
|
|
|
<a-dropdown v-model="showCell" v-if="$hasPermissions('M_ShowAllCost')&&detailData&&detailData.totalCategory">
|
|
|
- <a-button type="link" class="button-default"> <a-icon type="setting" /> 显示</a-button>
|
|
|
+ <a-button type="link" class="button-default" id="salesQuery-edit-showCell"> <a-icon type="setting" /> 显示</a-button>
|
|
|
<a-menu slot="overlay">
|
|
|
<a-menu-item>
|
|
|
<a-checkbox v-model="isCosts" id="salesQuery-edit-cost">成本价</a-checkbox>
|
|
@@ -44,21 +44,21 @@
|
|
|
</a-dropdown>
|
|
|
<a-divider type="vertical" v-if="$hasPermissions('M_ShowAllCost')"/>
|
|
|
<a-dropdown>
|
|
|
- <a-menu slot="overlay" @click="handleActions">
|
|
|
- <a-menu-item key="4">
|
|
|
+ <a-menu slot="overlay" @click="handleActions" id="salesQuery-edit-action-menus">
|
|
|
+ <a-menu-item key="4" id="salesQuery-edit-import">
|
|
|
<a-icon type="import" />导入产品
|
|
|
</a-menu-item>
|
|
|
- <a-menu-item key="3" v-if="shelfInfo&&shelfInfo.state=='ENABLE'">
|
|
|
+ <a-menu-item key="3" v-if="shelfInfo&&shelfInfo.state=='ENABLE'" id="salesQuery-edit-shelfproduct">
|
|
|
<a-icon type="hdd"/>货架产品
|
|
|
</a-menu-item>
|
|
|
- <a-menu-item key="2">
|
|
|
+ <a-menu-item key="2" id="salesQuery-edit-delAll">
|
|
|
<a-icon type="close-square"/>清空列表
|
|
|
</a-menu-item>
|
|
|
- <a-menu-item key="1">
|
|
|
+ <a-menu-item key="1" id="salesQuery-edit-delJdOrQh">
|
|
|
<a-icon type="rest" style="font-size: 14px;" />{{ isOwerEdit?'删除急件':'删除缺货' }}
|
|
|
</a-menu-item>
|
|
|
</a-menu>
|
|
|
- <a-button type="link" class="button-default"> <a-icon type="unordered-list" /> 更多</a-button>
|
|
|
+ <a-button id="salesQuery-edit-moreBtn" type="link" class="button-default"> <a-icon type="unordered-list" /> 更多</a-button>
|
|
|
</a-dropdown>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -72,17 +72,17 @@
|
|
|
<a-row :gutter="10">
|
|
|
<a-col :md="5" :sm="24">
|
|
|
<a-form-model-item label="产品编码">
|
|
|
- <a-input v-model.trim="productForm.productCode" allowClear placeholder="输入产品编码" />
|
|
|
+ <a-input id="salesQuery-edit-productCode" v-model.trim="productForm.productCode" allowClear placeholder="输入产品编码" />
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :md="5" :sm="24">
|
|
|
<a-form-model-item label="产品名称">
|
|
|
- <a-input v-model.trim="productForm.productName" allowClear placeholder="输入产品名称" />
|
|
|
+ <a-input id="salesQuery-edit-productName" v-model.trim="productForm.productName" allowClear placeholder="输入产品名称" />
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :md="4" :sm="24" v-if="isOwerEdit">
|
|
|
<a-form-item label="是否为急件">
|
|
|
- <a-select allowClear v-model="productForm.oosFlag" placeholder="请选择是否">
|
|
|
+ <a-select id="salesQuery-edit-oosFlag" allowClear v-model="productForm.oosFlag" placeholder="请选择是否">
|
|
|
<a-select-option value="1">
|
|
|
是
|
|
|
</a-select-option>
|
|
@@ -172,6 +172,7 @@
|
|
|
</div>
|
|
|
<a-input-number
|
|
|
size="small"
|
|
|
+ :id="'salesEdit-price-'+record.id"
|
|
|
v-model="record.price"
|
|
|
:precision="2"
|
|
|
:min="0"
|
|
@@ -185,7 +186,7 @@
|
|
|
<!-- 销售数量 -->
|
|
|
<template slot="salesNums" slot-scope="text, record">
|
|
|
<a-input-number
|
|
|
- id="salesEdit-salesNums"
|
|
|
+ :id="'salesEdit-salesNums-'+record.id"
|
|
|
size="small"
|
|
|
v-model="record.qty"
|
|
|
:precision="0"
|
|
@@ -197,14 +198,20 @@
|
|
|
</template>
|
|
|
<!-- 操作 -->
|
|
|
<template slot="action" slot-scope="text, record">
|
|
|
- <a-button size="small" v-if="record.oosFlag == 0 && isOwerEdit" type="link" class="button-primary" @click="handleViewDetail(record)">出库明细</a-button>
|
|
|
+ <a-button
|
|
|
+ :id="'salesEdit-viewRecord-'+record.id"
|
|
|
+ size="small"
|
|
|
+ v-if="record.oosFlag == 0 && isOwerEdit"
|
|
|
+ type="link"
|
|
|
+ class="button-primary"
|
|
|
+ @click="handleViewDetail(record)">出库明细</a-button>
|
|
|
<a-button
|
|
|
size="small"
|
|
|
type="link"
|
|
|
:loading="delLoading"
|
|
|
class="button-error"
|
|
|
@click="handleDel(record)"
|
|
|
- id="productInfoList-Del">删除</a-button>
|
|
|
+ :id="'salesEdit-del-'+record.id">删除</a-button>
|
|
|
</template>
|
|
|
</s-table>
|
|
|
</div>
|
|
@@ -217,7 +224,7 @@
|
|
|
}"
|
|
|
>
|
|
|
<span slot="description"> 暂无产品 </span>
|
|
|
- <a-button type="primary" class="button-error" @click="openChooseProduct=true"><a-icon type="plus" />立即添加产品</a-button>
|
|
|
+ <a-button id="salesEdit-newAddProduct" type="primary" class="button-error" @click="openChooseProduct=true"><a-icon type="plus" />立即添加产品</a-button>
|
|
|
</a-empty>
|
|
|
</div>
|
|
|
<div style="text-align: center;padding: 30px 50px;" v-if="spinning">
|
|
@@ -245,7 +252,7 @@
|
|
|
<div style="display: inline-block;">
|
|
|
折扣金额:
|
|
|
<a-input-number
|
|
|
- id="discount"
|
|
|
+ id="salesEdit-discount"
|
|
|
size="small"
|
|
|
v-model.trim="detailData.discountAmount"
|
|
|
@blur="salesDiscount"
|
|
@@ -266,7 +273,7 @@
|
|
|
<a-menu-item key="2"> <a-checkbox :value="1" :checked="tbForm.indexOf('STOCK_OUT')>=0" @change="(e)=>{tbFormChange(e,1)}" id="salesQuery-tbck">同步出库</a-checkbox> </a-menu-item>
|
|
|
<a-menu-item key="3"> <a-checkbox :value="2" :checked="tbForm.indexOf('SETTLE')>=0" @change="(e)=>{tbFormChange(e,2)}" id="salesQuery-tbsk">同步收款</a-checkbox></a-menu-item>
|
|
|
</a-menu>
|
|
|
- <a-button style="margin-left: 8px" size="large"> 选择同步操作 <a-icon type="down" /> </a-button>
|
|
|
+ <a-button id="salesEdit-tb-action" style="margin-left: 8px" size="large"> 选择同步操作 <a-icon type="down" /> </a-button>
|
|
|
</a-dropdown>
|
|
|
</div>
|
|
|
<div>
|
|
@@ -321,34 +328,37 @@
|
|
|
import { commonMixin } from '@/utils/mixin'
|
|
|
import { mapActions } from 'vuex'
|
|
|
import { Empty } from 'ant-design-vue'
|
|
|
+import { hdPrint } from '@/libs/JGPrint'
|
|
|
+// 组件
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
+import outInDetialModal from './outInDetialModal.vue'
|
|
|
+import chooseShelfProduct from './chooseShelfProduct.vue'
|
|
|
+import PrintPanel from '@/views/common/printPanel.vue'
|
|
|
import chooseProductModal from './chooseProductModal.vue'
|
|
|
import chooseCustomModal from './chooseCustomModal.vue'
|
|
|
import importGuideModal from './importGuideModal.vue'
|
|
|
import settleModal from '@/views/financialManagement/settleModal/settleModal.vue'
|
|
|
import productSalesRecordModal from './productSalesRecordModal.vue'
|
|
|
+// 接口
|
|
|
import { stockByProductSn } from '@/api/stock'
|
|
|
import { queryByCustomerSn } from '@/api/shelf'
|
|
|
import { salesDetail, salesWriteSubmit, salesWriteDiscount, salesDetailPrint, salesDetailExport, salesDel } from '@/api/sales'
|
|
|
-import { salesDetailList, salesDetailInsert, salesDetailInsertBatch, salesDetailUpdatePrice, salesDetailUpdateQty, salesDetailDel, salesDetailDelAll, salesDetailInsertImport, queryCheckedList } from '@/api/salesDetail'
|
|
|
-import outInDetialModal from './outInDetialModal.vue'
|
|
|
-import chooseShelfProduct from './chooseShelfProduct.vue'
|
|
|
-import PrintPanel from '@/views/common/printPanel.vue'
|
|
|
-import { hdPrint } from '@/libs/JGPrint'
|
|
|
+import { salesDetailList, salesDetailInsert, salesDetailInsertBatch, salesDetailUpdatePrice, salesDetailUpdateQty, salesDetailDel, salesDetailInsertImport, queryCheckedList } from '@/api/salesDetail'
|
|
|
+
|
|
|
export default {
|
|
|
name: 'SalesEdit',
|
|
|
components: { STable, VSelect, chooseProductModal, chooseCustomModal, PrintPanel, importGuideModal, settleModal, outInDetialModal, chooseShelfProduct, productSalesRecordModal },
|
|
|
mixins: [commonMixin],
|
|
|
data () {
|
|
|
return {
|
|
|
- simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
|
|
|
- tableHeight: 0,
|
|
|
+ simpleImage: Empty.PRESENTED_IMAGE_SIMPLE, // 默认空图片
|
|
|
+ tableHeight: 0, // 表格高度
|
|
|
showOutInModal: false, // 出入库明细
|
|
|
- showCell: false,
|
|
|
- showPage: false,
|
|
|
+ showCell: false, // 显示列下拉选项
|
|
|
+ showPage: false, // 是否显示组件
|
|
|
spinning: false,
|
|
|
- showSearch: false,
|
|
|
- openChooseProduct: false,
|
|
|
+ showSearch: false, // 是否显示查询条件
|
|
|
+ openChooseProduct: false, // 是否显示产品列表弹框
|
|
|
orderId: null, // 销售单id
|
|
|
salesBillSn: null, // 销售单sn
|
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
@@ -360,20 +370,20 @@ export default {
|
|
|
enableFundAccount: false, // 是否开启资金账户管理
|
|
|
showShelfModal: false, // 货架产品弹框
|
|
|
checkedProductList: [], // 已选所有产品
|
|
|
- delLoading: false,
|
|
|
+ delLoading: false, // 按钮loading
|
|
|
detailData: { discountAmount: 0, id: null, salesBillSn: '' }, // 订单基础数据
|
|
|
- dataSource: [],
|
|
|
+ dataSource: [], // 原始数据
|
|
|
productForm: {
|
|
|
- productName: '',
|
|
|
- productCode: '',
|
|
|
- oosFlag: undefined,
|
|
|
- orderBy: 'sales_bill_detail.CREATE_DATE desc'
|
|
|
+ productName: '', // 产品名称
|
|
|
+ productCode: '', // 产品编码
|
|
|
+ oosFlag: undefined, // 是否急件
|
|
|
+ orderBy: 'sales_bill_detail.CREATE_DATE desc' // 排序
|
|
|
},
|
|
|
- tbForm: [], // 同步操作
|
|
|
- printOrgCode: false, // 打印原创编码
|
|
|
- printAllName: false, // 打印全部名称
|
|
|
- printRemarks: false, // 打印备注
|
|
|
- printPrice: false,
|
|
|
+ tbForm: [], // 同步操作选项值
|
|
|
+ printOrgCode: false, // 是否打印原创编码
|
|
|
+ printAllName: false, // 是否打印全部名称
|
|
|
+ printRemarks: false, // 是否打印备注
|
|
|
+ printPrice: false, // 是否打印价格
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
|
this.disabled = true
|
|
@@ -387,6 +397,7 @@ export default {
|
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
|
data.list[i].no = no + i + 1
|
|
|
+ // 缓存数量和价格
|
|
|
data.list[i].qtyBackups = data.list[i].qty
|
|
|
data.list[i].priceBackups = data.list[i].price
|
|
|
}
|
|
@@ -400,7 +411,7 @@ export default {
|
|
|
printerType: 'NEEDLE', // 打印机类型
|
|
|
isCosts: false, // 是否显示成本价
|
|
|
shelfInfo: null, // 是否有货架
|
|
|
- discountAmountBak: null
|
|
|
+ discountAmountBak: null // 折扣备份数据
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -412,6 +423,7 @@ export default {
|
|
|
isAudit () {
|
|
|
return this.detailData && (this.detailData.billStatus == 'WAIT_OUT_WAREHOUSE' || this.detailData.billStatus == 'FINISH')
|
|
|
},
|
|
|
+ // 列定义
|
|
|
columns () {
|
|
|
const _this = this
|
|
|
const arr = [
|
|
@@ -445,10 +457,13 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
...mapActions(['GetSettleAccountState']),
|
|
|
+ // 更多操作
|
|
|
handleActions (e) {
|
|
|
+ // 导入产品
|
|
|
if (e.key == 4) {
|
|
|
this.openGuideModal = true
|
|
|
}
|
|
|
+ // 货架产品
|
|
|
if (e.key == 3) {
|
|
|
this.showShelfModal = true
|
|
|
}
|
|
@@ -480,6 +495,7 @@ export default {
|
|
|
_this.$refs.printBox.hovered = false
|
|
|
})
|
|
|
},
|
|
|
+ // 选择同步操作选项
|
|
|
tbFormChange (e, val) {
|
|
|
this.tbForm = []
|
|
|
const tbTypes = ['AUDIT', 'STOCK_OUT', 'SETTLE']
|
|
@@ -672,7 +688,6 @@ export default {
|
|
|
},
|
|
|
// 删除产品
|
|
|
handleDel (row) {
|
|
|
- row
|
|
|
const _this = this
|
|
|
this.$confirm({
|
|
|
title: '提示',
|
|
@@ -684,6 +699,7 @@ export default {
|
|
|
_this.spinning = true
|
|
|
salesDetailDel({ id: row.id }).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
+ // 更新详情
|
|
|
_this.getOrderDetail(false, true)
|
|
|
}
|
|
|
_this.$message.info(res.message)
|
|
@@ -894,9 +910,11 @@ export default {
|
|
|
this.spinning = false
|
|
|
})
|
|
|
},
|
|
|
+ // 计算表格高度
|
|
|
setTableH () {
|
|
|
this.tableHeight = window.innerHeight - (this.showSearch ? 42 : 0) - 300
|
|
|
},
|
|
|
+ // 页面初始话
|
|
|
pageInit () {
|
|
|
const vm = this
|
|
|
vm.$nextTick(() => {
|
|
@@ -908,11 +926,13 @@ export default {
|
|
|
vm.printAllName = localStorage.getItem('printAllName-' + this.$store.state.user.info.orgId) == 'true'
|
|
|
vm.printRemarks = localStorage.getItem('printRemarks-' + this.$store.state.user.info.orgId) == 'true'
|
|
|
vm.printPrice = localStorage.getItem('printPrice-' + this.$store.state.user.info.orgId) == 'true'
|
|
|
+ // 获取详情
|
|
|
vm.getOrderDetail(true)
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
+ // 打印选项缓存
|
|
|
printOrgCode (newValue, oldValue) {
|
|
|
localStorage.setItem('printOrgCode-' + this.$store.state.user.info.orgId, newValue)
|
|
|
},
|
|
@@ -948,7 +968,7 @@ export default {
|
|
|
if (this.$hasPermissions('M_fundAccountList') && this.$hasPermissions('B_fundAccountEnable')) {
|
|
|
this.GetSettleAccountState().then(res => {
|
|
|
if (res.status == 200) {
|
|
|
- this.enableFundAccount = res.data.functionEnableFlag == 1
|
|
|
+ this.enableFundAccount = res.data.functionEnableFlag == 1
|
|
|
}
|
|
|
})
|
|
|
}
|