|
@@ -27,7 +27,7 @@
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
- <a-form-item label="打印状态">
|
|
|
|
|
|
+ <a-form-item label="备货打印状态">
|
|
<v-select
|
|
<v-select
|
|
v-model="queryParam.printStatus"
|
|
v-model="queryParam.printStatus"
|
|
ref="printStatus"
|
|
ref="printStatus"
|
|
@@ -156,66 +156,88 @@
|
|
</template>
|
|
</template>
|
|
<!-- 操作 -->
|
|
<!-- 操作 -->
|
|
<template slot="action" slot-scope="text, record">
|
|
<template slot="action" slot-scope="text, record">
|
|
- <a-button
|
|
|
|
- size="small"
|
|
|
|
- type="link"
|
|
|
|
- class="button-warning"
|
|
|
|
- v-if="record.billStatus == 'WAIT_AUDIT'&&$hasPermissions('B_salesAudit')"
|
|
|
|
- @click="handleDetail(record)"
|
|
|
|
- >审核</a-button>
|
|
|
|
- <a-button
|
|
|
|
- size="small"
|
|
|
|
- type="link"
|
|
|
|
- class="button-warning"
|
|
|
|
- v-if="record.billStatus == 'WAIT_PUSH'&&$hasPermissions('B_salesDispatch')"
|
|
|
|
- @click="handleDispatch(record)"
|
|
|
|
- >下推</a-button>
|
|
|
|
- <a-button
|
|
|
|
- size="small"
|
|
|
|
- type="link"
|
|
|
|
- class="button-info"
|
|
|
|
- v-if="(record.salesBillSource == 'SALES' && (record.billStatus == 'WAIT_SUBMIT' || record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'AUDIT_REJECT' || record.billStatus == 'HQ_CHANGE'))&&$hasPermissions('B_salesEdit')"
|
|
|
|
- @click="handleEdit(record)"
|
|
|
|
- >
|
|
|
|
- 编辑
|
|
|
|
- </a-button>
|
|
|
|
- <a-button
|
|
|
|
- size="small"
|
|
|
|
- type="link"
|
|
|
|
- class="button-info"
|
|
|
|
- v-if="record.salesBillSource == 'PURCHASE' && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'HQ_CHANGE') && $hasPermissions('B_salesEdit')"
|
|
|
|
- @click="handleEdit(record)"
|
|
|
|
- >
|
|
|
|
- 改单
|
|
|
|
- </a-button>
|
|
|
|
- <a-button
|
|
|
|
- size="small"
|
|
|
|
- type="link"
|
|
|
|
- class="button-error"
|
|
|
|
- v-if="(record.salesBillSource == 'SALES' && (record.billStatus == 'WAIT_SUBMIT' || record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'AUDIT_REJECT' || record.billStatus == 'HQ_CHANGE'))&&$hasPermissions('B_salesDel')"
|
|
|
|
- @click="handleDel(record)"
|
|
|
|
- >
|
|
|
|
- 删除
|
|
|
|
- </a-button>
|
|
|
|
- <a-button
|
|
|
|
- size="small"
|
|
|
|
- type="link"
|
|
|
|
- class="button-error"
|
|
|
|
- v-if="record.salesBillSource == 'PURCHASE' && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'HQ_CHANGE') && $hasPermissions('B_salesDel')"
|
|
|
|
- @click="handleDel(record)"
|
|
|
|
- >
|
|
|
|
- 取消
|
|
|
|
- </a-button>
|
|
|
|
- <span
|
|
|
|
- v-if="!(record.billStatus == 'WAIT_AUDIT'&&$hasPermissions('B_salesAudit')) &&
|
|
|
|
- !(record.billStatus == 'WAIT_PUSH'&&$hasPermissions('B_salesDispatch')) &&
|
|
|
|
- !(record.salesBillSource == 'SALES' && (record.billStatus == 'WAIT_SUBMIT' || record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'AUDIT_REJECT' || record.billStatus == 'HQ_CHANGE')&&($hasPermissions('B_salesEdit') || $hasPermissions('B_salesDel'))) &&
|
|
|
|
- !(record.salesBillSource == 'PURCHASE' && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'HQ_CHANGE') && ($hasPermissions('B_salesEdit') || $hasPermissions('B_salesDel')))">--</span>
|
|
|
|
|
|
+ <div>
|
|
|
|
+ <a-button
|
|
|
|
+ size="small"
|
|
|
|
+ type="link"
|
|
|
|
+ class="button-warning"
|
|
|
|
+ v-if="record.billStatus == 'WAIT_AUDIT'&&$hasPermissions('B_salesAudit')"
|
|
|
|
+ @click="handleDetail(record)"
|
|
|
|
+ >审核</a-button>
|
|
|
|
+ <a-button
|
|
|
|
+ size="small"
|
|
|
|
+ type="link"
|
|
|
|
+ class="button-warning"
|
|
|
|
+ v-if="record.billStatus == 'WAIT_PUSH'&&$hasPermissions('B_salesDispatch')"
|
|
|
|
+ @click="handleDispatch(record)"
|
|
|
|
+ >下推</a-button>
|
|
|
|
+ <a-button
|
|
|
|
+ size="small"
|
|
|
|
+ type="link"
|
|
|
|
+ class="button-info"
|
|
|
|
+ v-if="(record.salesBillSource == 'SALES' && (record.billStatus == 'WAIT_SUBMIT' || record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'AUDIT_REJECT' || record.billStatus == 'HQ_CHANGE'))&&$hasPermissions('B_salesEdit')"
|
|
|
|
+ @click="handleEdit(record)"
|
|
|
|
+ >
|
|
|
|
+ 编辑
|
|
|
|
+ </a-button>
|
|
|
|
+ <a-button
|
|
|
|
+ size="small"
|
|
|
|
+ type="link"
|
|
|
|
+ class="button-info"
|
|
|
|
+ v-if="record.salesBillSource == 'PURCHASE' && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'HQ_CHANGE') && $hasPermissions('B_salesEdit')"
|
|
|
|
+ @click="handleEdit(record)"
|
|
|
|
+ >
|
|
|
|
+ 改单
|
|
|
|
+ </a-button>
|
|
|
|
+ <a-button
|
|
|
|
+ size="small"
|
|
|
|
+ type="link"
|
|
|
|
+ class="button-error"
|
|
|
|
+ v-if="(record.salesBillSource == 'SALES' && (record.billStatus == 'WAIT_SUBMIT' || record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'AUDIT_REJECT' || record.billStatus == 'HQ_CHANGE'))&&$hasPermissions('B_salesDel')"
|
|
|
|
+ @click="handleDel(record)"
|
|
|
|
+ >
|
|
|
|
+ 删除
|
|
|
|
+ </a-button>
|
|
|
|
+ <a-button
|
|
|
|
+ size="small"
|
|
|
|
+ type="link"
|
|
|
|
+ class="button-error"
|
|
|
|
+ v-if="record.salesBillSource == 'PURCHASE' && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'HQ_CHANGE') && $hasPermissions('B_salesDel')"
|
|
|
|
+ @click="handleDel(record)"
|
|
|
|
+ >
|
|
|
|
+ 取消
|
|
|
|
+ </a-button>
|
|
|
|
+ <a-button
|
|
|
|
+ size="small"
|
|
|
|
+ type="link"
|
|
|
|
+ class="button-warning"
|
|
|
|
+ v-if="record.printStatus=='UNABLE_PRINT'&&$hasPermissions('B_Sales_UNABLE_PRINT')"
|
|
|
|
+ @click="handlePrint(record)"
|
|
|
|
+ >允许备货打印</a-button>
|
|
|
|
+ </div>
|
|
</template>
|
|
</template>
|
|
</s-table>
|
|
</s-table>
|
|
</a-spin>
|
|
</a-spin>
|
|
<!-- 选择客户弹框 -->
|
|
<!-- 选择客户弹框 -->
|
|
<choose-custom-modal :show="openModal" @ok="chooseCustomOk" @cancel="openModal=false"></choose-custom-modal>
|
|
<choose-custom-modal :show="openModal" @ok="chooseCustomOk" @cancel="openModal=false"></choose-custom-modal>
|
|
|
|
+ <!-- 操作提示 -->
|
|
|
|
+ <commonModal modalTit="操作提示" :width="this.tipData&&this.tipData.length == 1?'500px':'800px'" :openModal="showTipModal" @cancel="canselModal" @ok="updatePrintStatus">
|
|
|
|
+ <div style="text-align: center;" v-if="this.tipData&&this.tipData.length">
|
|
|
|
+ <div style="margin-bottom: 15px;font-size: 14px;"><strong>确认允许此单进行备货打印吗?</strong></div>
|
|
|
|
+ <div style="line-height: 24px;" v-if="this.tipData.length == 1">
|
|
|
|
+ <div>备货单号:{{ tipData[0]&&tipData[0].dispatchBillNo }}</div>
|
|
|
|
+ <div>客户名称:{{ tipData[0]&&tipData[0].buyerName }}</div>
|
|
|
|
+ </div>
|
|
|
|
+ <div v-else>
|
|
|
|
+ <a-table
|
|
|
|
+ :row-selection="{ selectedRowKeys: selectedRowKeys,onChange: onSelectChange, getCheckboxProps: record => ({ props: { disabled: record.printStatus!=='UNABLE_PRINT' }})}"
|
|
|
|
+ :columns="bhColumns"
|
|
|
|
+ :data-source="tipData"
|
|
|
|
+ :pagination="false"
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </commonModal>
|
|
</a-card>
|
|
</a-card>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -227,20 +249,22 @@ import subarea from '@/views/common/subarea.js'
|
|
import { getArea } from '@/api/data'
|
|
import { getArea } from '@/api/data'
|
|
import rangeDate from '@/views/common/rangeDate.vue'
|
|
import rangeDate from '@/views/common/rangeDate.vue'
|
|
import { STable, VSelect } from '@/components'
|
|
import { STable, VSelect } from '@/components'
|
|
|
|
+import commonModal from '@/views/common/commonModal.vue'
|
|
import chooseCustomModal from './chooseCustomModal.vue'
|
|
import chooseCustomModal from './chooseCustomModal.vue'
|
|
import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
|
|
import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
|
|
import { salesList, salesDel, salesCount } from '@/api/sales'
|
|
import { salesList, salesDel, salesCount } from '@/api/sales'
|
|
-import { findBySalesBillSn } from '@/api/dispatch'
|
|
|
|
|
|
+import { findBySalesBillSn, dispatchBatchPrintStatus, queryBySalesBillSn } from '@/api/dispatch'
|
|
export default {
|
|
export default {
|
|
name: 'SalesQueryList',
|
|
name: 'SalesQueryList',
|
|
mixins: [commonMixin],
|
|
mixins: [commonMixin],
|
|
- components: { STable, VSelect, chooseCustomModal, dealerSubareaScopeList, rangeDate, subarea },
|
|
|
|
|
|
+ components: { STable, VSelect, chooseCustomModal, dealerSubareaScopeList, rangeDate, subarea, commonModal },
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
spinning: false,
|
|
spinning: false,
|
|
advanced: false, // 高级搜索 展开/关闭
|
|
advanced: false, // 高级搜索 展开/关闭
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
openModal: false, // 选择客户弹框是否显示
|
|
openModal: false, // 选择客户弹框是否显示
|
|
|
|
+ showTipModal: false, // 备货打印弹框
|
|
tableHeight: 0,
|
|
tableHeight: 0,
|
|
time: [
|
|
time: [
|
|
moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
|
|
moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
|
|
@@ -299,7 +323,25 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
addrProvinceList: [], // 省下拉
|
|
addrProvinceList: [], // 省下拉
|
|
- showCancelNum: false // 是否显示取消数量和待下推数量
|
|
|
|
|
|
+ showCancelNum: false, // 是否显示取消数量和待下推数量
|
|
|
|
+ tipData: null, // 备货单信息
|
|
|
|
+ tempSalesBillSn: null,
|
|
|
|
+ // 允许备货打印
|
|
|
|
+ selectedRowKeys: [],
|
|
|
|
+ bhColumns: [
|
|
|
|
+ {
|
|
|
|
+ title: '备货单号',
|
|
|
|
+ dataIndex: 'dispatchBillNo'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '客户名称',
|
|
|
|
+ dataIndex: 'buyerName'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '备货打印状态',
|
|
|
|
+ dataIndex: 'printStatusDictValue'
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -307,7 +349,6 @@ export default {
|
|
const arr = [
|
|
const arr = [
|
|
{ title: '创建时间', dataIndex: 'createDate', width: '6%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
|
|
{ title: '创建时间', dataIndex: 'createDate', width: '6%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
|
|
{ title: '销售单号', scopedSlots: { customRender: 'salesBillNo' }, width: '7%', align: 'center' },
|
|
{ title: '销售单号', scopedSlots: { customRender: 'salesBillNo' }, width: '7%', align: 'center' },
|
|
- // { title: '采购单号', dataIndex: 'purchaseBillNo', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
{ title: '提交时间', dataIndex: 'submitDate', width: '6%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
|
|
{ title: '提交时间', dataIndex: 'submitDate', width: '6%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
|
|
{ title: '客户名称', dataIndex: 'buyerName', width: '8%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
{ title: '客户名称', dataIndex: 'buyerName', width: '8%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
{ title: '总数量', dataIndex: 'totalQty', scopedSlots: { customRender: 'totalQty' }, width: '4%', align: 'center' },
|
|
{ title: '总数量', dataIndex: 'totalQty', scopedSlots: { customRender: 'totalQty' }, width: '4%', align: 'center' },
|
|
@@ -320,7 +361,7 @@ export default {
|
|
{ title: '最近备货时间', dataIndex: 'lastStockUpDate', width: '6%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
|
|
{ title: '最近备货时间', dataIndex: 'lastStockUpDate', width: '6%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
|
|
{ title: '业务状态', dataIndex: 'billStatusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '业务状态', dataIndex: 'billStatusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '财务状态', dataIndex: 'financialStatusDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '财务状态', dataIndex: 'financialStatusDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
- { title: '打印次数', dataIndex: 'detailPrintTimes', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
|
|
+ { title: '备货打印状态', dataIndex: 'printStatusDictValue', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }
|
|
]
|
|
]
|
|
if (this.showCancelNum) {
|
|
if (this.showCancelNum) {
|
|
@@ -392,6 +433,55 @@ export default {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ // 允许备货打印
|
|
|
|
+ handlePrint (row) {
|
|
|
|
+ // 获取关联的下推单
|
|
|
|
+ this.tempSalesBillSn = row.salesBillSn
|
|
|
|
+ queryBySalesBillSn({ salesBillSn: row.salesBillSn }).then(res => {
|
|
|
|
+ this.tipData = res.data || []
|
|
|
|
+ this.tipData.map(item => {
|
|
|
|
+ item.key = item.dispatchBillSn
|
|
|
|
+ if (item.printStatus == 'UNABLE_PRINT') {
|
|
|
|
+ this.selectedRowKeys.push(item.dispatchBillSn)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ this.showTipModal = true
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ canselModal () {
|
|
|
|
+ this.tipData = null
|
|
|
|
+ this.showTipModal = false
|
|
|
|
+ this.tempSalesBillSn = null
|
|
|
|
+ this.selectedRowKeys = []
|
|
|
|
+ },
|
|
|
|
+ onSelectChange (selectedRowKeys) {
|
|
|
|
+ this.selectedRowKeys = selectedRowKeys
|
|
|
|
+ },
|
|
|
|
+ // 允许备货打印状态
|
|
|
|
+ updatePrintStatus () {
|
|
|
|
+ const isOne = this.tipData.length
|
|
|
|
+ if (isOne > 1 && this.selectedRowKeys.length == 0) {
|
|
|
|
+ this.$message.info('请选择备货单!')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ const dispatchBillSnList = []
|
|
|
|
+ this.tipData.map(item => {
|
|
|
|
+ dispatchBillSnList.push(item.dispatchBillSn)
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ const params = {
|
|
|
|
+ 'salesBillSn': this.tempSalesBillSn,
|
|
|
|
+ 'dispatchBillSnList': isOne > 1 ? this.selectedRowKeys : dispatchBillSnList,
|
|
|
|
+ 'printStatus': 'NO_PRINT'
|
|
|
|
+ }
|
|
|
|
+ dispatchBatchPrintStatus(params).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ this.canselModal()
|
|
|
|
+ this.$message.info(res.message)
|
|
|
|
+ this.$refs.table.refresh()
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
// 重置
|
|
// 重置
|
|
resetSearchForm () {
|
|
resetSearchForm () {
|
|
this.$refs.rangeDate.resetDate(this.time)
|
|
this.$refs.rangeDate.resetDate(this.time)
|