123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313 |
- <template>
- <div class="matchSoo-wrap">
- <a-card style="margin-top: 5px;" size="small" :bordered="false">
- <a-spin :spinning="spinning" tip="Loading...">
- <!-- 搜索条件 -->
- <div ref="tableSearch" class="table-page-search-wrapper">
- <a-form layout="inline">
- <a-row :gutter="15">
- <a-col :md="6" :sm="24">
- <a-form-item label="创建时间">
- <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="24">
- <a-form-item label="客户名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
- <dealerSubareaScopeList ref="dealerSubareaScopeList" id="matchSoo-buyerName" @change="custChange" />
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="24">
- <a-form-item label="销售单号">
- <a-input id="matchSoo-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
- </a-form-item>
- </a-col>
- <template v-if="advanced">
- <a-col :md="6" :sm="24">
- <a-form-item label="备货单号">
- <a-input id="matchSoo-dispatchBillNo" v-model.trim="queryParam.dispatchBillNo" allowClear placeholder="请输入备货单号"/>
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="24">
- <a-form-item label="业务状态">
- <v-select
- v-model="queryParam.billStatus"
- ref="billStatus"
- id="matchSoo-billStatus"
- code="DISPATCH_BILL_STATUS"
- placeholder="请选择业务状态"
- allowClear></v-select>
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="24">
- <a-form-item label="单据状态">
- <v-select
- v-model="queryParam.billStatus"
- ref="billStatus"
- id="matchSoo-billStatus"
- code="DISPATCH_BILL_STATUS"
- placeholder="请选择单据状态"
- allowClear></v-select>
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="24">
- <a-form-item label="对单状态">
- <v-select
- v-model="queryParam.billStatus"
- ref="billStatus"
- id="matchSoo-billStatus"
- code="DISPATCH_BILL_STATUS"
- placeholder="请选择对单状态"
- allowClear></v-select>
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="24">
- <a-form-item label="对单时间">
- <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="24">
- <a-form-model-item label="所在区域">
- <subarea id="matchSoo-subarea" v-model="queryParam.subareaSn"></subarea>
- </a-form-model-item>
- </a-col>
- <a-col :md="6" :sm="24">
- <a-form-model-item label="地区">
- <a-form-model-item prop="shippingAddrProvinceSn">
- <Area id="matchSoo-shippingAddrProvinceSn" v-model="queryParam.shippingAddrProvinceSn" placeholder="请选择省"></Area>
- </a-form-model-item>
- </a-form-model-item>
- </a-form-model-item></a-col>
- </template>
- <a-col :md="6" :sm="24">
- <span class="table-page-search-submitButtons">
- <a-button type="primary" :disabled="disabled" @click="$refs.table.refresh(true)">查询</a-button>
- <a-button style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
- <a @click="advanced=!advanced" style="margin-left: 8px">
- {{ advanced ? '收起' : '展开' }}
- <a-icon :type="advanced ? 'up' : 'down'"/>
- </a>
- </span>
- </a-col>
- </a-row>
- </a-form>
- </div>
- <!-- 列表 -->
- <s-table
- class="sTable fixPagination"
- ref="table"
- :style="{ height: tableHeight+84.5+'px' }"
- size="small"
- :rowKey="(record) => record.id"
- :columns="columns"
- :data="loadData"
- :scroll="{ y:tableHeight }"
- :defaultLoadData="false"
- bordered>
- <!-- 销售单号 -->
- <template slot="salesBillNo" slot-scope="text, record">
- <span class="link-bule" v-if="$hasPermissions('B_salesDetail')" @click="handleDetail(record,0)">{{ record.salesBillNo }}</span>
- <span v-else>{{ record.salesBillNo }}</span>
- </template>
- <!-- 备货单号 -->
- <template slot="dispatchBillNo" slot-scope="text, record">
- <span class="link-bule" v-if="$hasPermissions('B_dispatchDetail')" @click="handleDetail(record,1)">{{ record.dispatchBillNo }}</span>
- <span v-else>{{ record.dispatchBillNo }}</span>
- </template>
- <!-- 操作 -->
- <template slot="action" slot-scope="text, record">
- <a-button
- size="small"
- type="link"
- class="button-warning"
- @click="handleAudit(record)"
- >对单通过</a-button>
- </template>
- </s-table>
- </a-spin>
- </a-card>
- </div>
- </template>
- <script>
- import { commonMixin } from '@/utils/mixin'
- import moment from 'moment'
- import getDate from '@/libs/getDate.js'
- import rangeDate from '@/views/common/rangeDate.vue'
- import { STable, VSelect } from '@/components'
- import subarea from '@/views/common/subarea.js'
- import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
- import Area from '@/views/common/area.js'
- import { dispatchlList, dispatchQueryCount } from '@/api/dispatch'
- export default {
- name: 'PushOrderManagementList',
- mixins: [commonMixin],
- components: { STable, VSelect, dealerSubareaScopeList, rangeDate, subarea, Area },
- data () {
- return {
- spinning: false,
- advanced: true, // 高级搜索 展开/关闭
- disabled: false, // 查询、重置按钮是否可操作
- tableHeight: 0,
- time: [
- moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
- moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
- ],
- // 查询参数
- queryParam: {
- beginDate: getDate.getThreeMonthDays().starttime,
- endDate: getDate.getCurrMonthDays().endtime,
- buyerSn: undefined, // 客户名称
- salesBillNo: '', // 销售单号
- dispatchBillNo: '', // 备货单号
- billStatus: undefined, // 业务状态
- subareaSn: undefined,
- shippingAddrProvinceSn: undefined
- },
- totalData: {
- totalAmount: 0,
- totalQty: 0,
- totalRecord: 0
- },
- // 加载数据方法 必须为 Promise 对象
- loadData: parameter => {
- this.disabled = true
- this.spinning = true
- // 查询总计
- dispatchQueryCount(Object.assign(parameter, this.queryParam)).then(res => {
- this.totalData = Object.assign(this.totalData, res.data || {})
- })
- return dispatchlList(Object.assign(parameter, this.queryParam)).then(res => {
- let data
- if (res.status == 200) {
- data = res.data
- const no = (data.pageNo - 1) * data.pageSize
- for (var i = 0; i < data.list.length; i++) {
- data.list[i].no = no + i + 1
- }
- this.disabled = false
- }
- this.spinning = false
- return data
- })
- }
- }
- },
- computed: {
- columns () {
- const arr = [
- { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
- { title: '创建时间', dataIndex: 'createDate', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
- { title: '销售单号', scopedSlots: { customRender: 'salesBillNo' }, width: '14%', align: 'center' },
- { title: '备货单号', scopedSlots: { customRender: 'dispatchBillNo' }, width: '14%', align: 'center' },
- { title: '发货编号', dataIndex: 'buyerName1', width: '6%', align: 'center' },
- { title: '客户名称', dataIndex: 'buyerName', width: '10%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
- { title: '收货客户名称', dataIndex: 'buyerName2', width: '10%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
- { title: '产品款数', dataIndex: 'totalQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
- { title: '产品数量', dataIndex: 'totalQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
- { 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: 'billStatusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
- { title: '对单人员', dataIndex: 'billStatusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
- { title: '对单时间', dataIndex: 'createDate', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
- { title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }
- ]
- return arr
- }
- },
- methods: {
- // 时间 change
- dateChange (date) {
- this.queryParam.beginDate = date[0]
- this.queryParam.endDate = date[1]
- },
- custChange (val) {
- this.queryParam.buyerSn = val.key
- },
- // 详情
- handleDetail (row, type) {
- if (type == 0) {
- this.$router.push({ name: 'salesDetail', params: { sn: row.salesBillSn, type: 'pushOrder' } })
- } else {
- this.$router.push({ name: 'pushOrderDetail', params: { sn: row.dispatchBillSn, type: 'pushOrder' } })
- }
- },
- // 允许打印
- handleAudit (row) {
- this.$confirm({
- title: '操作提示',
- content: '确认对单通过吗?',
- centered: true,
- onOk () {
- console.log('OK')
- }
- })
- },
- // 重置
- resetSearchForm () {
- this.$refs.rangeDate.resetDate(this.time)
- this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
- this.queryParam.endDate = getDate.getCurrMonthDays().endtime
- this.queryParam.buyerSn = undefined
- this.$refs.dealerSubareaScopeList.resetForm()
- this.queryParam.salesBillNo = ''
- this.queryParam.dispatchBillNo = ''
- this.queryParam.billStatus = undefined
- this.queryParam.subareaSn = undefined
- this.queryParam.shippingAddrProvinceSn = undefined
- this.$refs.table.refresh(true)
- },
- pageInit () {
- const _this = this
- this.$nextTick(() => { // 页面渲染完成后的回调
- _this.setTableH()
- })
- },
- setTableH () {
- const tableSearchH = this.$refs.tableSearch.offsetHeight
- this.tableHeight = window.innerHeight - tableSearchH - 210
- }
- },
- watch: {
- advanced (newValue, oldValue) {
- const _this = this
- this.$nextTick(() => { // 页面渲染完成后的回调
- _this.setTableH()
- })
- },
- '$store.state.app.winHeight' (newValue, oldValue) { // 窗口变更时,需同时更改表格高度
- this.setTableH()
- }
- },
- mounted () {
- if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
- this.pageInit()
- this.resetSearchForm()
- }
- },
- activated () {
- // 如果是新页签打开,则重置当前页面
- if (this.$store.state.app.isNewTab) {
- this.pageInit()
- this.resetSearchForm()
- }
- // 仅刷新列表,不重置页面
- if (this.$store.state.app.updateList) {
- this.pageInit()
- this.$refs.table.refresh()
- }
- },
- beforeRouteEnter (to, from, next) {
- next(vm => {})
- }
- }
- </script>
- <style lang="less">
- .matchSoo-wrap{
- .sTable{
- margin-top: 10px;
- }
- .ant-tabs-bar{
- margin:0;
- }
- }
- </style>
|