|
@@ -0,0 +1,292 @@
|
|
|
+<template>
|
|
|
+ <a-card size="small" :bordered="false" class="salesOrderWarehouseList-wrap">
|
|
|
+ <a-spin :spinning="spinning" tip="Loading...">
|
|
|
+ <!-- 搜索条件 -->
|
|
|
+ <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="rangeDate" :value="time" @change="dateChange" />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="客户名称">
|
|
|
+ <a-input id="salesOrderWarehouseList-demanderName" v-model.trim="queryParam.demanderName" allowClear placeholder="请输入客户名称"/>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="销售单号">
|
|
|
+ <a-input id="salesOrderWarehouseList-outBizNo" v-model.trim="queryParam.outBizNo" allowClear placeholder="请输入销售单号"/>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="业务状态">
|
|
|
+ <v-select
|
|
|
+ v-model="queryParam.state"
|
|
|
+ ref="state"
|
|
|
+ id="salesOrderWarehouseList-state"
|
|
|
+ code="OUT_STATE"
|
|
|
+ placeholder="请选择业务状态"
|
|
|
+ allowClear></v-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-model-item label="地区" prop="shippingAddrProvinceSn">
|
|
|
+ <Area id="salesOrderWarehouseList-shippingAddrProvinceSn" v-model="queryParam.shippingAddrProvinceSn" placeholder="请选择省"></Area>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24" v-show="isShowWarehouse">
|
|
|
+ <a-form-model-item label="出库仓库">
|
|
|
+ <chooseWarehouse ref="warehouse" v-model="queryParam.warehouseSn" :isPermission="true"></chooseWarehouse>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
|
|
|
+ <a-button type="primary" @click="searchTable" :disabled="disabled" id="salesOrderWarehouseList-refresh">查询</a-button>
|
|
|
+ <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesOrderWarehouseList-reset">重置</a-button>
|
|
|
+ <a-button
|
|
|
+ style="margin-left: 10px"
|
|
|
+ type="primary"
|
|
|
+ class="button-warning"
|
|
|
+ @click="handleExport"
|
|
|
+ :disabled="disabled"
|
|
|
+ :loading="exportLoading"
|
|
|
+ >导出</a-button>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ </a-form>
|
|
|
+ </div>
|
|
|
+ <!-- alert -->
|
|
|
+ <a-alert type="info" style="margin-bottom:10px">
|
|
|
+ <div slot="message">
|
|
|
+ 总单数:<strong>{{ totalData&&(totalData.totalRecord || totalData.totalRecord==0) ? totalData.totalRecord : '--' }}</strong>;
|
|
|
+ 总款数:<strong>{{ totalData&&(totalData.totalCategory || totalData.totalCategory==0) ? totalData.totalCategory : '--' }}</strong>;
|
|
|
+ 总数量:<strong>{{ totalData&&(totalData.totalQty || totalData.totalQty==0) ? totalData.totalQty : '--' }}</strong>;
|
|
|
+ </div>
|
|
|
+ </a-alert>
|
|
|
+ <!-- 列表 -->
|
|
|
+ <s-table
|
|
|
+ class="sTable fixPagination"
|
|
|
+ ref="table"
|
|
|
+ :style="{ height: tableHeight+84.5+'px' }"
|
|
|
+ size="small"
|
|
|
+ :rowKey="(record) => record.stockOutSn"
|
|
|
+ rowKeyName="stockOutSn"
|
|
|
+ :columns="columns"
|
|
|
+ :data="loadData"
|
|
|
+ :scroll="{ y: tableHeight }"
|
|
|
+ :defaultLoadData="false"
|
|
|
+ bordered>
|
|
|
+ <!-- 单号 -->
|
|
|
+ <template slot="stockOutNo" slot-scope="text, record">
|
|
|
+ <span class="link-bule" @click="handleDetail(record)">{{ record.stockOutNo }}</span>
|
|
|
+ </template>
|
|
|
+ </s-table>
|
|
|
+ </a-spin>
|
|
|
+ </a-card>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { commonMixin } from '@/utils/mixin'
|
|
|
+import moment from 'moment'
|
|
|
+import rangeDate from '@/views/common/rangeDate.vue'
|
|
|
+import getDate from '@/libs/getDate.js'
|
|
|
+import subarea from '@/views/common/subarea.js'
|
|
|
+import Area from '@/views/common/area.js'
|
|
|
+import pushOrderDetailModal from '@/views/salesManagement/pushOrderManagement/detail.vue'
|
|
|
+import allocationDetailModal from '@/views/allocationManagement/transferOut/detail.vue'
|
|
|
+import { STable, VSelect } from '@/components'
|
|
|
+import chooseWarehouse from '@/views/common/chooseWarehouse'
|
|
|
+import { stockOutList, stockOutOut } from '@/api/stockOut'
|
|
|
+import { getCustomerInfo, validateStockOut } from '@/api/sendBill'
|
|
|
+import { hdExportExcel } from '@/libs/exportExcel'
|
|
|
+export default {
|
|
|
+ name: 'SalesOrderWarehouseList',
|
|
|
+ mixins: [commonMixin],
|
|
|
+ components: { STable, VSelect, rangeDate, pushOrderDetailModal, allocationDetailModal, subarea, Area, chooseWarehouse },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ spinning: false,
|
|
|
+ advanced: true, // 高级搜索 展开/关闭
|
|
|
+ tableHeight: 0,
|
|
|
+ time: [
|
|
|
+ moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
|
|
|
+ moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
|
|
|
+ ],
|
|
|
+ exportLoading: false,
|
|
|
+ queryParam: { // 查询条件
|
|
|
+ beginDate: getDate.getThreeMonthDays().starttime,
|
|
|
+ endDate: getDate.getCurrMonthDays().endtime,
|
|
|
+ demanderName: '', // 客户名称
|
|
|
+ outBizType: undefined, // 出库类型
|
|
|
+ stockOutNo: '',
|
|
|
+ outBizNo: '',
|
|
|
+ state: undefined, // 状态
|
|
|
+ subareaArea: {
|
|
|
+ subareaSn: undefined,
|
|
|
+ subareaAreaSn: undefined
|
|
|
+ },
|
|
|
+ shippingAddrProvinceSn: undefined,
|
|
|
+ sendFlag: undefined,
|
|
|
+ warehouseSn: undefined
|
|
|
+ },
|
|
|
+ disabled: false, // 查询、重置按钮是否可操作
|
|
|
+ loading: false,
|
|
|
+ // 加载数据方法 必须为 Promise 对象
|
|
|
+ loadData: parameter => {
|
|
|
+ this.disabled = true
|
|
|
+ this.spinning = true
|
|
|
+ return stockOutList(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
|
|
|
+ })
|
|
|
+ },
|
|
|
+ openModal: false,
|
|
|
+ orderSn: undefined,
|
|
|
+ outBizType: null, // 当前单子类型 SALES销售出库 ALLOCATE调拨出库
|
|
|
+ rowSelectionInfo: null,
|
|
|
+ showDetailModal: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ isShowWarehouse () {
|
|
|
+ return this.$store.state.app.isWarehouse
|
|
|
+ },
|
|
|
+ columns () {
|
|
|
+ const arr = [
|
|
|
+ { title: '序号', dataIndex: 'no', width: '6%', align: 'center' },
|
|
|
+ { title: '创建时间', dataIndex: 'createDate', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '销售单号', scopedSlots: { customRender: 'stockOutNo' }, width: '10%', align: 'center' },
|
|
|
+ { title: '提交时间', dataIndex: 'auditTime', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '客户名称', dataIndex: 'demanderName', width: '30%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '总数量', dataIndex: 'productTotalQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '业务状态', dataIndex: 'sendFlagDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
|
|
|
+ ]
|
|
|
+ if (this.isShowWarehouse) {
|
|
|
+ arr.splice(5, 0, { title: '出库仓库', dataIndex: 'warehouseName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true })
|
|
|
+ }
|
|
|
+ return arr
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 导出
|
|
|
+ handleExport () {
|
|
|
+ const _this = this
|
|
|
+ _this.$store.state.app.curActionPermission = 'B_sales_export'
|
|
|
+ _this.exportLoading = true
|
|
|
+ _this.spinning = true
|
|
|
+ hdExportExcel(salesDetailExport, _this.queryParam, '销售明细', function () {
|
|
|
+ _this.exportLoading = false
|
|
|
+ _this.spinning = false
|
|
|
+ _this.showExport = true
|
|
|
+ _this.$store.state.app.curActionPermission = ''
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 时间 change
|
|
|
+ dateChange (date) {
|
|
|
+ this.queryParam.beginDate = date[0]
|
|
|
+ this.queryParam.endDate = date[1]
|
|
|
+ },
|
|
|
+ subareaChange (val) {
|
|
|
+ this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
|
|
|
+ this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
|
|
|
+ },
|
|
|
+ // 重置
|
|
|
+ resetSearchForm () {
|
|
|
+ this.$refs.rangeDate.resetDate(this.time)
|
|
|
+ this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
|
|
|
+ this.queryParam.endDate = getDate.getCurrMonthDays().endtime
|
|
|
+ this.queryParam.demanderName = ''
|
|
|
+ this.queryParam.outBizType = undefined
|
|
|
+ this.queryParam.state = undefined
|
|
|
+ this.queryParam.stockOutNo = ''
|
|
|
+ this.queryParam.outBizNo = ''
|
|
|
+ this.queryParam.subareaArea.subareaSn = undefined
|
|
|
+ this.queryParam.subareaArea.subareaAreaSn = undefined
|
|
|
+ this.queryParam.shippingAddrProvinceSn = undefined
|
|
|
+ this.queryParam.sendFlag = undefined
|
|
|
+ this.queryParam.warehouseSn = undefined
|
|
|
+ this.$refs.table.refresh(true)
|
|
|
+ },
|
|
|
+ // 详情
|
|
|
+ handleDetail (row) {
|
|
|
+ this.$router.push({ path: `/salesManagement/salesOrderWarehouse/detail/${row.allocateSn}` })
|
|
|
+ },
|
|
|
+ // 获取客户信息
|
|
|
+ async getCustome (data, stockOutSnList) {
|
|
|
+ this.spinning = true
|
|
|
+ const customer = await getCustomerInfo({ stockOutSnList: stockOutSnList })
|
|
|
+ const validRet = await validateStockOut({ stockOutSnList, ...customer.data })
|
|
|
+ if (validRet.status == 200) {
|
|
|
+ this.showDetailModal = true
|
|
|
+ this.$refs.detailModal.setData(data, customer.data)
|
|
|
+ this.spinning = false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ pageInit () {
|
|
|
+ const _this = this
|
|
|
+ this.$nextTick(() => { // 页面渲染完成后的回调
|
|
|
+ _this.setTableH()
|
|
|
+ })
|
|
|
+ this.rowSelectionInfo = null
|
|
|
+ this.$refs.table.clearSelected()
|
|
|
+ },
|
|
|
+ setTableH () {
|
|
|
+ const tableSearchH = this.$refs.tableSearch.offsetHeight
|
|
|
+ this.tableHeight = window.innerHeight - tableSearchH - 245
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 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">
|
|
|
+ .salesOrderWarehouseList-wrap{
|
|
|
+ .active{
|
|
|
+ color: #ed1c24;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ .common{
|
|
|
+ color: rgba(0, 0, 0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+</style>
|