|
@@ -0,0 +1,277 @@
|
|
|
|
+<template>
|
|
|
|
+ <div>
|
|
|
|
+ <a-card size="small" :bordered="false" class="searchBoxNormal">
|
|
|
|
+ <!-- 搜索条件 -->
|
|
|
|
+ <div ref="tableSearch" class="table-page-search-wrapper">
|
|
|
|
+ <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
|
|
|
|
+ <a-row :gutter="15">
|
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
|
+ <a-form-item label="退货日期">
|
|
|
|
+ <rangeDate ref="rangeCreateDate" id="salesReturnRemove-createDate" :value="createDate" @change="dateCreateChange" />
|
|
|
|
+ </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="salesReturnRemove-buyerSn" @change="custChange" />
|
|
|
|
+ </a-form-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
|
+ <a-form-item label="总部销退单号">
|
|
|
|
+ <a-input id="salesReturnRemove-salesReturnBillNo" v-model.trim="queryParam.salesReturnBillNo" allowClear placeholder="请输入总部销退单号"/>
|
|
|
|
+ </a-form-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
|
+ <span class="table-page-search-submitButtons">
|
|
|
|
+ <a-button id="salesReturnRemove-search" type="primary" :disabled="disabled" @click="$refs.table.refresh(true)">查询</a-button>
|
|
|
|
+ <a-button id="salesReturnRemove-reset" style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
|
|
|
|
+ <a-button
|
|
|
|
+ style="margin-left: 10px"
|
|
|
|
+ type="primary"
|
|
|
|
+ class="button-warning"
|
|
|
|
+ @click="handleExport"
|
|
|
|
+ :disabled="disabled"
|
|
|
|
+ :loading="exportLoading"
|
|
|
|
+ id="salesReturnRemove-export">导出</a-button>
|
|
|
|
+ </span>
|
|
|
|
+ </a-col>
|
|
|
|
+ </a-row>
|
|
|
|
+ </a-form>
|
|
|
|
+ </div>
|
|
|
|
+ <a-spin :spinning="spinning" tip="Loading...">
|
|
|
|
+ <div class="table-operator" style="flex-grow: 1;display: flex;justify-content: space-between;align-items: center;">
|
|
|
|
+ <div style="flex-grow: 1;display: flex;align-items: center;">
|
|
|
|
+ <!-- 操作按钮 -->
|
|
|
|
+ <div>
|
|
|
|
+ <a-button type="primary" v-if="$hasPermissions('B_salesReturnNew')" @click="handleEdit">新增</a-button>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div></div>
|
|
|
|
+ </div>
|
|
|
|
+ <!-- 列表 -->
|
|
|
|
+ <s-table
|
|
|
|
+ class="sTable fixPagination"
|
|
|
|
+ ref="table"
|
|
|
|
+ :style="{ height: tableHeight+75+'px' }"
|
|
|
|
+ size="small"
|
|
|
|
+ :rowKey="(record) => record.id"
|
|
|
|
+ :columns="columns"
|
|
|
|
+ :data="loadData"
|
|
|
|
+ :scroll="{ y: tableHeight }"
|
|
|
|
+ :defaultLoadData="false"
|
|
|
|
+ bordered>
|
|
|
|
+ <!-- 操作 -->
|
|
|
|
+ <template slot="action" slot-scope="text, record, index">
|
|
|
|
+ <div>
|
|
|
|
+ <a-button
|
|
|
|
+ size="small"
|
|
|
|
+ type="link"
|
|
|
|
+ class="button-info"
|
|
|
|
+ @click="handleEdit(record)"
|
|
|
|
+ :id="'salesReturnRemove-edit-btn'+index">编辑</a-button>
|
|
|
|
+ <a-button
|
|
|
|
+ size="small"
|
|
|
|
+ type="link"
|
|
|
|
+ class="button-error"
|
|
|
|
+ @click="handleDel(record)"
|
|
|
|
+ :id="'salesReturnRemove-del-btn'+index">删除</a-button>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </s-table>
|
|
|
|
+ </a-spin>
|
|
|
|
+ <!-- 选择客户弹框 -->
|
|
|
|
+ <baseModal :show="openModal" ref="openModal" @ok="handleEdit" @cancel="openModal=false"></baseModal>
|
|
|
|
+ </a-card>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+import { commonMixin } from '@/utils/mixin'
|
|
|
|
+import { STable, VSelect } from '@/components'
|
|
|
|
+import baseModal from './baseModal.vue'
|
|
|
|
+import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
|
|
|
|
+import rangeDate from '@/views/common/rangeDate.vue'
|
|
|
|
+import { salesReturnList, salesReturnQueryCount, salesReturnDel, salesReturnCancelBill, salesReturnSubmit, submitVerify } from '@/api/salesReturn'
|
|
|
|
+import moment from 'moment'
|
|
|
|
+import getDate from '@/libs/getDate.js'
|
|
|
|
+export default {
|
|
|
|
+ name: 'SalesReturnList',
|
|
|
|
+ mixins: [commonMixin],
|
|
|
|
+ components: {
|
|
|
|
+ STable,
|
|
|
|
+ VSelect,
|
|
|
|
+ baseModal,
|
|
|
|
+ dealerSubareaScopeList,
|
|
|
|
+ rangeDate
|
|
|
|
+ },
|
|
|
|
+ data () {
|
|
|
|
+ return {
|
|
|
|
+ spinning: false,
|
|
|
|
+ // 高级搜索 展开/关闭
|
|
|
|
+ advanced: true,
|
|
|
|
+ tableHeight: 0,
|
|
|
|
+ disabled: false, // 查询、重置按钮是否可操作
|
|
|
|
+ exportLoading: false,
|
|
|
|
+ createDate: [
|
|
|
|
+ moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
|
|
|
|
+ moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
|
|
|
|
+ ], // 创建时间
|
|
|
|
+ openModal: false, // 选择客户弹框是否显示
|
|
|
|
+ openDepartUserModal: false,
|
|
|
|
+ // 查询参数
|
|
|
|
+ queryParam: {
|
|
|
|
+ beginDate: getDate.getThreeMonthDays().starttime,
|
|
|
|
+ endDate: getDate.getCurrMonthDays().endtime,
|
|
|
|
+ buyerSn: undefined, // 客户名称
|
|
|
|
+ salesReturnBillNo: undefined // 总部销退单号
|
|
|
|
+ },
|
|
|
|
+ // 加载数据方法 必须为 Promise 对象
|
|
|
|
+ loadData: parameter => {
|
|
|
|
+ this.disabled = true
|
|
|
|
+ this.spinning = true
|
|
|
|
+ const params = Object.assign(parameter, this.queryParam)
|
|
|
|
+ return salesReturnList(params).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
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ visibleAudit: false
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ computed: {
|
|
|
|
+ columns () {
|
|
|
|
+ const arr = [
|
|
|
|
+ { title: '编号', dataIndex: 'no', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '总部销退单号', dataIndex: 'salesReturnBillNo', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '退货日期', dataIndex: 'createDate', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '客户名称', dataIndex: 'buyerName', width: '10%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
+ { title: '全国销售日报', dataIndex: 'goodFlagDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '项目销售日报1', dataIndex: 'salesReturnTypeDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '项目销售日报2', dataIndex: 'billStatusDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '分区销售日报', dataIndex: 'billStatusDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '创建时间', dataIndex: 'billStatusDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '操作', scopedSlots: { customRender: 'action' }, width: '6%', align: 'center' }
|
|
|
|
+ ]
|
|
|
|
+ return arr
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ // 创建时间 change
|
|
|
|
+ dateCreateChange (date) {
|
|
|
|
+ this.queryParam.beginDate = date[0]
|
|
|
|
+ this.queryParam.endDate = date[1]
|
|
|
|
+ },
|
|
|
|
+ // 选择客户
|
|
|
|
+ custChange (val) {
|
|
|
|
+ this.queryParam.buyerSn = val.key
|
|
|
|
+ },
|
|
|
|
+ // 导出 必填判断
|
|
|
|
+ handleExport () {
|
|
|
|
+ const _this = this
|
|
|
|
+ this.$refs.ruleForm.validate(valid => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ _this.exportList()
|
|
|
|
+ } else {
|
|
|
|
+ _this.$message.error('请选择时间')
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 导出
|
|
|
|
+ exportList () {
|
|
|
|
+ const _this = this
|
|
|
|
+ const params = JSON.parse(JSON.stringify(_this.queryParam))
|
|
|
|
+ _this.exportLoading = true
|
|
|
|
+ _this.spinning = true
|
|
|
|
+ hdExportExcel(manageAnalysisReportExport, params, '各品类经营分析表-' + this.monthVal + '-', function () {
|
|
|
|
+ _this.exportLoading = false
|
|
|
|
+ _this.spinning = false
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 编辑
|
|
|
|
+ handleEdit (row) {
|
|
|
|
+ this.openModal = true
|
|
|
|
+ this.$refs.openModal.edit(row)
|
|
|
|
+ },
|
|
|
|
+ // 删除
|
|
|
|
+ handleDel (row) {
|
|
|
|
+ const _this = this
|
|
|
|
+ this.$confirm({
|
|
|
|
+ title: '提示',
|
|
|
|
+ content: '确认要删除吗?',
|
|
|
|
+ centered: true,
|
|
|
|
+ onOk () {
|
|
|
|
+ _this.spinning = true
|
|
|
|
+ salesReturnDel({ salesReturnBillSn: row.salesReturnBillSn }).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ _this.$message.success(res.message)
|
|
|
|
+ _this.$refs.table.refresh()
|
|
|
|
+ }
|
|
|
|
+ _this.spinning = false
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ resetSearchForm () {
|
|
|
|
+ this.$refs.rangeCreateDate.resetDate(this.createDate)
|
|
|
|
+ this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
|
|
|
|
+ this.queryParam.endDate = getDate.getCurrMonthDays().endtime
|
|
|
|
+ this.queryParam.buyerSn = undefined
|
|
|
|
+ this.$refs.dealerSubareaScopeList.resetForm()
|
|
|
|
+ this.queryParam.salesReturnBillNo = ''
|
|
|
|
+
|
|
|
|
+ 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 - 305
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ 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>
|