123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265 |
- <template>
- <a-card size="small" :bordered="false" class="purchaseOrderList-wrap">
- <!-- 搜索条件 -->
- <div 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="创建时间">
- <a-range-picker
- style="width:100%"
- id="purchaseOrderList-creatDate"
- :disabledDate="disabledDate"
- v-model="time"
- :format="dateFormat"
- :placeholder="['开始时间', '结束时间']" />
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="24">
- <a-form-item label="采购单号">
- <a-input id="purchaseOrderList-purchaseBillNo" v-model.trim="queryParam.purchaseBillNo" allowClear 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="purchaseOrderList-dealerName"
- placeholder="请选择供应商"
- allowClear
- v-model="queryParam.dealerName"
- :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>
- <template v-if="advanced">
- <a-col :md="6" :sm="24">
- <a-form-item label="单据状态">
- <v-select
- v-model="queryParam.auditStatus"
- ref="auditStatus"
- id="purchaseOrderList-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="purchaseOrderList-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" @click="$refs.table.refresh(true)" :disabled="disabled" id="purchaseOrderList-refresh">查询</a-button>
- <a-button style="margin-left: 8px" @click="resetSearchForm()" :disabled="disabled" id="purchaseOrderList-reset">重置</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 id="purchaseOrderList-add" type="primary" class="button-error" @click="handleAdd">新增</a-button>
- </div>
- <!-- alert -->
- <a-alert type="info" showIcon style="margin-bottom:15px">
- <div slot="message">共 <strong>6</strong> 条记录,采购数量合计 <strong>14</strong> ,采购金额合计¥<strong>14.00</strong> </div>
- </a-alert>
- <!-- 列表 -->
- <s-table
- class="sTable"
- ref="table"
- size="default"
- :rowKey="(record) => record.id"
- :columns="columns"
- :data="loadData"
- :scroll="{ x: 1495 }"
- bordered>
- <!-- 采购单号 -->
- <template slot="purchaseBillNo" slot-scope="text, record">
- <span style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ record.purchaseBillNo }}</span>
- </template>
- <!-- 业务/审核状态 -->
- <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="primary"
- class="button-info"
- @click="handleEdit(record)"
- id="purchasingManagement-edit-btn">编辑</a-button>
- <a-button
- size="small"
- type="primary"
- class="button-success"
- @click="handleDetail(record)"
- id="purchasingManagement-detail-btn">详情</a-button>
- <a-button
- size="small"
- type="primary"
- class="button-primary"
- @click="handleSubmit(record)"
- id="purchasingManagement-submit-btn">提交</a-button>
- <a-button
- size="small"
- type="primary"
- class="button-warning"
- @click="handleWarehouse(record)"
- id="purchasingManagement-warehouse-btn">签收入库</a-button>
- <a-button
- size="small"
- type="primary"
- class="button-error"
- @click="handleDel(record)"
- id="purchasingManagement-del-btn">删除</a-button>
- </template>
- </s-table>
- <!-- 选择基本信息弹框 -->
- <basic-info-modal :openModal="openModal" @ok="handleOk" @close="openModal=false" />
- </a-card>
- </template>
- <script>
- import { STable, VSelect } from '@/components'
- import basicInfoModal from './basicInfoModal.vue'
- import { purchaseList } from '@/api/purchase'
- export default {
- components: { STable, VSelect, basicInfoModal },
- data () {
- return {
- advanced: false, // 高级搜索 展开/关闭
- disabled: false, // 查询、重置按钮是否可操作
- openModal: false, // 基本信息弹框是否显示
- customeList: [],
- dateFormat: 'YYYY-MM-DD',
- time: [], // 创建时间
- // 查询参数
- queryParam: {},
- // 表头
- columns: [
- { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
- { title: '采购单号', scopedSlots: { customRender: 'purchaseBillNo' }, width: 140, align: 'center' },
- { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
- { title: '供应商', dataIndex: 'dealerName', align: 'center', customRender: function (text) { return text || '--' } },
- { 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: 115, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
- { title: '业务状态', scopedSlots: { customRender: 'auditStatus' }, width: 100, align: 'center' },
- { title: '财务状态', scopedSlots: { customRender: 'financialStatus' }, width: 100, align: 'center' },
- { title: '操作', scopedSlots: { customRender: 'action' }, width: 350, align: 'center', fixed: 'right' }
- ],
- // 加载数据方法 必须为 Promise 对象
- loadData: parameter => {
- this.disabled = true
- return purchaseList(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
- },
- // 基本信息 保存
- handleOk () {
- this.$router.push({ path: `/purchasingManagement/purchaseOrder/add` })
- },
- // 编辑
- handleEdit (row) {
- this.$router.push({ path: `/purchasingManagement/purchaseOrder/edit/${row.id}` })
- },
- // 详情
- handleDetail (row) {
- this.$router.push({ path: `/purchasingManagement/purchaseOrder/detail/${row.id}` })
- },
- // 提交
- handleSubmit () {
- },
- // 签收入库
- handleWarehouse (row) {
- this.$router.push({ path: `/purchasingManagement/purchaseOrder/warehousing/${row.id}` })
- },
- // 删除
- handleDel (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()
- // }
- // })
- }
- })
- },
- // 重置
- resetSearchForm () {
- this.queryParam.orderBundleNo = ''
- this.queryParam.orderBundle.custMobile = ''
- this.queryParam.bundleName = ''
- this.queryParam.itemName = ''
- this.oldTime = undefined
- this.newTime = undefined
- this.$refs.table.refresh(true)
- },
- filterOption (input, option) {
- return (
- option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
- )
- }
- },
- beforeRouteEnter (to, from, next) {
- next(vm => {
- vm.openModal = false
- })
- }
- }
- </script>
- <style lang="less">
- .purchaseOrderList-wrap{
- .sTable{
- margin-top: 15px;
- }
- }
- </style>
|