123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308 |
- <template>
- <a-card size="small" :bordered="false" class="salesManagementList-wrap">
- <!-- 搜索条件 -->
- <div class="table-page-search-wrapper">
- <a-form layout="inline">
- <a-row :gutter="15">
- <a-col :md="6" :sm="24">
- <a-form-item label="创建时间">
- <a-range-picker
- style="width:100%"
- id="salesManagementList-creatDate"
- :disabledDate="disabledDate"
- v-model="time"
- :format="dateFormat"
- :placeholder="['开始时间', '结束时间']" />
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="24">
- <a-form-item label="客户名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
- <a-select
- id="salesManagementList-buyerName"
- placeholder="请选择客户"
- allowClear
- v-model="queryParam.buyerName"
- :showSearch="true"
- option-filter-prop="children"
- :filter-option="filterOption">
- <a-select-option v-for="item in customeList" :key="item.salesChannelNo" :value="item.salesChannelNo">{{ item.salesChannelName }}</a-select-option>
- </a-select>
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="24">
- <a-form-item label="销售单号">
- <a-input id="salesManagementList-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="salesManagementList-purchaseBillNo" v-model.trim="queryParam.purchaseBillNo" allowClear placeholder="请输入采购单号"/>
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="24">
- <a-form-item label="支付方式">
- <v-select
- v-model="queryParam.payType"
- ref="payType"
- id="salesManagementList-payType"
- code="PAYMENT_TYPE"
- placeholder="请选择支付方式"
- allowClear></v-select>
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="24">
- <a-form-item label="收款方式">
- <v-select
- v-model="queryParam.settleStyle"
- ref="settleStyle"
- id="salesManagementList-settleStyle"
- code="PAYMENT_TYPE"
- placeholder="请选择收款方式"
- allowClear></v-select>
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="24">
- <a-form-item label="业务状态">
- <v-select
- v-model="queryParam.auditStatus"
- ref="auditStatus"
- id="salesManagementList-auditStatus"
- code="PAYMENT_TYPE"
- placeholder="请选择业务状态"
- allowClear></v-select>
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="24">
- <a-form-item label="财务状态">
- <v-select
- v-model="queryParam.financialStatus"
- ref="financialStatus"
- id="salesManagementList-financialStatus"
- code="PAYMENT_TYPE"
- placeholder="请选择财务状态"
- allowClear></v-select>
- </a-form-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>
- <!-- 操作按钮 -->
- <div class="table-operator">
- <a-button type="primary" @click="handleAdd">新增销售单</a-button>
- </div>
- <!-- alert -->
- <a-alert type="info" showIcon style="margin-bottom:15px">
- <div slot="message">总售价:<strong>13.00</strong>元;总单数:<strong>13.00</strong>;总款数:<strong>13.00</strong>;总数量:<strong>13.00</strong>;</div>
- </a-alert>
- <!-- 列表 -->
- <s-table
- class="sTable"
- ref="table"
- size="default"
- :rowKey="(record) => record.id"
- :columns="columns"
- :data="loadData"
- :scroll="{ x: 1960 }"
- bordered>
- <!-- 业务/审核状态 -->
- <template slot="auditStatus" slot-scope="text, record">
- <a-tag :color="record.state=='FINISH'?'green':'red'" >{{ record.state=='FINISH'? '待备货审核': '待单据审核' }}</a-tag>
- </template>
- <!-- 财务状态 -->
- <template slot="financialStatus" slot-scope="text, record">
- <a-tag :color="record.state==1?'green':'red'" >{{ record.state==1? '待提交': '待单据审核' }}</a-tag>
- </template>
- <!-- 操作 -->
- <template slot="action" slot-scope="text, record">
- <a-button size="small" type="link" @click="handleEexamine(record)" id="salesManagementList-eexamine-btn">审核</a-button>
- <a-divider type="vertical" style="margin: 0;" />
- <a-button size="small" type="link" @click="handleSend(record)" id="salesManagementList-send-btn">出库</a-button>
- <a-divider type="vertical" style="margin: 0;" />
- <a-button size="small" type="link" @click="handleDetail(record)" id="salesManagementList-detail-btn">详情</a-button>
- <a-divider type="vertical" style="margin: 0;" />
- <a-button size="small" type="link" @click="handleEdit(record)" id="salesManagementList-edit-btn">编辑</a-button>
- <a-divider type="vertical" style="margin: 0;" />
- <a-button size="small" type="link" @click="handleDel(record)" id="salesManagementList-del-btn">删除</a-button>
- </template>
- </s-table>
- <!-- 选择客户弹框 -->
- <choose-custom-modal :show="openModal" @ok="chooseCustomOk" @cancel="openModal=false"></choose-custom-modal>
- </a-card>
- </template>
- <script>
- import { STable, VSelect } from '@/components'
- import chooseCustomModal from './chooseCustomModal.vue'
- import { salesList, salesDel } from '@/api/sales'
- export default {
- name: 'TableList',
- components: { STable, VSelect, chooseCustomModal },
- data () {
- return {
- advanced: false, // 高级搜索 展开/关闭
- disabled: false, // 查询、重置按钮是否可操作
- dateFormat: 'YYYY-MM-DD',
- time: [], // 创建时间
- openModal: false, // 选择客户弹框是否显示
- customeList: [],
- // 查询参数
- queryParam: {
- buyerName: undefined, // 客户名称
- salesBillNo: '', // 销售单号
- purchaseBillNo: '', // 采购单号
- payType: undefined, // 支付方式
- settleStyle: undefined, // 收款方式
- auditStatus: undefined, // 业务状态
- financialStatus: undefined // 财务状态
- },
- // 表头
- columns: [
- { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
- { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
- { title: '销售单号', dataIndex: 'salesBillNo', width: 140, align: 'center' },
- { title: '采购单号', dataIndex: 'purchaseBillNo', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
- { title: '客户名称', dataIndex: 'buyerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
- { title: '总款数', dataIndex: 'totalCategory', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
- { title: '总数量', dataIndex: 'totalQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
- { title: '总售价', dataIndex: 'totalAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
- { title: '支付方式', dataIndex: 'payType', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
- { title: '收款方式', dataIndex: 'settleStyle', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
- { title: '审核时间', dataIndex: 'auditTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
- { title: '急件', dataIndex: 'urgentFlag', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
- { title: '业务状态', scopedSlots: { customRender: 'auditStatus' }, width: 110, align: 'center' },
- { title: '财务状态', scopedSlots: { customRender: 'financialStatus' }, width: 110, align: 'center' },
- { title: '操作', scopedSlots: { customRender: 'action' }, width: 260, align: 'center', fixed: 'right' }
- ],
- // 加载数据方法 必须为 Promise 对象
- loadData: parameter => {
- this.disabled = true
- return salesList(Object.assign(parameter, this.queryParam)).then(res => {
- const 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
- return data
- })
- }
- }
- },
- methods: {
- // 不可选日期
- disabledDate (date, dateStrings) {
- return date && date.valueOf() > Date.now()
- },
- // 新增
- handleAdd () {
- this.openModal = true
- },
- // 选择客户成功
- chooseCustomOk (data) {
- this.$router.push({ path: '/salesManagement/salesQuery/add' })
- },
- // 审核
- handleEexamine (row) {
- const _this = this
- this.$confirm({
- title: '提示',
- content: '确认要审核吗?',
- okText: '审核通过',
- cancelText: '审核不通过',
- centered: true,
- onOk () {
- // delectRolePower({
- // id: row.id
- // }).then(res => {
- // console.log(res, 'res1111')
- // if (res.status == 200) {
- // _this.$message.success(res.message)
- // _this.$refs.table.refresh()
- // }
- // })
- }
- })
- },
- // 出库
- handleSend (row) {
- const _this = this
- this.$confirm({
- title: '提示',
- content: '确认要出库吗?',
- centered: true,
- onOk () {
- // delectRolePower({
- // id: row.id
- // }).then(res => {
- // console.log(res, 'res1111')
- // if (res.status == 200) {
- // _this.$message.success(res.message)
- // _this.$refs.table.refresh()
- // }
- // })
- }
- })
- },
- // 详情
- handleDetail (row) {
- this.$router.push({ path: `/salesManagement/salesQuery/detail/${row.id}/${row.salesBillSn}` })
- },
- // 编辑
- handleEdit (row) {
- this.$router.push({ path: `/salesManagement/salesQuery/edit/${row.id}` })
- },
- // 删除
- handleDel (row) {
- const _this = this
- this.$confirm({
- title: '提示',
- content: '确认要删除吗?',
- centered: true,
- onOk () {
- salesDel({ id: row.id }).then(res => {
- if (res.status == 200) {
- _this.$message.success(res.message)
- _this.$refs.table.refresh()
- }
- })
- }
- })
- },
- resetSearchForm () {
- this.queryParam.buyerName = undefined
- this.queryParam.salesBillNo = ''
- this.queryParam.purchaseBillNo = ''
- this.queryParam.payType = undefined
- this.queryParam.settleStyle = undefined
- this.queryParam.auditStatus = undefined
- this.queryParam.financialStatus = undefined
- this.time = []
- this.$refs.table.refresh(true)
- },
- filterOption (input, option) {
- return (
- option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
- )
- }
- }
- }
- </script>
- <style lang="less">
- .ssalesManagementList-wrap{
- .sTable{
- margin-top: 15px;
- }
- }
- </style>
|