|
@@ -7,9 +7,11 @@
|
|
<a id="salesEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
|
|
<a id="salesEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
|
|
<a style="margin: 0 15px;color: #666;font-size: 18px;font-weight: 600;">单号:{{ detailData&&detailData.salesBillNo || '--' }}</a>
|
|
<a style="margin: 0 15px;color: #666;font-size: 18px;font-weight: 600;">单号:{{ detailData&&detailData.salesBillNo || '--' }}</a>
|
|
<span style="margin: 0 10px;color: #666;">客户名称:{{ detailData&&detailData.buyerName || '--' }}</span>
|
|
<span style="margin: 0 10px;color: #666;">客户名称:{{ detailData&&detailData.buyerName || '--' }}</span>
|
|
|
|
+ <a-button id="salesEdit-edit-btn" size="small" @click="handleEdit" style="margin-left:10px" key="0">编辑</a-button>
|
|
</template>
|
|
</template>
|
|
<!-- 操作区,位于 title 行的行尾 -->
|
|
<!-- 操作区,位于 title 行的行尾 -->
|
|
<template slot="extra" v-if="$hasPermissions('B_salesPrint')">
|
|
<template slot="extra" v-if="$hasPermissions('B_salesPrint')">
|
|
|
|
+ <a-checkbox v-model="printOrgCode" :checked="printOrgCode" id="salesQuery-printOrgCode">打印原厂编码</a-checkbox>
|
|
<Print :disabled="dataSource.length==0" @handlePrint="handlePrint"></Print>
|
|
<Print :disabled="dataSource.length==0" @handlePrint="handlePrint"></Print>
|
|
</template>
|
|
</template>
|
|
</a-page-header>
|
|
</a-page-header>
|
|
@@ -57,7 +59,7 @@
|
|
<!-- 搜索条件 -->
|
|
<!-- 搜索条件 -->
|
|
<div class="table-page-search-wrapper">
|
|
<div class="table-page-search-wrapper">
|
|
<a-row :gutter="15">
|
|
<a-row :gutter="15">
|
|
- <a-col :span="18">
|
|
|
|
|
|
+ <a-col :span="16">
|
|
<a-form-model :model="productForm" ref="ruleForm" layout="inline" @keyup.enter.native="$refs.table.refresh(true)" >
|
|
<a-form-model :model="productForm" ref="ruleForm" layout="inline" @keyup.enter.native="$refs.table.refresh(true)" >
|
|
<a-row :gutter="15">
|
|
<a-row :gutter="15">
|
|
<a-col :md="8" :sm="24">
|
|
<a-col :md="8" :sm="24">
|
|
@@ -79,14 +81,11 @@
|
|
</a-row>
|
|
</a-row>
|
|
</a-form-model>
|
|
</a-form-model>
|
|
</a-col>
|
|
</a-col>
|
|
- <a-col :span="6">
|
|
|
|
|
|
+ <a-col :span="8">
|
|
<div style="float:right;overflow: hidden;">
|
|
<div style="float:right;overflow: hidden;">
|
|
- <a-button
|
|
|
|
- type="primary"
|
|
|
|
- @click="delSalerOrder"
|
|
|
|
- :loading="delLoading"
|
|
|
|
- style="margin-right: 10px"
|
|
|
|
- id="salesEdit-del-all">整单删除</a-button>
|
|
|
|
|
|
+ <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="2" :checked="tbForm.indexOf('SETTLE')>=0" @change="(e)=>{tbFormChange(e,2)}" id="salesQuery-tbsk">同步收款</a-checkbox>
|
|
<a-button
|
|
<a-button
|
|
style="padding: 0 25px;"
|
|
style="padding: 0 25px;"
|
|
type="primary"
|
|
type="primary"
|
|
@@ -94,6 +93,12 @@
|
|
class="button-primary"
|
|
class="button-primary"
|
|
@click="handleSubmit()"
|
|
@click="handleSubmit()"
|
|
id="productInfoList-handleSubmit">提交</a-button>
|
|
id="productInfoList-handleSubmit">提交</a-button>
|
|
|
|
+ <a-button
|
|
|
|
+ type="link"
|
|
|
|
+ @click="delSalerOrder"
|
|
|
|
+ :loading="delLoading"
|
|
|
|
+ style="margin-right: 10px"
|
|
|
|
+ id="salesEdit-del-all">整单删除</a-button>
|
|
</div>
|
|
</div>
|
|
</a-col>
|
|
</a-col>
|
|
</a-row>
|
|
</a-row>
|
|
@@ -193,22 +198,8 @@ export default {
|
|
productCode: '',
|
|
productCode: '',
|
|
orderBy: 'sales_bill_detail.CREATE_DATE desc'
|
|
orderBy: 'sales_bill_detail.CREATE_DATE desc'
|
|
},
|
|
},
|
|
- // 表头
|
|
|
|
- columns: [
|
|
|
|
- { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
|
|
|
|
- { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '13%', scopedSlots: { customRender: 'productCode' }, align: 'center' },
|
|
|
|
- { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '13%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
- { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '品牌', dataIndex: 'dealerProductEntity.productBrandName', width: '8%', align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '仓库', dataIndex: 'warehouseEntity.name', width: '8%', align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '仓位', dataIndex: 'warehouseLocationEntity.name', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '售价', dataIndex: 'price', scopedSlots: { customRender: 'price' }, width: '7%', align: 'center' },
|
|
|
|
- { title: '销售数量', scopedSlots: { customRender: 'salesNums' }, width: '7%', align: 'center' },
|
|
|
|
- { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '售价小计', dataIndex: 'totalAmount', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
- { title: '折后小计', dataIndex: 'discountedAmount', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
- { title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }
|
|
|
|
- ],
|
|
|
|
|
|
+ tbForm: [], // 同步操作
|
|
|
|
+ printOrgCode: false, // 打印原创编码
|
|
// 加载数据方法 必须为 Promise 对象
|
|
// 加载数据方法 必须为 Promise 对象
|
|
loadData: parameter => {
|
|
loadData: parameter => {
|
|
this.disabled = true
|
|
this.disabled = true
|
|
@@ -230,7 +221,30 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
printerType: 'NEEDLE', // 打印机类型
|
|
printerType: 'NEEDLE', // 打印机类型
|
|
- isCosts: false
|
|
|
|
|
|
+ isCosts: false // 是否显示成本价
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ computed: {
|
|
|
|
+ columns () {
|
|
|
|
+ const arr = [
|
|
|
|
+ { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
|
|
|
|
+ { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '13%', scopedSlots: { customRender: 'productCode' }, align: 'center' },
|
|
|
|
+ { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '13%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
+ { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '品牌', dataIndex: 'dealerProductEntity.productBrandName', width: '8%', align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '仓库', dataIndex: 'warehouseEntity.name', width: '8%', align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '仓位', dataIndex: 'warehouseLocationEntity.name', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '售价', dataIndex: 'price', scopedSlots: { customRender: 'price' }, width: '7%', align: 'center' },
|
|
|
|
+ { title: '销售数量', scopedSlots: { customRender: 'salesNums' }, width: '7%', align: 'center' },
|
|
|
|
+ { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '售价小计', dataIndex: 'totalAmount', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
+ { title: '折后小计', dataIndex: 'discountedAmount', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
+ { title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }
|
|
|
|
+ ]
|
|
|
|
+ if (this.isCosts) {
|
|
|
|
+ arr.splice(7, 0, { title: '成本价', dataIndex: 'cost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
|
|
|
|
+ }
|
|
|
|
+ return arr
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -239,7 +253,7 @@ export default {
|
|
const _this = this
|
|
const _this = this
|
|
_this.spinning = true
|
|
_this.spinning = true
|
|
let url = salesDetailPrint
|
|
let url = salesDetailPrint
|
|
- const params = { sn: this.outBizSn || this.$route.params.sn }
|
|
|
|
|
|
+ const params = { sn: this.outBizSn || this.$route.params.sn, printOrgCode: this.printOrgCode ? 1 : 0 }
|
|
if (type == 'export') { // 导出
|
|
if (type == 'export') { // 导出
|
|
url = salesDetailExport
|
|
url = salesDetailExport
|
|
}
|
|
}
|
|
@@ -248,6 +262,31 @@ export default {
|
|
_this.spinning = false
|
|
_this.spinning = false
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ tbFormChange (e, val) {
|
|
|
|
+ this.tbForm = []
|
|
|
|
+ const tbTypes = ['AUDIT', 'STOCK_OUT', 'SETTLE']
|
|
|
|
+ if (e.target.checked) {
|
|
|
|
+ for (let i = val; i >= 0; i--) {
|
|
|
|
+ this.tbForm.push(tbTypes[i])
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ this.tbForm = []
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 编辑客户信息
|
|
|
|
+ handleEdit () {
|
|
|
|
+ this.openModal = true
|
|
|
|
+ this.$refs.custModal.editCust(this.detailData)
|
|
|
|
+ },
|
|
|
|
+ // 更新产品列表
|
|
|
|
+ updateData (priceType) {
|
|
|
|
+ // 价格类型变更
|
|
|
|
+ if (priceType != this.$route.params.priceType) {
|
|
|
|
+ this.$router.push({ name: 'salesEdit', params: { id: this.orderId, sn: this.salesBillSn, priceType: priceType } })
|
|
|
|
+ } else {
|
|
|
|
+ this.getOrderDetail(true)
|
|
|
|
+ }
|
|
|
|
+ },
|
|
// 已选产品 销售数量 blur
|
|
// 已选产品 销售数量 blur
|
|
qtyBlur (val, record) {
|
|
qtyBlur (val, record) {
|
|
const _this = this
|
|
const _this = this
|
|
@@ -321,15 +360,6 @@ export default {
|
|
isCost (val) {
|
|
isCost (val) {
|
|
this.isCosts = val
|
|
this.isCosts = val
|
|
},
|
|
},
|
|
- // 更新产品列表
|
|
|
|
- updateData (priceType) {
|
|
|
|
- // 价格类型变更
|
|
|
|
- if (priceType != this.$route.params.priceType) {
|
|
|
|
- this.$router.push({ name: 'salesEdit', params: { id: this.orderId, sn: this.salesBillSn, priceType: priceType } })
|
|
|
|
- } else {
|
|
|
|
- this.getOrderDetail(true)
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
// 重置
|
|
// 重置
|
|
resetSearchForm (flag) {
|
|
resetSearchForm (flag) {
|
|
if (flag) { this.$refs.partQuery.onlyList = true }
|
|
if (flag) { this.$refs.partQuery.onlyList = true }
|
|
@@ -540,7 +570,8 @@ export default {
|
|
// 提交销售单
|
|
// 提交销售单
|
|
handleSubmit () {
|
|
handleSubmit () {
|
|
this.spinning = true
|
|
this.spinning = true
|
|
- salesWriteSubmit({ id: this.orderId }).then(res => {
|
|
|
|
|
|
+ const submitTypes = this.tbForm.join(',')
|
|
|
|
+ salesWriteSubmit({ id: this.orderId, submitTypes: submitTypes }).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
this.handleBack()
|
|
this.handleBack()
|
|
this.$message.success(res.message)
|
|
this.$message.success(res.message)
|
|
@@ -555,11 +586,18 @@ export default {
|
|
vm.$nextTick(() => {
|
|
vm.$nextTick(() => {
|
|
vm.orderId = vm.$route.params.id
|
|
vm.orderId = vm.$route.params.id
|
|
vm.salesBillSn = vm.$route.params.sn
|
|
vm.salesBillSn = vm.$route.params.sn
|
|
|
|
+ // 是否默认打印原厂编码
|
|
|
|
+ vm.printOrgCode = localStorage.getItem('printOrgCode-' + this.$store.state.user.info.orgId) == 'true'
|
|
vm.getOrderDetail(true)
|
|
vm.getOrderDetail(true)
|
|
vm.$refs.table.refresh(true)
|
|
vm.$refs.table.refresh(true)
|
|
})
|
|
})
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ watch: {
|
|
|
|
+ printOrgCode (newValue, oldValue) {
|
|
|
|
+ localStorage.setItem('printOrgCode-' + this.$store.state.user.info.orgId, newValue)
|
|
|
|
+ }
|
|
|
|
+ },
|
|
mounted () {
|
|
mounted () {
|
|
this.showPage = true
|
|
this.showPage = true
|
|
if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
|
|
if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
|